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