Clean up CMake build tree 'bin' directory
We re-arrange EXECUTABLE_OUTPUT_PATH settings to avoid putting utility and test executables in the 'bin' directory of the build tree. This makes the directory look like that in the installation tree, except that on multi-configuration generators we still use a per-config subdirectory.
This commit is contained in:
parent
d4e26b7e88
commit
d4ada9d0d5
|
@ -20,6 +20,8 @@ MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
|
||||||
# Allow empty endif() and such with CMake 2.4.
|
# Allow empty endif() and such with CMake 2.4.
|
||||||
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1)
|
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1)
|
||||||
|
|
||||||
|
SET(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
|
||||||
|
|
||||||
IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
|
IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
|
||||||
# Since the built CMake will install itself instead of the
|
# Since the built CMake will install itself instead of the
|
||||||
# generating CMake, tell it that the install rules were generated
|
# generating CMake, tell it that the install rules were generated
|
||||||
|
@ -134,9 +136,9 @@ MACRO(CMAKE_SETUP_TESTING)
|
||||||
# the ctest from this cmake is used for testing
|
# the ctest from this cmake is used for testing
|
||||||
# and not the ctest from the cmake building and testing
|
# and not the ctest from the cmake building and testing
|
||||||
# cmake.
|
# cmake.
|
||||||
SET(CMAKE_CTEST_COMMAND "${EXECUTABLE_OUTPUT_PATH}/ctest")
|
SET(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
|
||||||
SET(CMAKE_CMAKE_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cmake")
|
SET(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
|
||||||
SET(CMAKE_CPACK_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cpack")
|
SET(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
|
||||||
ENDIF(BUILD_TESTING)
|
ENDIF(BUILD_TESTING)
|
||||||
|
|
||||||
# configure some files for testing
|
# configure some files for testing
|
||||||
|
@ -342,8 +344,7 @@ INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
|
||||||
|
|
||||||
# where to write the resulting executables and libraries
|
# where to write the resulting executables and libraries
|
||||||
SET(BUILD_SHARED_LIBS OFF)
|
SET(BUILD_SHARED_LIBS OFF)
|
||||||
SET(EXECUTABLE_OUTPUT_PATH ${CMake_BINARY_DIR}/bin CACHE INTERNAL
|
SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
|
||||||
"Where to put the executables for CMake")
|
|
||||||
SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
|
SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
|
||||||
"Where to put the libraries for CMake")
|
"Where to put the libraries for CMake")
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@ ELSE(HAVE_ELF_H)
|
||||||
SET(CMAKE_USE_ELF_PARSER)
|
SET(CMAKE_USE_ELF_PARSER)
|
||||||
ENDIF(HAVE_ELF_H)
|
ENDIF(HAVE_ELF_H)
|
||||||
|
|
||||||
|
SET(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
|
||||||
|
|
||||||
# configure the .h file
|
# configure the .h file
|
||||||
CONFIGURE_FILE(
|
CONFIGURE_FILE(
|
||||||
"${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in"
|
"${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
SET(CMAKE_EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/cmake")
|
SET(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake")
|
||||||
|
|
||||||
|
|
||||||
MACRO(AddCMakeTest TestName PreArgs)
|
MACRO(AddCMakeTest TestName PreArgs)
|
||||||
|
|
Loading…
Reference in New Issue