Browse Source

CTK_INSTALL_{BIN, LIB, INCLUDE, DOC}_DIR can be set externally

This is useful when CTK is build as an external project and when the
location where the executables, libraries ... should be installed
is different from the default one.
Jean-Christophe Fillion-Robin 14 years ago
parent
commit
33844acfb2
2 changed files with 16 additions and 4 deletions
  1. 12 4
      CMakeLists.txt
  2. 4 0
      SuperBuild.cmake

+ 12 - 4
CMakeLists.txt

@@ -108,10 +108,18 @@ ENDIF()
 #-----------------------------------------------------------------------------
 # Install directories, used for install rules.
 #
-SET(CTK_INSTALL_BIN_DIR "bin")
-SET(CTK_INSTALL_LIB_DIR "lib/ctk-${CTK_MAJOR_VERSION}.${CTK_MINOR_VERSION}")
-SET(CTK_INSTALL_INCLUDE_DIR "include/ctk-${CTK_MAJOR_VERSION}.${CTK_MINOR_VERSION}")
-SET(CTK_INSTALL_DOC_DIR "doc")
+IF(NOT CTK_INSTALL_BIN_DIR)
+  SET(CTK_INSTALL_BIN_DIR "bin")
+ENDIF()
+IF(NOT CTK_INSTALL_LIB_DIR)
+  SET(CTK_INSTALL_LIB_DIR "lib/ctk-${CTK_MAJOR_VERSION}.${CTK_MINOR_VERSION}")
+ENDIF()
+IF(NOT CTK_INSTALL_INCLUDE_DIR)
+  SET(CTK_INSTALL_INCLUDE_DIR "include/ctk-${CTK_MAJOR_VERSION}.${CTK_MINOR_VERSION}")
+ENDIF()
+IF(NOT CTK_INSTALL_DOC_DIR)
+  SET(CTK_INSTALL_DOC_DIR "doc")
+ENDIF()
 
 #-----------------------------------------------------------------------------
 # Update CMake module path

+ 4 - 0
SuperBuild.cmake

@@ -235,6 +235,10 @@ ExternalProject_Add(${proj}
     -DCTK_CMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CTK_CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
     -DCTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY}
     -DCTK_CMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CTK_CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+    -DCTK_INSTALL_BIN_DIR:STRING=${CTK_INSTALL_BIN_DIR}
+    -DCTK_INSTALL_LIB_DIR:STRING=${CTK_INSTALL_LIB_DIR}
+    -DCTK_INSTALL_INCLUDE_DIR:STRING=${CTK_INSTALL_INCLUDE_DIR}
+    -DCTK_INSTALL_DOC_DIR:STRING=${CTK_INSTALL_DOC_DIR}
     -DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     -DCTK_CXX_FLAGS:STRING=${CTK_CXX_FLAGS}