[cmake-developers] [CMake 0012945]: CMake should support custom commands that can vary by configuration

Mantis Bug Tracker mantis at public.kitware.com
Wed Feb 8 06:40:21 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12945 
====================================================================== 
Reported By:                Alessio
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12945
Category:                   CMake
Reproducibility:            always
Severity:                   feature
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2012-02-08 06:40 EST
Last Modified:              2012-02-08 06:40 EST
====================================================================== 
Summary:                    CMake should support custom commands that can vary
by configuration
Description: 
I think I have a use-case for the feature requested in issue 9974.

Boost DLLs/SOs need to be copied in place to run tests. The have config-specific
filenames, so the only way I can see to make it work is to copy all of them for
all configs, which is not ideal. Boost_SHARED_LIBRARIES_RELEASE and
Boost_SHARED_LIBRARIES_DEBUG below are constructed from the variables provided
by the FindBoost module.

foreach(file ${Boost_SHARED_LIBRARIES_RELEASE} ${Boost_SHARED_LIBRARIES_DEBUG})
	mb_message(STATUS "copying ${file} to binary dir")
	add_custom_command(
		TARGET SETUP_TESTS PRE_BUILD
		COMMAND ${CMAKE_COMMAND} -E copy_if_different ${file}
$<TARGET_FILE_DIR:${mod_name}>)
endforeach()

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-02-08 06:40 Alessio        New Issue                                    
======================================================================




More information about the cmake-developers mailing list