[Cmake] SET_SOURCE_FILES_PROPERTIES and nmake command line flag order

Wheeler, Frederick W (Research) wheeler at crd . ge . com
Tue, 7 Oct 2003 14:32:25 -0400


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