Commit 2e4258ef authored by Ken Martin's avatar Ken Martin
Browse files

ENH: shift to using ADD_SUBDIRECTORY

parent 2f42e934
......@@ -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)
......@@ -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.
......
......@@ -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)
......@@ -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.
......
......@@ -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)
......@@ -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.
......
......@@ -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)
PROJECT(Jump)
SET(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1)
SUBDIRS(Executable Library)
ADD_SUBDIRECTORY(Executable)
ADD_SUBDIRECTORY(Library)
SUBDIRS(Static Shared)
ADD_SUBDIRECTORY(Static)
ADD_SUBDIRECTORY(Shared)
PROJECT(ANOTHER_PROJ)
# subdir to a sibling dir
SUBDIRS(${OutOfSource_SOURCE_DIR}/${KEN}OutOfSourceSubdir)
ADD_SUBDIRECTORY(OutOfSourceSubdir
${OutOfSource_SOURCE_DIR}/${KEN}OutOfSourceSubdir)
# 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)
......@@ -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
......
......@@ -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
......
......@@ -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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment