From 67e5bc71982f079efffe70319964b5b88b861882 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Sat, 20 Nov 2010 12:15:17 -0600 Subject: [PATCH] binpac: Made uninstall target cooperate with other projects --- tools/binpac/CMakeLists.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/binpac/CMakeLists.txt b/tools/binpac/CMakeLists.txt index 2009a444e8..d969ddc49e 100644 --- a/tools/binpac/CMakeLists.txt +++ b/tools/binpac/CMakeLists.txt @@ -1,3 +1,5 @@ +project(BinPAC) + ######################################################################## ## CMake Configuration @@ -12,19 +14,19 @@ endif () set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -# uninstall target -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - @ONLY) +if ("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") + # uninstall target + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + @ONLY) -add_custom_target(uninstall COMMAND - ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) + add_custom_target(uninstall COMMAND + ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +endif () ######################################################################## ## Project/Build Configuration -project(BinPAC) - file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" BINPAC_VERSION LIMIT_COUNT 1) if (ENABLE_DEBUG)