lemon-project-template-glpk

view CMakeLists.txt @ 1:4721c71fdbfc

Support building LEMON as a subproject
author Akos Ladanyi <ladanyi@tmit.bme.hu>
date Tue, 02 Jun 2009 14:55:23 +0100
parents 368136e07d23
children 76d160eba8d4
line source
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 SET(PROJECT_NAME "LEMON-PROJECT-TEMPLATE")
4 SET(PROJECT_VERSION "hg-tip"
5 CACHE STRING "LEMON PROJECT TEMPLATE version string.")
7 PROJECT(${PROJECT_NAME})
9 SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
11 IF(EXISTS ${CMAKE_SOURCE_DIR}/lemon)
12 ADD_SUBDIRECTORY(lemon)
13 SET(LEMON_INCLUDE_DIRS
14 ${CMAKE_SOURCE_DIR}/lemon
15 ${CMAKE_BINARY_DIR}/lemon
16 )
17 SET(LEMON_LIBRARIES lemon)
18 ELSE()
19 FIND_PACKAGE(LEMON QUIET NO_MODULE)
20 FIND_PACKAGE(LEMON REQUIRED)
21 ENDIF()
23 FIND_PACKAGE(Doxygen)
25 INCLUDE_DIRECTORIES(
26 ${PROJECT_SOURCE_DIR}
27 ${PROJECT_BINARY_DIR}
28 ${LEMON_INCLUDE_DIRS}
29 )
31 ADD_EXECUTABLE(lemon-project main.cc)
32 TARGET_LINK_LIBRARIES(lemon-project ${LEMON_LIBRARIES})
33 INSTALL(
34 TARGETS lemon-project
35 RUNTIME DESTINATION bin
36 COMPONENT bin
37 )
39 # IF(MSVC)
40 # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
41 # # Suppressed warnings:
42 # # C4250: 'class1' : inherits 'class2::member' via dominance
43 # # C4355: 'this' : used in base member initializer list
44 # # C4503: 'function' : decorated name length exceeded, name was truncated
45 # # C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
46 # # C4996: 'function': was declared deprecated
47 # ENDIF(MSVC)
49 ENABLE_TESTING()
51 ADD_SUBDIRECTORY(doc)
53 ######################################################################
54 # CPACK configuration
55 ######################################################################
57 IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
58 SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
59 SET(CPACK_PACKAGE_VENDOR "EGRES")
60 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
61 "LEMON PROJECT TEMPLATE - A Template Build Environment for LEMON")
62 SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
64 SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
66 SET(CPACK_PACKAGE_INSTALL_DIRECTORY
67 "${PROJECT_NAME}")
68 SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
69 "${PROJECT_NAME}")
71 SET(CPACK_COMPONENTS_ALL
72 html_documentation
73 bin)
75 SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
76 SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
78 SET(CPACK_COMPONENT_BIN_DESCRIPTION
79 "Command line utilities")
80 SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
81 "Doxygen generated documentation")
83 SET(CPACK_GENERATOR "NSIS")
84 SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
85 SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
86 SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu")
87 SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu")
88 SET(CPACK_NSIS_CREATE_ICONS_EXTRA "
89 CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\"
90 ")
91 SET(CPACK_NSIS_DELETE_ICONS_EXTRA "
92 !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
93 Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\"
94 ")
96 INCLUDE(CPack)
97 ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})