[Lemon-commits] Alpar Juttner: Improved install locations

Lemon HG hg at lemon.cs.elte.hu
Sun Nov 6 21:57:07 CET 2011


details:   http://lemon.cs.elte.hu/hg/lemon-project-template/rev/dda9b6665fde
changeset: 8:dda9b6665fde
user:      Alpar Juttner <alpar [at] cs.elte.hu>
date:      Tue Mar 22 20:26:58 2011 +0100
description:
	Improved install locations

diffstat:

 CMakeLists.txt     |  47 +++++++++++++++++++++++++++++++++++++----------
 doc/CMakeLists.txt |   2 +-
 src/CMakeLists.txt |   2 +-
 3 files changed, 39 insertions(+), 12 deletions(-)

diffs (105 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,29 @@
 
 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
 
+IF(UNIX)
+  SET(INSTALL_BIN_DIR "bin" CACHE STRING
+    "Subdir for installing the binaries")
+  SET(INSTALL_DOC_DIR "share/doc/${PROJECT_NAME}"
+    CACHE STRING
+    "Subdir for installing the doc")
+  SET(INSTALL_DATA_DIR "share/data/${PROJECT_NAME}"
+    CACHE STRING
+    "Subdir for installing the map data")
+  SET(INSTALL_EXAMPLES_DIR "share/doc/${PROJECT_NAME}/examples"
+    CACHE STRING
+    "Subdir for installing the examples")
+ELSE(UNIX)
+  SET(INSTALL_BIN_DIR "." CACHE STRING
+                  "Subdir for installing the binaries")
+  SET(INSTALL_DOC_DIR "doc" CACHE STRING
+                  "Subdir for installing the doc")
+  SET(INSTALL_DATA_DIR "data" CACHE STRING
+                  "Subdir for installing the map data")
+  SET(INSTALL_EXAMPLES_DIR "examples" CACHE STRING
+                       "Subdir for installing the examples")
+ENDIF(UNIX)
+
 ## The next part looks for LEMON. Typically, you don't want to modify it.
 ##
 ## First, it tries to use LEMON as a CMAKE subproject by looking for
@@ -61,6 +84,10 @@
   ${LEMON_INCLUDE_DIRS}
 )
 
+IF(CMAKE_COMPILER_IS_GNUCXX)
+  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+ENDIF(CMAKE_COMPILER_IS_GNUCXX)
 ADD_SUBDIRECTORY(src)
 
 ## Sometimes MSVC overwhelms you with compiler warnings which are impossible to
@@ -104,7 +131,7 @@
 ## - CPACK_NSIS_MUI_ICON
 ## - CPACK_PACKAGE_ICON
 ## - CPACK_NSIS_INSTALLED_ICON_NAME
-##
+## 
 ## and/or the files they point to.
 #######################################################################
 
@@ -120,20 +147,20 @@
   SET(CPACK_PACKAGE_INSTALL_DIRECTORY
       "${PROJECT_NAME}")
   SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
-      "${PROJECT_NAME}")
+      "${PROJECT_NAME} ${PROJECT_VERSION}")
 
-  SET(CPACK_COMPONENTS_ALL
-      html_documentation
-      bin)
+  SET(CPACK_COMPONENTS_ALL bin doc)
 
-  SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
-  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
-
+  SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Executables")
   SET(CPACK_COMPONENT_BIN_DESCRIPTION
       "Command line utilities")
-  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
-      "Doxygen generated documentation")
+  SET(CPACK_COMPONENT_BIN_REQUIRED TRUE)
 
+  SET(CPACK_COMPONENT_DOC_DISPLAY_NAME "Documentation")
+  SET(CPACK_COMPONENT_DOC_DESCRIPTION
+      "Documentation generated by Doxygen.")
+
+    
   SET(CPACK_GENERATOR "NSIS")
 
   SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon-project.ico")
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -23,6 +23,6 @@
   ENDIF(UNIX)
   INSTALL(
     DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
-    DESTINATION share/doc
+    DESTINATION ${INSTALL_DOC_DIR}
     COMPONENT html_documentation)
 ENDIF(DOXYGEN_EXECUTABLE)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -24,6 +24,6 @@
 
 INSTALL(
   TARGETS lemon-project
-  RUNTIME DESTINATION bin
+  RUNTIME DESTINATION ${INSTALL_BIN_DIR}
   COMPONENT bin
 )



More information about the Lemon-commits mailing list