diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-02-26 14:59:18 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-03-31 21:18:44 (GMT) |
commit | bf98cc252f18e761ed9a57d2f7a9304bfbb621de (patch) | |
tree | 11dddd9eb207be750e39a959baae2bb3c115799b /Tests/RunCMake | |
parent | 8cd113ad1d715cc9ce865956870cd462d3659089 (diff) | |
download | CMake-bf98cc252f18e761ed9a57d2f7a9304bfbb621de.zip CMake-bf98cc252f18e761ed9a57d2f7a9304bfbb621de.tar.gz CMake-bf98cc252f18e761ed9a57d2f7a9304bfbb621de.tar.bz2 |
Genex: Evaluate TARGET_OBJECTS as a normal expression.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/TargetObjects/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/TargetObjects/NoTarget-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/TargetObjects/NoTarget-stderr.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/TargetObjects/NoTarget.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/TargetObjects/RunCMakeTest.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/TargetObjects/empty.cpp | 7 |
10 files changed, 39 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 7691f32..31e7805 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -49,6 +49,7 @@ add_RunCMake_test(GeneratorToolset) add_RunCMake_test(TargetPropertyGeneratorExpressions) add_RunCMake_test(Languages) add_RunCMake_test(ObjectLibrary) +add_RunCMake_test(TargetObjects) add_RunCMake_test(find_dependency) if(NOT WIN32) add_RunCMake_test(PositionIndependentCode) diff --git a/Tests/RunCMake/TargetObjects/CMakeLists.txt b/Tests/RunCMake/TargetObjects/CMakeLists.txt new file mode 100644 index 0000000..be9d403 --- /dev/null +++ b/Tests/RunCMake/TargetObjects/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST}) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetObjects/NoTarget-result.txt b/Tests/RunCMake/TargetObjects/NoTarget-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NoTarget-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetObjects/NoTarget-stderr.txt b/Tests/RunCMake/TargetObjects/NoTarget-stderr.txt new file mode 100644 index 0000000..2c4f877 --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NoTarget-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at NoTarget.cmake:2 \(file\): + Error evaluating generator expression: + + \$<TARGET_OBJECTS:NoTarget> + + Objects of target "NoTarget" referenced but no such target exists. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/TargetObjects/NoTarget.cmake b/Tests/RunCMake/TargetObjects/NoTarget.cmake new file mode 100644 index 0000000..f203c23 --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NoTarget.cmake @@ -0,0 +1,2 @@ + +file(GENERATE OUTPUT test_output CONTENT $<TARGET_OBJECTS:NoTarget>) diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt b/Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt b/Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt new file mode 100644 index 0000000..bb83934 --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at NotObjlibTarget.cmake:4 \(file\): + Error evaluating generator expression: + + \$<TARGET_OBJECTS:StaticLib> + + Objects of target "StaticLib" referenced but is not an OBJECT library. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake new file mode 100644 index 0000000..c7f8a71 --- /dev/null +++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake @@ -0,0 +1,4 @@ + +add_library(StaticLib empty.cpp) + +file(GENERATE OUTPUT test_output CONTENT $<TARGET_OBJECTS:StaticLib>) diff --git a/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake b/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake new file mode 100644 index 0000000..30b9fee --- /dev/null +++ b/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(NoTarget) +run_cmake(NotObjlibTarget) diff --git a/Tests/RunCMake/TargetObjects/empty.cpp b/Tests/RunCMake/TargetObjects/empty.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/TargetObjects/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} |