Created
April 15, 2018 08:32
-
-
Save bolry/a806bc20079c08203621d40e99f55fc3 to your computer and use it in GitHub Desktop.
Example of using copy and "generator" with CMake-files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.11) | |
project(LearningCMake) | |
set(Hmm "${CMAKE_CURRENT_BINARY_DIR}/hmm.cpp") | |
set(Foo "${CMAKE_CURRENT_BINARY_DIR}/foo.cpp") | |
set(Bar "${CMAKE_CURRENT_BINARY_DIR}/bar.cpp") | |
add_executable(LearningCMake ${Hmm} "${Foo}" "${Bar}") | |
add_custom_command(OUTPUT ${Hmm} | |
COMMAND cp hmm.xml ${Hmm} | |
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" | |
DEPENDS hmm.xml) | |
configure_file(foo.txt "${Foo}" COPYONLY) | |
configure_file(bar.txt "${Bar}" COPYONLY) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment