[CMake] How to exclude def files based on build configuration?
Iain Hull
Iain.Hull at cr2.com
Thu Jan 17 06:21:14 EST 2008
Hello,
We're migrating a large project from MSVC6.0 to CMake, still building
with .dsps for MSVC6.0 generated by Cmake. One of the projects uses two
different def file to export its symbols, one for debug builds the other
for release builds. This is currently achieved using the project
setting and conditionaly building the desired file based on build type.
Is this possible in Cmake? I have searched the mail archive but can
only find how to do this for make type builds using something like
IF(CMAKE_BUILD_TYPE MATCHES Debug)
# Add debug file
ELSE(CMAKE_BUILD_TYPE MATCHES Debug)
# Add release file
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug)
This does not work as the build type is chosen at build time not cmake
time with MSVC.
I have also looked at SET_SOURCE_FILES_PROPERTIES but cannot find how to
achieve it with that either.
Is Cmake able to conditionally include/enable source files based on
build configuration for MSVC projects?
Many thanks,
Iain.
More information about the CMake
mailing list