Przeglądaj źródła

ENH: shift to using ADD_SUBDIRECTORY

Ken Martin 20 lat temu
rodzic
commit
2e4258efc1

+ 2 - 1
Tests/Complex/CMakeLists.txt

@@ -273,7 +273,8 @@ ENDIF(NOT STRING_REGEX_PASSED)
 #
 # Create the libs and the main exe
 #
-SUBDIRS(Library Executable)
+ADD_SUBDIRECTORY(Library)
+ADD_SUBDIRECTORY(Executable)
 SUBDIR_DEPENDS(Executable Library)
 EXPORT_LIBRARY_DEPENDENCIES(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake)
 INCLUDE(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL)

+ 1 - 1
Tests/Complex/Executable/CMakeLists.txt

@@ -65,7 +65,7 @@ ADD_CUSTOM_COMMAND(
 # has no side-effects on the current Makefile (duplicated source file
 # due to source list expansion done twice).
 #
-SUBDIRS(Temp)
+ADD_SUBDIRECTORY(Temp)
 
 #
 # Extra coverage.Not used.

+ 2 - 1
Tests/ComplexOneConfig/CMakeLists.txt

@@ -273,7 +273,8 @@ ENDIF(NOT STRING_REGEX_PASSED)
 #
 # Create the libs and the main exe
 #
-SUBDIRS(Library Executable)
+ADD_SUBDIRECTORY(Library)
+ADD_SUBDIRECTORY(Executable)
 SUBDIR_DEPENDS(Executable Library)
 EXPORT_LIBRARY_DEPENDENCIES(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake)
 INCLUDE(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL)

+ 1 - 1
Tests/ComplexOneConfig/Executable/CMakeLists.txt

@@ -65,7 +65,7 @@ ADD_CUSTOM_COMMAND(
 # has no side-effects on the current Makefile (duplicated source file
 # due to source list expansion done twice).
 #
-SUBDIRS(Temp)
+ADD_SUBDIRECTORY(Temp)
 
 #
 # Extra coverage.Not used.

+ 2 - 1
Tests/ComplexRelativePaths/CMakeLists.txt

@@ -273,7 +273,8 @@ ENDIF(NOT STRING_REGEX_PASSED)
 #
 # Create the libs and the main exe
 #
-SUBDIRS(Library Executable)
+ADD_SUBDIRECTORY(Library)
+ADD_SUBDIRECTORY(Executable)
 SUBDIR_DEPENDS(Executable Library)
 EXPORT_LIBRARY_DEPENDENCIES(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake)
 INCLUDE(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL)

+ 1 - 1
Tests/ComplexRelativePaths/Executable/CMakeLists.txt

@@ -65,7 +65,7 @@ ADD_CUSTOM_COMMAND(
 # has no side-effects on the current Makefile (duplicated source file
 # due to source list expansion done twice).
 #
-SUBDIRS(Temp)
+ADD_SUBDIRECTORY(Temp)
 
 #
 # Extra coverage.Not used.

+ 15 - 3
Tests/Dependency/CMakeLists.txt

@@ -28,6 +28,18 @@ PROJECT( Dependency )
 # Although SixB does not depend on Two, there is a dependency listed
 # in the corresponding CMakeLists.txt just because of commands used.
 
-SUBDIRS( NoDepA NoDepB NoDepC )
-SUBDIRS( 1 Two Three Four Five Six Seven Eight )
-SUBDIRS( Exec Exec2 Exec3 Exec4 )
+ADD_SUBDIRECTORY(NoDepA)
+ADD_SUBDIRECTORY(NoDepB)
+ADD_SUBDIRECTORY(NoDepC)
+ADD_SUBDIRECTORY(1)
+ADD_SUBDIRECTORY(Two)
+ADD_SUBDIRECTORY(Three)
+ADD_SUBDIRECTORY(Four)
+ADD_SUBDIRECTORY(Five)
+ADD_SUBDIRECTORY(Six)
+ADD_SUBDIRECTORY(Seven)
+ADD_SUBDIRECTORY(Eight)
+ADD_SUBDIRECTORY(Exec)
+ADD_SUBDIRECTORY(Exec2)
+ADD_SUBDIRECTORY(Exec3)
+ADD_SUBDIRECTORY(Exec4)

+ 2 - 1
Tests/Jump/CMakeLists.txt

@@ -1,4 +1,5 @@
 PROJECT(Jump)
 
 SET(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1)
-SUBDIRS(Executable Library)
+ADD_SUBDIRECTORY(Executable)
+ADD_SUBDIRECTORY(Library)

+ 2 - 1
Tests/Jump/Library/CMakeLists.txt

@@ -1 +1,2 @@
-SUBDIRS(Static Shared)
+ADD_SUBDIRECTORY(Static)
+ADD_SUBDIRECTORY(Shared)

+ 2 - 1
Tests/OutOfSource/SubDir/CMakeLists.txt

@@ -1,3 +1,4 @@
 PROJECT(ANOTHER_PROJ)
 # subdir to a sibling dir
-SUBDIRS(${OutOfSource_SOURCE_DIR}/${KEN}OutOfSourceSubdir)
+ADD_SUBDIRECTORY(OutOfSourceSubdir 
+  ${OutOfSource_SOURCE_DIR}/${KEN}OutOfSourceSubdir)

+ 1 - 1
Tests/PreOrder/CMakeLists.txt

@@ -1,6 +1,6 @@
 # a simple test case
 PROJECT (PreOrder)
 SET(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1)
-SUBDIRS(PREORDER Library)
+ADD_SUBDIRECTORY(Library)
 ADD_EXECUTABLE (simple simple.cxx)
 TARGET_LINK_LIBRARIES(simple simpleLib)

+ 1 - 1
Tests/SimpleInstall/CMakeLists.txt

@@ -43,7 +43,7 @@ IF(STAGE2)
   INSTALL_TARGETS(/bin SimpleInstallS2)
 ELSE(STAGE2)
   IF(CMAKE_GENERATOR MATCHES "Makefiles")
-    SUBDIRS(PREORDER TestSubDir)
+    ADD_SUBDIRECTORY(TestSubDir)
   ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
   
   # this is stage 1, so create libraries and modules and install everything

+ 1 - 1
Tests/SimpleInstallS2/CMakeLists.txt

@@ -43,7 +43,7 @@ IF(STAGE2)
   INSTALL_TARGETS(/bin SimpleInstallS2)
 ELSE(STAGE2)
   IF(CMAKE_GENERATOR MATCHES "Makefiles")
-    SUBDIRS(PREORDER TestSubDir)
+    ADD_SUBDIRECTORY(TestSubDir)
   ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
   
   # this is stage 1, so create libraries and modules and install everything

+ 2 - 3
Tests/Testing/CMakeLists.txt

@@ -48,7 +48,6 @@ ADD_EXECUTABLE(testing testing.cxx)
 ADD_TEST(testing ${Testing_BINARY_DIR}/bin/testing)
 
 #
-# Force subdirs
-# (coverage)
+# skip level test
 #
-SUBDIRS(Sub/Sub2)
+ADD_SUBDIRECTORY(Sub/Sub2)