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