Introduce "generator expressions" to add_test()
[cmake.git] / Tests / CustomCommandWorkingDirectory / CMakeLists.txt
blob57cb712ab8787135a249247d6ce4b3975d8c752d
1 cmake_minimum_required (VERSION 2.6)
2 PROJECT(TestWorkingDir)
4 ADD_CUSTOM_COMMAND(
5   OUTPUT "${TestWorkingDir_BINARY_DIR}/working.c"
6   COMMAND "${CMAKE_COMMAND}" -E copy ./working.c.in "${TestWorkingDir_BINARY_DIR}/working.c"
7   WORKING_DIRECTORY "${TestWorkingDir_SOURCE_DIR}"
8   COMMENT "custom command"
11 SET_SOURCE_FILES_PROPERTIES(
12   "${TestWorkingDir_BINARY_DIR}/working.c" 
13   "${TestWorkingDir_BINARY_DIR}/customTarget.c" 
14   PROPERTIES GENERATED 1)
16 ADD_EXECUTABLE(working "${TestWorkingDir_BINARY_DIR}/working.c" 
17   "${TestWorkingDir_BINARY_DIR}/customTarget.c")
19 ADD_CUSTOM_TARGET(
20   Custom ALL
21   COMMAND "${CMAKE_COMMAND}" -E copy_if_different ./customTarget.c "${TestWorkingDir_BINARY_DIR}/customTarget.c"
22   WORKING_DIRECTORY  "${TestWorkingDir_SOURCE_DIR}"
25 ADD_DEPENDENCIES(working Custom)