COIN-OR::LEMON - Graph Library

source: lemon-project-template/CMakeLists.txt @ 4:6de89926e594

Last change on this file since 4:6de89926e594 was 4:6de89926e594, checked in by Peter Kovacs <kpeter@…>, 15 years ago

Add images to NSIS installer generator

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