MantisBT - CMake
View Issue Details
0010809CMakeCMakepublic2010-06-09 16:122011-01-31 16:07
Derek Bruening 
Brad King 
normalminoralways
closedfixed 
CMake-2-8 
CMake 2.8.4CMake 2.8.4 
0010809: support setting the config/build type used for initial try_compiles
There is no way to set the build type used for the try_compile in CMake's working compiler check and its ABI determination. CMAKE_TRY_COMPILE_CONFIGURATION is only honored for multi-config generators like Visual Studio project files.

My current workaround is to set CMAKE_MODULE_PATH such that my custom Plaform/Windows-cl.cmake is included, which looks like:

  include(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
  set(CMAKE_BUILD_TYPE_INIT Release)

Note that my motivation for this is to avoid pdb creation when compiling over cygwin ssh. xref http://www.cmake.org/pipermail/cmake/2010-May/037212.html [^]
No tags attached.
related to 0000371closed Brad King Add build configuration for try compiles using cmake variable 
Issue History
2010-06-09 16:12Derek BrueningNew Issue
2011-01-17 16:43David ColeAssigned To => Brad King
2011-01-17 16:43David ColeStatusnew => assigned
2011-01-17 16:47Brad KingNote Added: 0024828
2011-01-17 16:50Brad KingRelationship addedrelated to 0000371
2011-01-17 16:50Brad KingNote Added: 0024829
2011-01-17 16:51Brad KingNote Added: 0024830
2011-01-17 17:27Brad KingNote Added: 0024833
2011-01-17 17:27Brad KingStatusassigned => closed
2011-01-17 17:27Brad KingResolutionopen => fixed
2011-01-31 16:07David ColeFixed in Version => CMake 2.8.4
2011-01-31 16:07David ColeTarget Version => CMake 2.8.4

Notes
(0024828)
Brad King   
2011-01-17 16:47   
try_compile(... CMAKE_FLAGS -DCMAKE_BUILD_TYPE=Release ...)
(0024829)
Brad King   
2011-01-17 16:50   
Wow, the origin of CMAKE_TRY_COMPILE_CONFIGURATION takes me back:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=467fa9df [^]
(0024830)
Brad King   
2011-01-17 16:51   
We should honor CMAKE_TRY_COMPILE_CONFIGURATION for all try_compile calls so that it works for those invoked by CMake's builtin modules too.
(0024833)
Brad King   
2011-01-17 17:27   
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56efc60f [^]