[CMake] Passing preprocessor defs to VS2003

Mike Jackson imikejackson at gmail.com
Mon May 14 11:41:05 EDT 2007


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

Thanks
--
Mike Jackson
imikejackson & gmail * com





More information about the CMake mailing list