View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0007868 | CMake | CMake | public | 2008-10-28 05:11 | 2008-12-15 13:30 | ||||
Reporter | Christian Ehrlicher | ||||||||
Assigned To | Brad King | ||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | CMake-2-6 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0007868: CMAKE_DEBUG_POSTFIX does not affect executables | ||||||||
Description | CMakeLists.txt: ----------------------------8<------------------ set(CMAKE_DEBUG_POSTFIX d) add_executable(test_exe main.cpp) add_library(test_dll SHARED main.cpp) add_library(test_lib STATIC main.cpp) get_target_property(loc test_exe LOCATION) message(STATUS "test_exe: ${loc}") get_target_property(loc test_exe DEBUG_LOCATION) message(STATUS "test_exe: ${loc}") get_target_property(loc test_lib LOCATION) message(STATUS "test_lib: ${loc}") get_target_property(loc test_lib DEBUG_LOCATION) message(STATUS "test_lib: ${loc}") get_target_property(loc test_dll LOCATION) message(STATUS "test_dll: ${loc}") get_target_property(loc test_dll DEBUG_LOCATION) message(STATUS "test_dll: ${loc}") ----------------------------8<------------------ result: ----------------------------8<------------------ --E:\cmake-test>cmake . -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -- The C compiler identification is MSVC -- The CXX compiler identification is MSVC -- Check for CL compiler version -- Check for CL compiler version - 1400 -- Check if this is a free VC compiler -- Check if this is a free VC compiler - no -- Check CL platform -- Check CL platform - 32 bit -- Check for working C compiler: C:/Programme/Microsoft Visual Studio 8/VC/bin/c l.exe -- Check for working C compiler: C:/Programme/Microsoft Visual Studio 8/VC/bin/c l.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: C:/Programme/Microsoft Visual Studio 8/VC/bin /cl.exe -- Check for working CXX compiler: C:/Programme/Microsoft Visual Studio 8/VC/bin /cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- test_exe: E:/cmake-test/test_exe.exe -- test_exe: E:/cmake-test/test_exe.exe -- test_lib: E:/cmake-test/test_lib.lib -- test_lib: E:/cmake-test/test_libd.lib -- test_dll: E:/cmake-test/test_dll.dll -- test_dll: E:/cmake-test/test_dlld.dll --------------------------8<------------------ As you can see there's no 'd' appended to the executable. Also LOCATION returns the wrong target name. | ||||||||
Additional Information | The issue also affects the Visual Studio generator: --------------------------8<------------------ Check for working C compiler: C:/Programme/Microsoft Visual Studio 8/VC/bin/cl.exe Check for working C compiler: C:/Programme/Microsoft Visual Studio 8/VC/bin/cl.exe -- works Detecting C compiler ABI info Detecting C compiler ABI info - done Check for working CXX compiler: C:/Programme/Microsoft Visual Studio 8/VC/bin/cl.exe Check for working CXX compiler: C:/Programme/Microsoft Visual Studio 8/VC/bin/cl.exe -- works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done test_exe: E:/cmake-test/$(OutDir)/test_exe.exe test_exe: E:/cmake-test/DEBUG/test_exe.exe test_lib: E:/cmake-test/$(OutDir)/test_lib.lib test_lib: E:/cmake-test/DEBUG/test_libd.lib test_dll: E:/cmake-test/$(OutDir)/test_dll.dll test_dll: E:/cmake-test/DEBUG/test_dlld.dll --------------------------8<------------------ You can't add a proper post_build target with the output of LOCATION... :( | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0014344) Brad King (manager) 2008-12-15 13:10 |
There is a documentation bug. The CMAKE_DEBUG_POSTFIX variable only affects library targets. Furthermore, the LOCATION property cannot be made to work with per-configuration executable names for various reasons (compatibility, VS IDE support, etc.). In CMake 2.6 and above you don't need the LOCATION property. You can just name the target in the command. Furthermore, the DEBUG_OUTPUT_NAME property can change the name of an executable. add_executable(foo foo.c) set_property(TARGET foo PROPERTY DEBUG_OUTPUT_NAME foo_d) add_custom_command(TARGET foo POST_BUILD COMMAND foo) |
(0014345) Brad King (manager) 2008-12-15 13:13 |
Okay, there is one more detail. The CMAKE_DEBUG_POSTFIX variable is just used to *initialize* the target property DEBUG_POSTFIX when a (non-executable) target is created. Setting the property directly does work on any target: set_property(TARGET foo PROPERTY DEBUG_POSTFIX _d) I'll update the documentation of the variable. |
(0014346) Brad King (manager) 2008-12-15 13:30 |
I've fixed the generated documentation related to this: /cvsroot/CMake/CMake/Source/cmDocumentVariables.cxx,v <-- Source/cmDocumentVariables.cxx new revision: 1.22; previous revision: 1.21 /cvsroot/CMake/CMake/Source/cmTarget.cxx,v <-- Source/cmTarget.cxx new revision: 1.230; previous revision: 1.229 |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2008-10-28 05:11 | Christian Ehrlicher | New Issue | |
2008-12-15 13:10 | Brad King | Note Added: 0014344 | |
2008-12-15 13:13 | Brad King | Note Added: 0014345 | |
2008-12-15 13:13 | Brad King | Status | new => assigned |
2008-12-15 13:13 | Brad King | Assigned To | => Brad King |
2008-12-15 13:30 | Brad King | Note Added: 0014346 | |
2008-12-15 13:30 | Brad King | Status | assigned => closed |
2008-12-15 13:30 | Brad King | Resolution | open => fixed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |