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:
Brad King 2009-12-08 11:44:28 -05:00
parent d4e26b7e88
commit d4ada9d0d5
3 changed files with 9 additions and 6 deletions

View File

@ -20,6 +20,8 @@ MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
# Allow empty endif() and such with CMake 2.4.
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)
# Since the built CMake will install itself instead of the
# 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
# and not the ctest from the cmake building and testing
# cmake.
SET(CMAKE_CTEST_COMMAND "${EXECUTABLE_OUTPUT_PATH}/ctest")
SET(CMAKE_CMAKE_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cmake")
SET(CMAKE_CPACK_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cpack")
SET(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
SET(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
SET(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
ENDIF(BUILD_TESTING)
# configure some files for testing
@ -342,8 +344,7 @@ INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
# where to write the resulting executables and libraries
SET(BUILD_SHARED_LIBS OFF)
SET(EXECUTABLE_OUTPUT_PATH ${CMake_BINARY_DIR}/bin CACHE INTERNAL
"Where to put the executables for CMake")
SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
"Where to put the libraries for CMake")

View File

@ -18,6 +18,8 @@ ELSE(HAVE_ELF_H)
SET(CMAKE_USE_ELF_PARSER)
ENDIF(HAVE_ELF_H)
SET(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
# configure the .h file
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Source/cmConfigure.cmake.h.in"

View File

@ -1,4 +1,4 @@
SET(CMAKE_EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/cmake")
SET(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake")
MACRO(AddCMakeTest TestName PreArgs)