Improved install locations default tip
authorAlpar Juttner <alpar@cs.elte.hu>
Tue, 22 Mar 2011 20:26:58 +0100
changeset 8dda9b6665fde
parent 7 c941f748eaa8
Improved install locations
CMakeLists.txt
doc/CMakeLists.txt
src/CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Tue Mar 22 20:09:43 2011 +0100
     1.2 +++ b/CMakeLists.txt	Tue Mar 22 20:26:58 2011 +0100
     1.3 @@ -17,6 +17,29 @@
     1.4  
     1.5  SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
     1.6  
     1.7 +IF(UNIX)
     1.8 +  SET(INSTALL_BIN_DIR "bin" CACHE STRING
     1.9 +    "Subdir for installing the binaries")
    1.10 +  SET(INSTALL_DOC_DIR "share/doc/${PROJECT_NAME}"
    1.11 +    CACHE STRING
    1.12 +    "Subdir for installing the doc")
    1.13 +  SET(INSTALL_DATA_DIR "share/data/${PROJECT_NAME}"
    1.14 +    CACHE STRING
    1.15 +    "Subdir for installing the map data")
    1.16 +  SET(INSTALL_EXAMPLES_DIR "share/doc/${PROJECT_NAME}/examples"
    1.17 +    CACHE STRING
    1.18 +    "Subdir for installing the examples")
    1.19 +ELSE(UNIX)
    1.20 +  SET(INSTALL_BIN_DIR "." CACHE STRING
    1.21 +                  "Subdir for installing the binaries")
    1.22 +  SET(INSTALL_DOC_DIR "doc" CACHE STRING
    1.23 +                  "Subdir for installing the doc")
    1.24 +  SET(INSTALL_DATA_DIR "data" CACHE STRING
    1.25 +                  "Subdir for installing the map data")
    1.26 +  SET(INSTALL_EXAMPLES_DIR "examples" CACHE STRING
    1.27 +                       "Subdir for installing the examples")
    1.28 +ENDIF(UNIX)
    1.29 +
    1.30  ## The next part looks for LEMON. Typically, you don't want to modify it.
    1.31  ##
    1.32  ## First, it tries to use LEMON as a CMAKE subproject by looking for
    1.33 @@ -61,6 +84,10 @@
    1.34    ${LEMON_INCLUDE_DIRS}
    1.35  )
    1.36  
    1.37 +IF(CMAKE_COMPILER_IS_GNUCXX)
    1.38 +  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
    1.39 +  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
    1.40 +ENDIF(CMAKE_COMPILER_IS_GNUCXX)
    1.41  ADD_SUBDIRECTORY(src)
    1.42  
    1.43  ## Sometimes MSVC overwhelms you with compiler warnings which are impossible to
    1.44 @@ -104,7 +131,7 @@
    1.45  ## - CPACK_NSIS_MUI_ICON
    1.46  ## - CPACK_PACKAGE_ICON
    1.47  ## - CPACK_NSIS_INSTALLED_ICON_NAME
    1.48 -##
    1.49 +## 
    1.50  ## and/or the files they point to.
    1.51  #######################################################################
    1.52  
    1.53 @@ -120,20 +147,20 @@
    1.54    SET(CPACK_PACKAGE_INSTALL_DIRECTORY
    1.55        "${PROJECT_NAME}")
    1.56    SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
    1.57 -      "${PROJECT_NAME}")
    1.58 +      "${PROJECT_NAME} ${PROJECT_VERSION}")
    1.59  
    1.60 -  SET(CPACK_COMPONENTS_ALL
    1.61 -      html_documentation
    1.62 -      bin)
    1.63 +  SET(CPACK_COMPONENTS_ALL bin doc)
    1.64  
    1.65 -  SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
    1.66 -  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
    1.67 -
    1.68 +  SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Executables")
    1.69    SET(CPACK_COMPONENT_BIN_DESCRIPTION
    1.70        "Command line utilities")
    1.71 -  SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
    1.72 -      "Doxygen generated documentation")
    1.73 +  SET(CPACK_COMPONENT_BIN_REQUIRED TRUE)
    1.74  
    1.75 +  SET(CPACK_COMPONENT_DOC_DISPLAY_NAME "Documentation")
    1.76 +  SET(CPACK_COMPONENT_DOC_DESCRIPTION
    1.77 +      "Documentation generated by Doxygen.")
    1.78 +
    1.79 +    
    1.80    SET(CPACK_GENERATOR "NSIS")
    1.81  
    1.82    SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon-project.ico")
     2.1 --- a/doc/CMakeLists.txt	Tue Mar 22 20:09:43 2011 +0100
     2.2 +++ b/doc/CMakeLists.txt	Tue Mar 22 20:26:58 2011 +0100
     2.3 @@ -23,6 +23,6 @@
     2.4    ENDIF(UNIX)
     2.5    INSTALL(
     2.6      DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
     2.7 -    DESTINATION share/doc
     2.8 +    DESTINATION ${INSTALL_DOC_DIR}
     2.9      COMPONENT html_documentation)
    2.10  ENDIF(DOXYGEN_EXECUTABLE)
     3.1 --- a/src/CMakeLists.txt	Tue Mar 22 20:09:43 2011 +0100
     3.2 +++ b/src/CMakeLists.txt	Tue Mar 22 20:26:58 2011 +0100
     3.3 @@ -24,6 +24,6 @@
     3.4  
     3.5  INSTALL(
     3.6    TARGETS lemon-project
     3.7 -  RUNTIME DESTINATION bin
     3.8 +  RUNTIME DESTINATION ${INSTALL_BIN_DIR}
     3.9    COMPONENT bin
    3.10  )