summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-13 08:07:16 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-13 08:59:50 (GMT)
commitb8af20116854b51923da9ebef668fba0072b06c4 (patch)
tree3da0a2439e43d2d71bbf094bb9553cb035ad3901 /Tests
parent3927747547a5ddc9495cc4796876e207f2cae811 (diff)
downloadCMake-b8af20116854b51923da9ebef668fba0072b06c4.zip
CMake-b8af20116854b51923da9ebef668fba0072b06c4.tar.gz
CMake-b8af20116854b51923da9ebef668fba0072b06c4.tar.bz2
cmTarget: Fix listing of source files at configure-time.
Since commit e5da9e51 (cmTarget: Allow any generator expression in SOURCES property., 2014-03-18), source files are computed by true evaluation of generator expressions, including TARGET_OBJECTS. This evaluation requires the presence of cmGeneratorTarget objects since commit bf98cc25 (Genex: Evaluate TARGET_OBJECTS as a normal expression., 2014-02-26). Ensure that we don't attempt to evaluate the TARGET_OBJECTS generator expression at configure-time, as can happen if CMP0024 or CMP0026 are OLD. Use old-style parsing of the source item to extract object target names in that case. Avoid calling GetProperty("SOURCES") to bypass warnings from CMP0051. Refactor existing logic in GetLanguages which is similar in intent to the new GetSourceFiles code.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/TargetSources/CMP0026-LOCATION-result.txt1
-rw-r--r--Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt1
-rw-r--r--Tests/RunCMake/TargetSources/CMP0026-LOCATION.cmake13
-rw-r--r--Tests/RunCMake/TargetSources/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/TargetSources/RunCMakeTest.cmake2
5 files changed, 18 insertions, 1 deletions
diff --git a/Tests/RunCMake/TargetSources/CMP0026-LOCATION-result.txt b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/TargetSources/CMP0026-LOCATION.cmake b/Tests/RunCMake/TargetSources/CMP0026-LOCATION.cmake
new file mode 100644
index 0000000..464df36
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/CMP0026-LOCATION.cmake
@@ -0,0 +1,13 @@
+
+cmake_policy(SET CMP0026 OLD)
+
+add_library(objlib OBJECT
+ empty_1.cpp
+)
+
+add_executable(my_exe
+ empty_2.cpp
+ $<TARGET_OBJECTS:objlib>
+)
+
+get_target_property( loc my_exe LOCATION)
diff --git a/Tests/RunCMake/TargetSources/CMakeLists.txt b/Tests/RunCMake/TargetSources/CMakeLists.txt
index 12cd3c7..f452db1 100644
--- a/Tests/RunCMake/TargetSources/CMakeLists.txt
+++ b/Tests/RunCMake/TargetSources/CMakeLists.txt
@@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 2.8.4)
-project(${RunCMake_TEST} NONE)
+project(${RunCMake_TEST} CXX)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
index b9095f9..01e505c 100644
--- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
@@ -7,3 +7,5 @@ if(RunCMake_GENERATOR MATCHES Xcode
else()
run_cmake(OriginDebug)
endif()
+
+run_cmake(CMP0026-LOCATION)