summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/XcodeProject
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2015-02-11 19:48:43 (GMT)
committerBrad King <brad.king@kitware.com>2015-02-12 18:35:31 (GMT)
commitbf8f9c29e745933d5732f4481669c38ba8bdc3fc (patch)
treecaf2264967f14adddcdeb3579abfae84a12f17c9 /Tests/RunCMake/XcodeProject
parent0ec1f45a138bd7a9ad618f6e9dfa077a6bc8533c (diff)
downloadCMake-bf8f9c29e745933d5732f4481669c38ba8bdc3fc.zip
CMake-bf8f9c29e745933d5732f4481669c38ba8bdc3fc.tar.gz
CMake-bf8f9c29e745933d5732f4481669c38ba8bdc3fc.tar.bz2
Xcode: Teach XCODE_ATTRIBUTE target properties about generator expressions
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Diffstat (limited to 'Tests/RunCMake/XcodeProject')
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeAttributeGenex-check.cmake7
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeAttributeGenex.cmake4
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-result.txt1
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-stderr.txt6
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeAttributeGenexError.cmake4
6 files changed, 24 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index 8e4026b..792f40e 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -1,3 +1,5 @@
include(RunCMake)
run_cmake(XcodeFileType)
+run_cmake(XcodeAttributeGenex)
+run_cmake(XcodeAttributeGenexError)
diff --git a/Tests/RunCMake/XcodeProject/XcodeAttributeGenex-check.cmake b/Tests/RunCMake/XcodeProject/XcodeAttributeGenex-check.cmake
new file mode 100644
index 0000000..637df0f
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeAttributeGenex-check.cmake
@@ -0,0 +1,7 @@
+set(expect "TEST_HOST = \"[^;\"]*Tests/RunCMake/XcodeProject/XcodeAttributeGenex-build/[^;\"/]*/some\"")
+file(STRINGS ${RunCMake_TEST_BINARY_DIR}/XcodeAttributeGenex.xcodeproj/project.pbxproj actual
+ REGEX "TEST_HOST = .*;" LIMIT_COUNT 1)
+if(NOT "${actual}" MATCHES "${expect}")
+ message(SEND_ERROR "The actual project contains the line:\n ${actual}\n"
+ "which does not match expected regex:\n ${expect}\n")
+endif()
diff --git a/Tests/RunCMake/XcodeProject/XcodeAttributeGenex.cmake b/Tests/RunCMake/XcodeProject/XcodeAttributeGenex.cmake
new file mode 100644
index 0000000..760b882
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeAttributeGenex.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+add_executable(some main.c)
+add_executable(another main.c)
+set_property(TARGET another PROPERTY XCODE_ATTRIBUTE_TEST_HOST "$<TARGET_FILE:some>")
diff --git a/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-result.txt b/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-stderr.txt b/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-stderr.txt
new file mode 100644
index 0000000..9844158
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<NOTAGENEX>
+
+ Expression did not evaluate to a known generator expression
diff --git a/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError.cmake b/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError.cmake
new file mode 100644
index 0000000..98ad6c5
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeAttributeGenexError.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+add_executable(some main.c)
+add_executable(another main.c)
+set_property(TARGET another PROPERTY XCODE_ATTRIBUTE_TEST_HOST "$<NOTAGENEX>")