MantisBT - CMake | ||||||||||
View Issue Details | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0012438 | CMake | CMake | public | 2011-09-01 04:20 | 2012-09-03 16:00 | |||||
Reporter | chrislu | |||||||||
Assigned To | Brad King | |||||||||
Priority | immediate | Severity | block | Reproducibility | always | |||||
Status | closed | Resolution | duplicate | |||||||
Platform | PC | OS | Windows | OS Version | 7 x64 SP1 | |||||
Product Version | CMake 2.8.5 | |||||||||
Target Version | Fixed in Version | |||||||||
Summary | 0012438: add_command _needs_ CONFIGURATION parameter for multi-target environments | |||||||||
Description | Why do i need to jump too such hoops to do a simple thing as to add different post build commands to release and debug builds... and then it does not even do what i want. This just wants to add dll files for release and debug builds to the respective directories: get_directory_property(link_dirs LINK_DIRECTORIES) list(REMOVE_ITEM in_libraries debug optimized general) list(REMOVE_ITEM link_dirs ${SCHISM_LIBRARY_DIR}) set(conf_list release debug) foreach(conf ${conf_list}) foreach(link_lib ${in_libraries}) set(link_lib_dll ${link_lib}.dll) foreach(ldir ${link_dirs}) set(dll_path ${ldir}/${conf}/${link_lib_dll}) if (EXISTS ${dll_path}) # make if fail for the wrong configuration string(REPLACE /${conf}/ "/$<CONFIGURATION>/" dll_path ${dll_path}) add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND if EXIST ${dll_path} ${CMAKE_COMMAND} -E echo "copying ${link_lib_dll} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIGURATION>/" COMMAND if EXIST ${dll_path} ${CMAKE_COMMAND} -E copy_if_different ${dll_path} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIGURATION>/) endif (EXISTS ${dll_path}) endforeach(ldir) endforeach(link_lib) endforeach(conf) | |||||||||
Steps To Reproduce | ||||||||||
Additional Information | ||||||||||
Tags | No tags attached. | |||||||||
Relationships |
| |||||||||
Attached Files | ||||||||||
Issue History | ||||||||||
Date Modified | Username | Field | Change | |||||||
2011-09-01 04:20 | chrislu | New Issue | ||||||||
2012-03-09 14:42 | Brad King | Relationship added | related to 0009974 | |||||||
2012-03-09 14:44 | Brad King | Relationship replaced | duplicate of 0009974 | |||||||
2012-03-09 14:49 | Brad King | Note Added: 0028885 | ||||||||
2012-03-09 14:49 | Brad King | Status | new => resolved | |||||||
2012-03-09 14:49 | Brad King | Resolution | open => duplicate | |||||||
2012-03-09 14:49 | Brad King | Assigned To | => Brad King | |||||||
2012-09-03 16:00 | David Cole | Note Added: 0030833 | ||||||||
2012-09-03 16:00 | David Cole | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|