summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-01-30 17:04:38 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-01-30 17:04:38 (GMT)
commit8a83f096371ecc4f73afe43830e94899c704d5cf (patch)
treee035e45d661fcc35189daafa686484577b502ddc /Tests
parent21e6791789be947c471d0c551e69364e9f475b7e (diff)
downloadCMake-8a83f096371ecc4f73afe43830e94899c704d5cf.zip
CMake-8a83f096371ecc4f73afe43830e94899c704d5cf.tar.gz
CMake-8a83f096371ecc4f73afe43830e94899c704d5cf.tar.bz2
ENH: fix for bug 3218 dependant projects are written out automatically if they are in the project. Also fix bug 5829, remove hard coded CMAKE_CONFIGURATION_TYPES from vs 7 generator
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt36
-rw-r--r--Tests/SubProject/CMakeLists.txt5
-rw-r--r--Tests/SubProject/bar.cxx4
-rw-r--r--Tests/SubProject/car.cxx6
4 files changed, 49 insertions, 2 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 09c62e1..8314fbd 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -52,7 +52,40 @@ IF(BUILD_TESTING)
ADD_TEST_MACRO(SourceGroups SourceGroups)
ADD_TEST_MACRO(Preprocess Preprocess)
ADD_TEST_MACRO(ExportImport ExportImport)
-
+
+ # test for correct sub-project generation
+ # not implemented in VS6 or Xcode
+ IF(NOT MSVC60 AND NOT XCODE)
+ # run cmake and configure all of SubProject
+ # but only build the independent executable car
+ ADD_TEST(SubProject ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/SubProject"
+ "${CMake_BINARY_DIR}/Tests/SubProject"
+ --build-project SubProject
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-target car
+ --test-command car
+ )
+ # For stage 2, do not run cmake again.
+ # Then build the foo sub project which should build
+ # the bar library which should be referenced because
+ # foo links to the static library bar, but bar is not
+ # directly in the foo sub project
+ ADD_TEST(SubProject-Stage2 ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/SubProject/foo"
+ "${CMake_BINARY_DIR}/Tests/SubProject/foo"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-nocmake
+ --build-project foo
+ --build-target foo
+ --test-command foo
+ )
+ ENDIF(NOT MSVC60 AND NOT XCODE)
+
IF (CMAKE_STRICT)
ADD_TEST_MACRO(DocTest DocTest)
ENDIF (CMAKE_STRICT)
@@ -505,7 +538,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
ENDIF(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES syllable)
-
ADD_TEST(linkorder1 ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/LinkLineOrder"
diff --git a/Tests/SubProject/CMakeLists.txt b/Tests/SubProject/CMakeLists.txt
new file mode 100644
index 0000000..f825749
--- /dev/null
+++ b/Tests/SubProject/CMakeLists.txt
@@ -0,0 +1,5 @@
+project(SubProject)
+message("${CMAKE_IMPORT_LIBRARY_SUFFIX}")
+add_library(bar bar.cxx)
+add_executable(car car.cxx)
+add_subdirectory(foo)
diff --git a/Tests/SubProject/bar.cxx b/Tests/SubProject/bar.cxx
new file mode 100644
index 0000000..c3f6a18
--- /dev/null
+++ b/Tests/SubProject/bar.cxx
@@ -0,0 +1,4 @@
+int bar()
+{
+ return 10;
+}
diff --git a/Tests/SubProject/car.cxx b/Tests/SubProject/car.cxx
new file mode 100644
index 0000000..95de4a3
--- /dev/null
+++ b/Tests/SubProject/car.cxx
@@ -0,0 +1,6 @@
+int main(int ac, char** av)
+{
+ (void) ac;
+ (void) av;
+ return 0;
+}