lemon-project-template-glpk

annotate CMakeLists.txt @ 6:b995b17cd52b

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