summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-10-07 20:37:23 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-10-24 17:05:34 (GMT)
commit310aef959b6e41d60f35eec4b4a2e5698aa42abe (patch)
tree3ae78b8cf8377230dfdbea7470aeae7018a4a18a
parent30ff6cf9e9b3211a54187e416d6cc2ce9b0e9b77 (diff)
downloadCMake-310aef959b6e41d60f35eec4b4a2e5698aa42abe.zip
CMake-310aef959b6e41d60f35eec4b4a2e5698aa42abe.tar.gz
CMake-310aef959b6e41d60f35eec4b4a2e5698aa42abe.tar.bz2
Make ExportLanguages a subtest of the ObjectLibrary test
It was a subtest of the RunCMake.ObjectLibrary test. However, we need to test a build with ExternalProject after running CMake, which RunCMake tests do not do.
-rw-r--r--Tests/ObjectLibrary/CMakeLists.txt2
-rw-r--r--Tests/ObjectLibrary/ExportLanguages/CMakeLists.txt15
-rw-r--r--Tests/ObjectLibrary/ExportLanguages/ExportLanguagesTest/CMakeLists.txt14
-rw-r--r--Tests/ObjectLibrary/ExportLanguages/a.c1
-rw-r--r--Tests/ObjectLibrary/ExportLanguages/a.cxx (renamed from Tests/RunCMake/ObjectLibrary/a.cxx)0
-rw-r--r--Tests/RunCMake/ObjectLibrary/ExportLanguages.cmake15
-rw-r--r--Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake1
7 files changed, 32 insertions, 16 deletions
diff --git a/Tests/ObjectLibrary/CMakeLists.txt b/Tests/ObjectLibrary/CMakeLists.txt
index 13a07b4..0aeefaa 100644
--- a/Tests/ObjectLibrary/CMakeLists.txt
+++ b/Tests/ObjectLibrary/CMakeLists.txt
@@ -58,3 +58,5 @@ target_compile_definitions(ABmain PUBLIC $<TARGET_PROPERTY:B,INTERFACE_COMPILE_D
add_executable(UseABinternal ${dummy}
$<TARGET_OBJECTS:ABmain> $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:B>
)
+
+add_subdirectory(ExportLanguages)
diff --git a/Tests/ObjectLibrary/ExportLanguages/CMakeLists.txt b/Tests/ObjectLibrary/ExportLanguages/CMakeLists.txt
new file mode 100644
index 0000000..22c92a7
--- /dev/null
+++ b/Tests/ObjectLibrary/ExportLanguages/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 2.8)
+project(ExportLanguages CXX)
+add_library(ExportLanguagesA OBJECT a.cxx)
+add_library(ExportLanguagesB STATIC a.c $<TARGET_OBJECTS:ExportLanguagesA>)
+
+# Verify that object library languages are propagated.
+export(TARGETS ExportLanguagesB NAMESPACE Exp FILE BExport.cmake)
+include(ExternalProject)
+ExternalProject_Add(ExportLanguagesTest
+ SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ExportLanguagesTest"
+ BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/ExportLanguagesTest"
+ DOWNLOAD_COMMAND ""
+ INSTALL_COMMAND ""
+)
+add_dependencies(ExportLanguagesTest ExportLanguagesA ExportLanguagesB)
diff --git a/Tests/ObjectLibrary/ExportLanguages/ExportLanguagesTest/CMakeLists.txt b/Tests/ObjectLibrary/ExportLanguages/ExportLanguagesTest/CMakeLists.txt
new file mode 100644
index 0000000..fc8dd2b
--- /dev/null
+++ b/Tests/ObjectLibrary/ExportLanguages/ExportLanguagesTest/CMakeLists.txt
@@ -0,0 +1,14 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(ExportLanguagesTest)
+
+include(${CMAKE_CURRENT_BINARY_DIR}/../BExport.cmake)
+get_property(configs TARGET ExpExportLanguagesB PROPERTY IMPORTED_CONFIGURATIONS)
+foreach(c ${configs})
+ get_property(langs TARGET ExpExportLanguagesB PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES_${c})
+ list(FIND langs CXX pos)
+ if(${pos} LESS 0)
+ message(FATAL_ERROR "Target export does not list object library languages.")
+ endif()
+endforeach()
diff --git a/Tests/ObjectLibrary/ExportLanguages/a.c b/Tests/ObjectLibrary/ExportLanguages/a.c
new file mode 100644
index 0000000..af20d3f
--- /dev/null
+++ b/Tests/ObjectLibrary/ExportLanguages/a.c
@@ -0,0 +1 @@
+int a(void) { return 0; }
diff --git a/Tests/RunCMake/ObjectLibrary/a.cxx b/Tests/ObjectLibrary/ExportLanguages/a.cxx
index ae9c87c..ae9c87c 100644
--- a/Tests/RunCMake/ObjectLibrary/a.cxx
+++ b/Tests/ObjectLibrary/ExportLanguages/a.cxx
diff --git a/Tests/RunCMake/ObjectLibrary/ExportLanguages.cmake b/Tests/RunCMake/ObjectLibrary/ExportLanguages.cmake
deleted file mode 100644
index 0796c21..0000000
--- a/Tests/RunCMake/ObjectLibrary/ExportLanguages.cmake
+++ /dev/null
@@ -1,15 +0,0 @@
-enable_language(CXX)
-add_library(A OBJECT a.cxx)
-add_library(B STATIC a.c $<TARGET_OBJECTS:A>)
-
-# Verify that object library languages are propagated.
-export(TARGETS B NAMESPACE Exp FILE BExport.cmake)
-include(${CMAKE_CURRENT_BINARY_DIR}/BExport.cmake)
-get_property(configs TARGET ExpB PROPERTY IMPORTED_CONFIGURATIONS)
-foreach(c ${configs})
- get_property(langs TARGET ExpB PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES_${c})
- list(FIND langs CXX pos)
- if(${pos} LESS 0)
- message(FATAL_ERROR "Target export does not list object library languages.")
- endif()
-endforeach()
diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
index 55db14d..a74eaa8 100644
--- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
@@ -6,7 +6,6 @@ run_cmake(BadSourceExpression3)
run_cmake(BadObjSource1)
run_cmake(BadObjSource2)
run_cmake(Export)
-run_cmake(ExportLanguages)
run_cmake(Import)
run_cmake(Install)
run_cmake(LinkObjLHS)