From 071ce33ec98fd6eac3345d23de76822643611083 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 24 Jul 2009 13:17:41 -0400 Subject: [PATCH] ENH: Install all Modules and Templates This removes the file-wise installation rules for Modules and Templates and instead installs the whole directories. This approach is much less error-prone. The old approach was left from before CMake had the install(DIRECTORY) command. --- CMakeLists.txt | 17 +++++++++++++++-- Modules/CMakeLists.txt | 12 ------------ Modules/Platform/CMakeLists.txt | 3 --- Templates/CMakeLists.txt | 6 ------ 4 files changed, 15 insertions(+), 23 deletions(-) delete mode 100644 Modules/CMakeLists.txt delete mode 100644 Modules/Platform/CMakeLists.txt delete mode 100644 Templates/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index b1ca6fb88..d32c442c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -374,6 +374,7 @@ SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION}" CACHE STRING SET(CMAKE_MAN_DIR "/man" CACHE STRING "Install location for man pages (relative to prefix).") MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR) +STRING(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}") # include special compile flags for some compilers INCLUDE(CompileFlags.cmake) @@ -465,8 +466,6 @@ MARK_AS_ADVANCED(CMAKE_STRICT) # build the remaining subdirectories SUBDIRS(Source) -SUBDIRS(Modules) -SUBDIRS(Templates) SUBDIRS(Utilities) SUBDIRS(Tests) @@ -474,6 +473,20 @@ SUBDIRS(Tests) ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}" --system-information -G "${CMAKE_TEST_GENERATOR}" ) +# Install script directories. +INSTALL( + DIRECTORY Modules Templates + DESTINATION "${CMake_DATA_DEST}" + FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ + DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE + PATTERN "*.sh.in" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE + PATTERN "CVS" EXCLUDE + ) + #----------------------------------------------------------------------- # End of the main section of the CMakeLists file #----------------------------------------------------------------------- diff --git a/Modules/CMakeLists.txt b/Modules/CMakeLists.txt deleted file mode 100644 index da168cd9f..000000000 --- a/Modules/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# just install the modules -## new file added, force rerunning cmake - -SUBDIRS(Platform) -INSTALL_FILES(${CMAKE_DATA_DIR}/Modules .*\\.cmake$) -INSTALL_FILES(${CMAKE_DATA_DIR}/Modules .*\\.cpp$) -INSTALL_FILES(${CMAKE_DATA_DIR}/Modules .*\\.cxx$) -INSTALL_FILES(${CMAKE_DATA_DIR}/Modules .*\\.in$) -INSTALL_FILES(${CMAKE_DATA_DIR}/Modules .*\\.c$) -INSTALL_FILES(${CMAKE_DATA_DIR}/Modules .*\\.h$) -INSTALL_FILES(${CMAKE_DATA_DIR}/Modules .*\\.F$) -INSTALL_FILES(${CMAKE_DATA_DIR}/Modules readme\\.txt$) diff --git a/Modules/Platform/CMakeLists.txt b/Modules/Platform/CMakeLists.txt deleted file mode 100644 index 6d8f4a132..000000000 --- a/Modules/Platform/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -# just install the modules -INSTALL_FILES(${CMAKE_DATA_DIR}/Modules/Platform .*\\.cmake$) -INSTALL_FILES(${CMAKE_DATA_DIR}/Modules/Platform .*\\.in$) diff --git a/Templates/CMakeLists.txt b/Templates/CMakeLists.txt deleted file mode 100644 index d1a65ac6b..000000000 --- a/Templates/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# just install the modules -INSTALL_FILES(${CMAKE_DATA_DIR}/Templates .*\\.in) -INSTALL_FILES(${CMAKE_DATA_DIR}/Templates .*\\.txt) -INSTALL_FILES(${CMAKE_DATA_DIR}/Templates .*\\.cmake$) -INSTALL_FILES(${CMAKE_DATA_DIR}/Templates .*\\.dsptemplate$) -INSTALL_FILES(${CMAKE_DATA_DIR}/Templates .*\\.vsmacros$)