lemon-project-template-glpk
annotate CMakeLists.txt @ 8:dda9b6665fde
Improved install locations
author | Alpar Juttner <alpar@cs.elte.hu> |
---|---|
date | Tue, 22 Mar 2011 20:26:58 +0100 |
parents | c941f748eaa8 |
children | 5545663ca997 |
rev | line source |
---|---|
alpar@0 | 1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6) |
alpar@0 | 2 |
alpar@2 | 3 ## Here comes the name of your project: |
alpar@2 | 4 |
alpar@0 | 5 SET(PROJECT_NAME "LEMON-PROJECT-TEMPLATE") |
alpar@2 | 6 |
alpar@2 | 7 ## Change 'hg-tip' to the current version number of your project if you wish. |
kpeter@3 | 8 ## Optionally, you can leave it as is and set PROJECT_VERSION from |
kpeter@3 | 9 ## the cmake-gui when you make a release. |
alpar@2 | 10 ## The last parameter is a help string displayed by CMAKE. |
alpar@2 | 11 |
alpar@0 | 12 SET(PROJECT_VERSION "hg-tip" |
kpeter@3 | 13 CACHE STRING "${PROJECT_NAME} version string") |
alpar@0 | 14 |
alpar@2 | 15 ## Do not edit this. |
alpar@0 | 16 PROJECT(${PROJECT_NAME}) |
alpar@0 | 17 |
alpar@0 | 18 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) |
alpar@0 | 19 |
alpar@8 | 20 IF(UNIX) |
alpar@8 | 21 SET(INSTALL_BIN_DIR "bin" CACHE STRING |
alpar@8 | 22 "Subdir for installing the binaries") |
alpar@8 | 23 SET(INSTALL_DOC_DIR "share/doc/${PROJECT_NAME}" |
alpar@8 | 24 CACHE STRING |
alpar@8 | 25 "Subdir for installing the doc") |
alpar@8 | 26 SET(INSTALL_DATA_DIR "share/data/${PROJECT_NAME}" |
alpar@8 | 27 CACHE STRING |
alpar@8 | 28 "Subdir for installing the map data") |
alpar@8 | 29 SET(INSTALL_EXAMPLES_DIR "share/doc/${PROJECT_NAME}/examples" |
alpar@8 | 30 CACHE STRING |
alpar@8 | 31 "Subdir for installing the examples") |
alpar@8 | 32 ELSE(UNIX) |
alpar@8 | 33 SET(INSTALL_BIN_DIR "." CACHE STRING |
alpar@8 | 34 "Subdir for installing the binaries") |
alpar@8 | 35 SET(INSTALL_DOC_DIR "doc" CACHE STRING |
alpar@8 | 36 "Subdir for installing the doc") |
alpar@8 | 37 SET(INSTALL_DATA_DIR "data" CACHE STRING |
alpar@8 | 38 "Subdir for installing the map data") |
alpar@8 | 39 SET(INSTALL_EXAMPLES_DIR "examples" CACHE STRING |
alpar@8 | 40 "Subdir for installing the examples") |
alpar@8 | 41 ENDIF(UNIX) |
alpar@8 | 42 |
alpar@2 | 43 ## The next part looks for LEMON. Typically, you don't want to modify it. |
alpar@2 | 44 ## |
alpar@5 | 45 ## First, it tries to use LEMON as a CMAKE subproject by looking for |
alpar@5 | 46 ## it in the 'lemon' or 'deps/lemon' subdirectories or in directory |
alpar@5 | 47 ## given by the LEMON_SOURCE_ROOT_DIR variable. |
alpar@5 | 48 ## If LEMON isn't there, then CMAKE will try to find an installed |
alpar@5 | 49 ## version of LEMON. If it is installed at some non-standard place, |
alpar@5 | 50 ## then you must tell its location in the LEMON_ROOT_DIR CMAKE config |
alpar@5 | 51 ## variable. (Do not hard code it into your config! Others may keep |
alpar@2 | 52 ## LEMON at different places.) |
alpar@2 | 53 |
alpar@5 | 54 FIND_PATH(LEMON_SOURCE_ROOT_DIR CMakeLists.txt |
alpar@5 | 55 PATHS ${CMAKE_SOURCE_DIR}/lemon ${CMAKE_SOURCE_DIR}/deps/lemon |
alpar@5 | 56 NO_DEFAULT_PATH |
alpar@5 | 57 DOC "Location of LEMON source as a CMAKE subproject") |
alpar@5 | 58 |
alpar@5 | 59 IF(EXISTS ${LEMON_SOURCE_ROOT_DIR}) |
alpar@5 | 60 ADD_SUBDIRECTORY(${LEMON_SOURCE_ROOT_DIR} deps/lemon) |
ladanyi@1 | 61 SET(LEMON_INCLUDE_DIRS |
alpar@5 | 62 ${LEMON_SOURCE_ROOT_DIR} |
alpar@5 | 63 ${CMAKE_BINARY_DIR}/deps/lemon |
ladanyi@1 | 64 ) |
ladanyi@1 | 65 SET(LEMON_LIBRARIES lemon) |
alpar@5 | 66 UNSET(LEMON_ROOT_DIR CACHE) |
alpar@5 | 67 UNSET(LEMON_DIR CACHE) |
alpar@5 | 68 UNSET(LEMON_INCLUDE_DIR CACHE) |
alpar@5 | 69 UNSET(LEMON_LIBRARY CACHE) |
ladanyi@1 | 70 ELSE() |
ladanyi@1 | 71 FIND_PACKAGE(LEMON QUIET NO_MODULE) |
ladanyi@1 | 72 FIND_PACKAGE(LEMON REQUIRED) |
ladanyi@1 | 73 ENDIF() |
ladanyi@1 | 74 |
alpar@2 | 75 ## This line finds doxygen (for document creation) |
alpar@2 | 76 |
alpar@0 | 77 FIND_PACKAGE(Doxygen) |
alpar@0 | 78 |
alpar@2 | 79 ## These are the include directories used by the compiler. |
alpar@2 | 80 |
alpar@0 | 81 INCLUDE_DIRECTORIES( |
alpar@0 | 82 ${PROJECT_SOURCE_DIR} |
alpar@0 | 83 ${PROJECT_BINARY_DIR} |
alpar@0 | 84 ${LEMON_INCLUDE_DIRS} |
alpar@0 | 85 ) |
alpar@0 | 86 |
alpar@8 | 87 IF(CMAKE_COMPILER_IS_GNUCXX) |
alpar@8 | 88 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") |
alpar@8 | 89 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") |
alpar@8 | 90 ENDIF(CMAKE_COMPILER_IS_GNUCXX) |
alpar@7 | 91 ADD_SUBDIRECTORY(src) |
alpar@0 | 92 |
alpar@2 | 93 ## Sometimes MSVC overwhelms you with compiler warnings which are impossible to |
alpar@2 | 94 ## avoid. Then comment out these sections. Normally you won't need it as the |
alpar@2 | 95 ## LEMON include headers suppress these warnings anyway. |
alpar@2 | 96 |
alpar@2 | 97 #IF(MSVC) |
alpar@2 | 98 # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} |
alpar@2 | 99 # /wd4250 /wd4355 /wd4503 /wd4800 /wd4996") |
alpar@0 | 100 # # Suppressed warnings: |
alpar@0 | 101 # # C4250: 'class1' : inherits 'class2::member' via dominance |
alpar@0 | 102 # # C4355: 'this' : used in base member initializer list |
alpar@0 | 103 # # C4503: 'function' : decorated name length exceeded, name was truncated |
alpar@2 | 104 # # C4800: 'type' : forcing value to bool 'true' or 'false' |
alpar@2 | 105 # # (performance warning) |
alpar@0 | 106 # # C4996: 'function': was declared deprecated |
alpar@0 | 107 # ENDIF(MSVC) |
alpar@0 | 108 |
alpar@0 | 109 ENABLE_TESTING() |
alpar@0 | 110 |
kpeter@3 | 111 ## The auxiliary doxygen files (.dox) should be placed in the 'doc' |
alpar@2 | 112 ## subdirectory. The next line includes the CMAKE config of that directory. |
alpar@2 | 113 |
alpar@0 | 114 ADD_SUBDIRECTORY(doc) |
alpar@0 | 115 |
alpar@2 | 116 ####################################################################### |
alpar@2 | 117 ## CPACK configuration |
alpar@2 | 118 ## |
alpar@2 | 119 ## It is used to configure the .exe installer created by CPACK. |
alpar@2 | 120 ## Consider editing these values: |
kpeter@4 | 121 ## |
alpar@2 | 122 ## - CPACK_PACKAGE_VENDOR |
alpar@2 | 123 ## - CPACK_PACKAGE_DESCRIPTION_SUMMARY |
alpar@2 | 124 ## - CPACK_NSIS_HELP_LINK |
alpar@2 | 125 ## - CPACK_NSIS_URL_INFO_ABOUT |
alpar@2 | 126 ## - CPACK_NSIS_CONTACT |
kpeter@4 | 127 ## |
kpeter@4 | 128 ## Additionally, you may want to change the icons/images used by the |
kpeter@4 | 129 ## NSIS installer, i.e. these variables: |
kpeter@4 | 130 ## |
kpeter@4 | 131 ## - CPACK_NSIS_MUI_ICON |
kpeter@4 | 132 ## - CPACK_PACKAGE_ICON |
kpeter@4 | 133 ## - CPACK_NSIS_INSTALLED_ICON_NAME |
alpar@8 | 134 ## |
kpeter@4 | 135 ## and/or the files they point to. |
alpar@2 | 136 ####################################################################### |
alpar@0 | 137 |
alpar@0 | 138 IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) |
alpar@0 | 139 SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) |
alpar@0 | 140 SET(CPACK_PACKAGE_VENDOR "EGRES") |
alpar@0 | 141 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY |
alpar@0 | 142 "LEMON PROJECT TEMPLATE - A Template Build Environment for LEMON") |
alpar@0 | 143 SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") |
alpar@0 | 144 |
alpar@0 | 145 SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
alpar@0 | 146 |
alpar@0 | 147 SET(CPACK_PACKAGE_INSTALL_DIRECTORY |
alpar@0 | 148 "${PROJECT_NAME}") |
alpar@0 | 149 SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY |
alpar@8 | 150 "${PROJECT_NAME} ${PROJECT_VERSION}") |
alpar@0 | 151 |
alpar@8 | 152 SET(CPACK_COMPONENTS_ALL bin doc) |
alpar@0 | 153 |
alpar@8 | 154 SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Executables") |
alpar@0 | 155 SET(CPACK_COMPONENT_BIN_DESCRIPTION |
alpar@0 | 156 "Command line utilities") |
alpar@8 | 157 SET(CPACK_COMPONENT_BIN_REQUIRED TRUE) |
alpar@0 | 158 |
alpar@8 | 159 SET(CPACK_COMPONENT_DOC_DISPLAY_NAME "Documentation") |
alpar@8 | 160 SET(CPACK_COMPONENT_DOC_DESCRIPTION |
alpar@8 | 161 "Documentation generated by Doxygen.") |
alpar@8 | 162 |
alpar@8 | 163 |
alpar@0 | 164 SET(CPACK_GENERATOR "NSIS") |
kpeter@4 | 165 |
kpeter@4 | 166 SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon-project.ico") |
kpeter@4 | 167 SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico") |
kpeter@4 | 168 SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp") |
kpeter@4 | 169 SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon-project.ico") |
kpeter@4 | 170 |
alpar@0 | 171 SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}") |
alpar@0 | 172 SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu") |
alpar@0 | 173 SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu") |
alpar@0 | 174 SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu") |
alpar@0 | 175 SET(CPACK_NSIS_CREATE_ICONS_EXTRA " |
alpar@0 | 176 CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\" |
alpar@0 | 177 ") |
alpar@0 | 178 SET(CPACK_NSIS_DELETE_ICONS_EXTRA " |
alpar@0 | 179 !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP |
alpar@0 | 180 Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\" |
alpar@0 | 181 ") |
alpar@0 | 182 |
alpar@0 | 183 INCLUDE(CPack) |
alpar@0 | 184 ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) |