summaryrefslogtreecommitdiffstats
path: root/Tests/FindPackageModeMakefileTest
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-06-28 14:37:39 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-10-11 19:17:27 (GMT)
commite4e5b28c27dc2e6f0073e11fb64c4ea62022a051 (patch)
treeba7aa13e6521fcf786811b9679b23269a11e5d36 /Tests/FindPackageModeMakefileTest
parent7e4910fe47d667e059e42ac6395b0f4726f17064 (diff)
downloadCMake-e4e5b28c27dc2e6f0073e11fb64c4ea62022a051.zip
CMake-e4e5b28c27dc2e6f0073e11fb64c4ea62022a051.tar.gz
CMake-e4e5b28c27dc2e6f0073e11fb64c4ea62022a051.tar.bz2
cmTarget: Deprecate the LOCATION target property with a policy.
The final location and name of a build-target is not determined until generate-time. However, reading the LOCATION property from a target is currently allowed at configure time. Apart from creating possibly-erroneous results, this has an impact on the implementation of cmake itself, and prevents some major cleanups from being made. Disallow reading LOCATION from build-targets with a policy. Port some existing uses of it in CMake itself to use the TARGET_FILE generator expression.
Diffstat (limited to 'Tests/FindPackageModeMakefileTest')
-rw-r--r--Tests/FindPackageModeMakefileTest/CMakeLists.txt12
-rw-r--r--Tests/FindPackageModeMakefileTest/Makefile.in4
2 files changed, 13 insertions, 3 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)
diff --git a/Tests/FindPackageModeMakefileTest/Makefile.in b/Tests/FindPackageModeMakefileTest/Makefile.in
index f647901..c91d8a0 100644
--- a/Tests/FindPackageModeMakefileTest/Makefile.in
+++ b/Tests/FindPackageModeMakefileTest/Makefile.in
@@ -1,4 +1,6 @@
-CMAKE = "@cmakeExecutable@"
+
+include cmakeExecutable.mk
+
CMAKE_CURRENT_BINARY_DIR = "@CMAKE_CURRENT_BINARY_DIR@"
CMAKE_CXX_COMPILER = "@CMAKE_CXX_COMPILER@"
CMAKE_CXX_COMPILER_ID = "@CMAKE_CXX_COMPILER_ID@"