summaryrefslogtreecommitdiffstats
path: root/Tests/FindPackageModeMakefileTest/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/FindPackageModeMakefileTest/CMakeLists.txt')
-rw-r--r--Tests/FindPackageModeMakefileTest/CMakeLists.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
index 3674f0e..5d1b376 100644
--- a/Tests/FindPackageModeMakefileTest/CMakeLists.txt
+++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
@@ -19,8 +19,16 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile")
configure_file(FindFoo.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FindFoo.cmake @ONLY)
# now set up the test:
- get_target_property(cmakeExecutable cmake LOCATION)
-
+ if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
+ file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cmakeExecutable.mk"
+ CONTENT "CMAKE = \"$<TARGET_FILE:cmake>\"\n"
+ )
+ else()
+ get_target_property(cmakeLocation cmake LOCATION)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cmakeExecutable.mk"
+ "CMAKE = \"${cmakeLocation}\"\n"
+ )
+ endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Makefile.in ${CMAKE_CURRENT_BINARY_DIR}/ConfMakefile @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/main.cpp ${CMAKE_CURRENT_BINARY_DIR}/main.cpp COPYONLY)