lemon-project-template-glpk

annotate CMakeLists.txt @ 11:4fc6ad2fb8a6

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