[CMake] Passing preprocessor defs to VS2003

Bill Hoffman bill.hoffman at kitware.com
Mon May 14 11:50:10 EDT 2007


Mike Jackson wrote:
> This is going to be a hopefully simple question.
>
> I need to pass a simple preprocessor definition to the compiler based 
> on if the system is windows. So I created a simple option:
>
> OPTION(WIN_LARGE_FILE_SUPPORT "Description" ON)
> IF (WIN_LARGE_FILE_SUPPORT)
> ADD_DEFINITIONS("-D WIN_LARGE_FILE_SUPPORT")
> ENDIF (WIN_LARGE_FILE_SUPPORT)
>
> But Visual studio is adding it as just "WIN_LARGE_FILE_SUPPORT" and 
> not "-D WIN_LARGE_FILE_SUPPORT". So what am I doing wrong?
>
> This is with Cmake 2.4.6 and Visual Studio 2003 .Net
Remove the space.  -DWIN_LARGE_FILE_SUPPORT

-Bill



More information about the CMake mailing list