[Cmake] SET_SOURCE_FILES_PROPERTIES and nmake command line flag order

William A. Hoffman billlist at nycap . rr . com
Tue, 07 Oct 2003 16:14:15 -0400


1.  PROPERTIES is required, and if ommited this following error should be produced:

this->SetError("called with illegal arguments, maybe missing a PROPERTIES specifier?");

2. It is usually not a good idea to mix release and debug on windows as the run time
libraries are not compatible.   And the compile flags put library link information
into the .obj files.   I am not sure if it is an ordering problem.   You could see
if you can get it to work from the MS GUI by changing the order.  If that works you could do
something like this:

# save the standard cxx flags
   SET(SAVE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# set the standard flags to nothing
   SET(CMAKE_CXX_FLAGS )
# set all the files compile flags to the standard
   FOREACH source
     SET_SOURCE_FILES_PROPERTIES(vil_bicub_interp+byte-.cxx COMPILE_FLAGS ${SAVE_CXX_FLAGS})
# now override the ones for the file 
   SET_SOURCE_FILES_PROPERTIES(vil_bicub_interp+byte-.cxx COMPILE_FLAGS -Od)


-Bill
At 02:32 PM 10/7/2003, Wheeler, Frederick W (Research) wrote:
>CMake List:
>
>In the CMakeLists.txt file at $VXLSRC/core/vil/CMakeLists.txt I do this
>(this is actually a slight simplification),
>
>IF(CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE MATCHES "Windows-cl")
>  SET_SOURCE_FILES_PROPERTIES(vil_bicub_interp+byte-.cxx COMPILE_FLAGS -Od)
>ENDIF(CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE MATCHES "Windows-cl")
>
>This used to turn off optimization for that file in win2k using
>msvc6.0/nmake for a dart build that nominally compiles in Release mode.  I
>upgraded to CMake 1.8.1 a couple of weeks ago, and today I just noticed that
>I'm getting these warnings during the build (related events?).
>
>Building object file vil_bicub_interp+byte-.obj...
>Command line warning D4025 : overriding '/Od' with '/O2'
>vil_bicub_interp+byte-.cxx
>
>I'd prefer that /Od overrides /O2.  Perhaps this has to do with the ordering
>of the basic C++ flags and the special C++ flags from
>SET_SOURCE_FILES_PROPERTIES?  Is there some kind of fix or workaround?
>
>Also, Mastering CMake seems to indicate that the command should be
>  SET_SOURCE_FILES_PROPERTIES(vil_bicub_interp+byte-.cxx PROPERTIES
>COMPILE_FLAGS -Od)
>but the "PROPERTIES" is apparently optional.  Is omitting it OK?
>Deprecated?
>
>Thanks,
>Fred Wheeler
>_______________________________________________
>Cmake mailing list
>Cmake at www . cmake . org
>http://www . cmake . org/mailman/listinfo/cmake