From d4ada9d0d540ab2dc2a9747315c5afda5887950f Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 8 Dec 2009 11:44:28 -0500 Subject: 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. --- CMakeLists.txt | 11 ++++++----- Source/CMakeLists.txt | 2 ++ Tests/CMakeTests/CMakeLists.txt | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40ec9ad..5d03dce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 7568de0..2bfb777 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -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" diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt index 6b44417..161ca44 100644 --- a/Tests/CMakeTests/CMakeLists.txt +++ b/Tests/CMakeTests/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(CMAKE_EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/cmake") +SET(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake") MACRO(AddCMakeTest TestName PreArgs) -- cgit v0.12