[CMake] Convert unix c++ compiler flags to windows compiler flags?

Steve Huston shuston at riverace.com
Fri Jun 5 09:10:51 EDT 2009


> I have these compiler flags in a CMakeList.txt file for some linux
code:
>
> SET(CMAKE_CXX_FLAGS 
> "${CMAKE_CXX_FLAGS} -w -lX11 -Dcimg_use_xshm -lXext
-Dcimg_use_xrandr -lXrandr 
> -O3 -fpermissive -march=nocona -m64 -ffast-math -funroll-loops
-finline-functions")
>
> Any ideas on who I convert those to windows (Visual Studio 2008)
flags? 

The -l options should be relocated to target_add_library (or close...
I'm not near my cmake docs)

The optimization-related options don't translate directly. You need to
check with the VS2008 docs to see what you want to include for that
compiler. Set them in a MSVC-specific block in the CMakeLists.txt
file.

-Steve



More information about the CMake mailing list