# HG changeset patch
# User Alpar Juttner <alpar@cs.elte.hu>
# Date 1635414507 -7200
# Thu Oct 28 11:48:27 2021 +0200
# Node ID 76253ddee3ce2303fa8bac87c0158f46fc035632
# Parent a278d16bd2d082aa3c52ff4a9b0e2224ddc0549a
Switch to use lower case CMAKE function names
diff --git a/CMakeLists.txt b/CMakeLists.txt
a
|
b
|
|
1 | | CMAKE_MINIMUM_REQUIRED(VERSION 2.8) |
| 1 | cmake_minimum_required(VERSION 2.8) |
2 | 2 | |
3 | | IF(POLICY CMP0048) |
4 | | CMAKE_POLICY(SET CMP0048 OLD) |
5 | | ENDIF(POLICY CMP0048) |
| 3 | if(POLICY CMP0048) |
| 4 | cmake_policy(SET CMP0048 OLD) |
| 5 | endif(POLICY CMP0048) |
6 | 6 | |
7 | | IF(POLICY CMP0043) |
8 | | CMAKE_POLICY(SET CMP0043 NEW) |
9 | | ENDIF(POLICY CMP0043) |
| 7 | if(POLICY CMP0043) |
| 8 | cmake_policy(SET CMP0043 NEW) |
| 9 | endif(POLICY CMP0043) |
10 | 10 | |
11 | | IF(POLICY CMP0026) |
| 11 | if(POLICY CMP0026) |
12 | 12 | #This is for copying the dll's needed by glpk (in lp_test and mip_test) |
13 | | CMAKE_POLICY(SET CMP0026 NEW) |
14 | | ENDIF(POLICY CMP0026) |
| 13 | cmake_policy(SET CMP0026 NEW) |
| 14 | endif(POLICY CMP0026) |
15 | 15 | |
16 | | SET(PROJECT_NAME "LEMON") |
17 | | PROJECT(${PROJECT_NAME}) |
| 16 | set(PROJECT_NAME "LEMON") |
| 17 | project(${PROJECT_NAME}) |
18 | 18 | |
19 | | INCLUDE(FindPythonInterp) |
20 | | INCLUDE(FindWget) |
| 19 | include(FindPythonInterp) |
| 20 | include(FindWget) |
21 | 21 | |
22 | | IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake) |
23 | | INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake) |
24 | | ELSEIF(DEFINED ENV{LEMON_VERSION}) |
25 | | SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.") |
26 | | ELSE() |
27 | | EXECUTE_PROCESS( |
| 22 | if(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake) |
| 23 | include(${PROJECT_SOURCE_DIR}/cmake/version.cmake) |
| 24 | elseif(DEFINED ENV{LEMON_VERSION}) |
| 25 | set(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.") |
| 26 | else() |
| 27 | execute_process( |
28 | 28 | COMMAND |
29 | 29 | hg log -r. --template "{latesttag}" |
30 | 30 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
… |
… |
|
32 | 32 | ERROR_QUIET |
33 | 33 | OUTPUT_STRIP_TRAILING_WHITESPACE |
34 | 34 | ) |
35 | | EXECUTE_PROCESS( |
| 35 | execute_process( |
36 | 36 | COMMAND |
37 | 37 | hg log -r. --template "{latesttagdistance}" |
38 | 38 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
… |
… |
|
40 | 40 | ERROR_QUIET |
41 | 41 | OUTPUT_STRIP_TRAILING_WHITESPACE |
42 | 42 | ) |
43 | | EXECUTE_PROCESS( |
| 43 | execute_process( |
44 | 44 | COMMAND |
45 | 45 | hg log -r. --template "{node|short}" |
46 | 46 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
… |
… |
|
49 | 49 | OUTPUT_STRIP_TRAILING_WHITESPACE |
50 | 50 | ) |
51 | 51 | |
52 | | IF(HG_REVISION_TAG STREQUAL "") |
53 | | SET(HG_REVISION_ID "hg-tip") |
54 | | ELSE() |
55 | | IF(HG_REVISION_TAG STREQUAL "null") |
56 | | SET(HG_REVISION_TAG "trunk") |
57 | | ELSEIF(HG_REVISION_TAG MATCHES "^r") |
58 | | STRING(SUBSTRING ${HG_REVISION_TAG} 1 -1 HG_REVISION_TAG) |
59 | | ENDIF() |
60 | | IF(HG_REVISION_DIST STREQUAL "0") |
61 | | SET(HG_REVISION ${HG_REVISION_TAG}) |
62 | | ELSE() |
63 | | SET(HG_REVISION |
| 52 | if(HG_REVISION_TAG STREQUAL "") |
| 53 | set(HG_REVISION_ID "hg-tip") |
| 54 | else() |
| 55 | if(HG_REVISION_TAG STREQUAL "null") |
| 56 | set(HG_REVISION_TAG "trunk") |
| 57 | elseif(HG_REVISION_TAG MATCHES "^r") |
| 58 | string(SUBSTRING ${HG_REVISION_TAG} 1 -1 HG_REVISION_TAG) |
| 59 | endif() |
| 60 | if(HG_REVISION_DIST STREQUAL "0") |
| 61 | set(HG_REVISION ${HG_REVISION_TAG}) |
| 62 | else() |
| 63 | set(HG_REVISION |
64 | 64 | "${HG_REVISION_TAG}+${HG_REVISION_DIST}-${HG_REVISION_ID}") |
65 | | ENDIF() |
66 | | ENDIF() |
| 65 | endif() |
| 66 | endif() |
67 | 67 | |
68 | | SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.") |
69 | | ENDIF() |
| 68 | set(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.") |
| 69 | endif() |
70 | 70 | |
71 | | SET(PROJECT_VERSION ${LEMON_VERSION}) |
| 71 | set(PROJECT_VERSION ${LEMON_VERSION}) |
72 | 72 | |
73 | | SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) |
| 73 | set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) |
74 | 74 | |
75 | | FIND_PACKAGE(Doxygen) |
76 | | FIND_PACKAGE(Ghostscript) |
| 75 | find_package(Doxygen) |
| 76 | find_package(Ghostscript) |
77 | 77 | |
78 | | IF(WIN32) |
79 | | SET(LEMON_WIN32 TRUE) |
80 | | ENDIF(WIN32) |
| 78 | if(WIN32) |
| 79 | set(LEMON_WIN32 TRUE) |
| 80 | endif(WIN32) |
81 | 81 | |
82 | | SET(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.") |
83 | | SET(LEMON_ENABLE_ILOG YES CACHE STRING "Enable ILOG (CPLEX) solver backend.") |
84 | | SET(LEMON_ENABLE_COIN YES CACHE STRING "Enable COIN solver backend.") |
85 | | SET(LEMON_ENABLE_SOPLEX YES CACHE STRING "Enable SoPlex solver backend.") |
| 82 | set(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.") |
| 83 | set(LEMON_ENABLE_ILOG YES CACHE STRING "Enable ILOG (CPLEX) solver backend.") |
| 84 | set(LEMON_ENABLE_COIN YES CACHE STRING "Enable COIN solver backend.") |
| 85 | set(LEMON_ENABLE_SOPLEX YES CACHE STRING "Enable SoPlex solver backend.") |
86 | 86 | |
87 | | IF(LEMON_ENABLE_GLPK) |
88 | | FIND_PACKAGE(GLPK 4.33) |
89 | | IF(GLPK_FOUND) |
90 | | SET(LEMON_HAVE_LP TRUE) |
91 | | SET(LEMON_HAVE_MIP TRUE) |
92 | | SET(LEMON_HAVE_GLPK TRUE) |
93 | | ENDIF(GLPK_FOUND) |
94 | | ENDIF(LEMON_ENABLE_GLPK) |
95 | | IF(LEMON_ENABLE_ILOG) |
96 | | FIND_PACKAGE(ILOG) |
97 | | IF(ILOG_FOUND) |
98 | | SET(LEMON_HAVE_LP TRUE) |
99 | | SET(LEMON_HAVE_MIP TRUE) |
100 | | SET(LEMON_HAVE_CPLEX TRUE) |
101 | | ENDIF(ILOG_FOUND) |
102 | | ENDIF(LEMON_ENABLE_ILOG) |
103 | | IF(LEMON_ENABLE_COIN) |
104 | | FIND_PACKAGE(COIN) |
105 | | IF(COIN_FOUND) |
106 | | SET(LEMON_HAVE_LP TRUE) |
107 | | SET(LEMON_HAVE_MIP TRUE) |
108 | | SET(LEMON_HAVE_CLP TRUE) |
109 | | SET(LEMON_HAVE_CBC TRUE) |
110 | | ENDIF(COIN_FOUND) |
111 | | ENDIF(LEMON_ENABLE_COIN) |
112 | | IF(LEMON_ENABLE_SOPLEX) |
113 | | FIND_PACKAGE(SOPLEX) |
114 | | IF(SOPLEX_FOUND) |
115 | | SET(LEMON_HAVE_LP TRUE) |
116 | | SET(LEMON_HAVE_SOPLEX TRUE) |
117 | | ENDIF(SOPLEX_FOUND) |
118 | | ENDIF(LEMON_ENABLE_SOPLEX) |
| 87 | if(LEMON_ENABLE_GLPK) |
| 88 | find_package(GLPK 4.33) |
| 89 | if(GLPK_FOUND) |
| 90 | set(LEMON_HAVE_LP TRUE) |
| 91 | set(LEMON_HAVE_MIP TRUE) |
| 92 | set(LEMON_HAVE_GLPK TRUE) |
| 93 | endif(GLPK_FOUND) |
| 94 | endif(LEMON_ENABLE_GLPK) |
| 95 | if(LEMON_ENABLE_ILOG) |
| 96 | find_package(ILOG) |
| 97 | if(ILOG_FOUND) |
| 98 | set(LEMON_HAVE_LP TRUE) |
| 99 | set(LEMON_HAVE_MIP TRUE) |
| 100 | set(LEMON_HAVE_CPLEX TRUE) |
| 101 | endif(ILOG_FOUND) |
| 102 | endif(LEMON_ENABLE_ILOG) |
| 103 | if(LEMON_ENABLE_COIN) |
| 104 | find_package(COIN) |
| 105 | if(COIN_FOUND) |
| 106 | set(LEMON_HAVE_LP TRUE) |
| 107 | set(LEMON_HAVE_MIP TRUE) |
| 108 | set(LEMON_HAVE_CLP TRUE) |
| 109 | set(LEMON_HAVE_CBC TRUE) |
| 110 | endif(COIN_FOUND) |
| 111 | endif(LEMON_ENABLE_COIN) |
| 112 | if(LEMON_ENABLE_SOPLEX) |
| 113 | find_package(SOPLEX) |
| 114 | if(SOPLEX_FOUND) |
| 115 | set(LEMON_HAVE_LP TRUE) |
| 116 | set(LEMON_HAVE_SOPLEX TRUE) |
| 117 | endif(SOPLEX_FOUND) |
| 118 | endif(LEMON_ENABLE_SOPLEX) |
119 | 119 | |
120 | | IF(ILOG_FOUND) |
121 | | SET(DEFAULT_LP "CPLEX") |
122 | | SET(DEFAULT_MIP "CPLEX") |
123 | | ELSEIF(COIN_FOUND) |
124 | | SET(DEFAULT_LP "CLP") |
125 | | SET(DEFAULT_MIP "CBC") |
126 | | ELSEIF(GLPK_FOUND) |
127 | | SET(DEFAULT_LP "GLPK") |
128 | | SET(DEFAULT_MIP "GLPK") |
129 | | ELSEIF(SOPLEX_FOUND) |
130 | | SET(DEFAULT_LP "SOPLEX") |
131 | | ENDIF() |
| 120 | if(ILOG_FOUND) |
| 121 | set(DEFAULT_LP "CPLEX") |
| 122 | set(DEFAULT_MIP "CPLEX") |
| 123 | elseif(COIN_FOUND) |
| 124 | set(DEFAULT_LP "CLP") |
| 125 | set(DEFAULT_MIP "CBC") |
| 126 | elseif(GLPK_FOUND) |
| 127 | set(DEFAULT_LP "GLPK") |
| 128 | set(DEFAULT_MIP "GLPK") |
| 129 | elseif(SOPLEX_FOUND) |
| 130 | set(DEFAULT_LP "SOPLEX") |
| 131 | endif() |
132 | 132 | |
133 | | IF(NOT LEMON_DEFAULT_LP OR |
| 133 | if(NOT LEMON_DEFAULT_LP OR |
134 | 134 | (NOT ILOG_FOUND AND (LEMON_DEFAULT_LP STREQUAL "CPLEX")) OR |
135 | 135 | (NOT COIN_FOUND AND (LEMON_DEFAULT_LP STREQUAL "CLP")) OR |
136 | 136 | (NOT GLPK_FOUND AND (LEMON_DEFAULT_LP STREQUAL "GLPK")) OR |
137 | 137 | (NOT SOPLEX_FOUND AND (LEMON_DEFAULT_LP STREQUAL "SOPLEX"))) |
138 | | SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING |
| 138 | set(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING |
139 | 139 | "Default LP solver backend (GLPK, CPLEX, CLP or SOPLEX)" FORCE) |
140 | | ELSE() |
141 | | SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING |
| 140 | else() |
| 141 | set(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING |
142 | 142 | "Default LP solver backend (GLPK, CPLEX, CLP or SOPLEX)") |
143 | | ENDIF() |
144 | | IF(NOT LEMON_DEFAULT_MIP OR |
| 143 | endif() |
| 144 | if(NOT LEMON_DEFAULT_MIP OR |
145 | 145 | (NOT ILOG_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "CPLEX")) OR |
146 | 146 | (NOT COIN_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "CBC")) OR |
147 | 147 | (NOT GLPK_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "GLPK"))) |
148 | | SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING |
| 148 | set(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING |
149 | 149 | "Default MIP solver backend (GLPK, CPLEX or CBC)" FORCE) |
150 | | ELSE() |
151 | | SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING |
| 150 | else() |
| 151 | set(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING |
152 | 152 | "Default MIP solver backend (GLPK, CPLEX or CBC)") |
153 | | ENDIF() |
| 153 | endif() |
154 | 154 | |
155 | | IF( ( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND |
| 155 | if( ( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND |
156 | 156 | ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL "4.8") ) |
157 | 157 | OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
158 | 158 | OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") |
159 | 159 | ) |
160 | | SET(LEMON_NO_UNUSED_LOCAL_TYPEDEF_WARNINGS TRUE) |
161 | | ENDIF() |
| 160 | set(LEMON_NO_UNUSED_LOCAL_TYPEDEF_WARNINGS TRUE) |
| 161 | endif() |
162 | 162 | |
163 | | IF(DEFINED ENV{LEMON_CXX_WARNING}) |
164 | | SET(CXX_WARNING $ENV{LEMON_CXX_WARNING}) |
165 | | ELSE() |
166 | | IF( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
| 163 | if(DEFINED ENV{LEMON_CXX_WARNING}) |
| 164 | set(CXX_WARNING $ENV{LEMON_CXX_WARNING}) |
| 165 | else() |
| 166 | if( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
167 | 167 | OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
168 | 168 | ) |
169 | | SET(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas") |
170 | | SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb") |
171 | | SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb") |
172 | | ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") |
173 | | SET(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wno-unknown-pragmas") |
174 | | SET(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb") |
175 | | SET(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb") |
176 | | ELSEIF(MSVC) |
| 169 | set(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas") |
| 170 | set(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb") |
| 171 | set(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb") |
| 172 | elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") |
| 173 | set(CXX_WARNING "-Wall -W -Wunused -Wformat=2 -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wsign-promo -Woverloaded-virtual -fno-strict-aliasing -Wno-unknown-pragmas") |
| 174 | set(CMAKE_CXX_FLAGS_DEBUG CACHE STRING "-ggdb") |
| 175 | set(CMAKE_C_FLAGS_DEBUG CACHE STRING "-ggdb") |
| 176 | elseif(MSVC) |
177 | 177 | # This part is unnecessary 'casue the same is set by the lemon/core.h. |
178 | 178 | # Still kept as an example. |
179 | 179 | |
180 | | # SET(CXX_WARNING "/wd4250 /wd4267 /wd4355 /wd4503 /wd4800 /wd4996") |
| 180 | # set(CXX_WARNING "/wd4250 /wd4267 /wd4355 /wd4503 /wd4800 /wd4996") |
181 | 181 | |
182 | 182 | # Suppressed warnings: |
183 | 183 | # C4250: 'class1' : inherits 'class2::member' via dominance |
… |
… |
|
187 | 187 | # C4800: 'type' : forcing value to bool 'true' or 'false' |
188 | 188 | # (performance warning) |
189 | 189 | # C4996: 'function': was declared deprecated |
190 | | ELSE() |
191 | | SET(CXX_WARNING "-Wall") |
192 | | ENDIF() |
193 | | ENDIF() |
194 | | SET(LEMON_CXX_WARNING_FLAGS ${CXX_WARNING} CACHE STRING "LEMON warning flags.") |
| 190 | else() |
| 191 | set(CXX_WARNING "-Wall") |
| 192 | endif() |
| 193 | endif() |
| 194 | set(LEMON_CXX_WARNING_FLAGS ${CXX_WARNING} CACHE STRING "LEMON warning flags.") |
195 | 195 | |
196 | | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}") |
| 196 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}") |
197 | 197 | |
198 | | IF(MSVC) |
199 | | SET( CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}") |
200 | | SET( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING |
| 198 | if(MSVC) |
| 199 | set( CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}") |
| 200 | set( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING |
201 | 201 | "Flags used by the C++ compiler during maintainer builds." FORCE |
202 | 202 | ) |
203 | | SET( CMAKE_C_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING |
| 203 | set( CMAKE_C_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING |
204 | 204 | "Flags used by the C compiler during maintainer builds." FORCE |
205 | 205 | ) |
206 | | SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER |
| 206 | set( CMAKE_EXE_LINKER_FLAGS_MAINTAINER |
207 | 207 | "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING |
208 | 208 | "Flags used for linking binaries during maintainer builds." FORCE |
209 | 209 | ) |
210 | | SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER |
| 210 | set( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER |
211 | 211 | "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING |
212 | 212 | "Flags used by the shared libraries linker during maintainer builds." |
213 | 213 | FORCE |
214 | 214 | ) |
215 | | ELSE() |
216 | | SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb -O0" CACHE STRING |
| 215 | else() |
| 216 | set( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb -O0" CACHE STRING |
217 | 217 | "Flags used by the C++ compiler during maintainer builds." FORCE |
218 | 218 | ) |
219 | | SET( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING |
| 219 | set( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING |
220 | 220 | "Flags used by the C compiler during maintainer builds." FORCE |
221 | 221 | ) |
222 | | SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER |
| 222 | set( CMAKE_EXE_LINKER_FLAGS_MAINTAINER |
223 | 223 | "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING |
224 | 224 | "Flags used for linking binaries during maintainer builds." FORCE |
225 | 225 | ) |
226 | | SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER |
| 226 | set( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER |
227 | 227 | "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING |
228 | 228 | "Flags used by the shared libraries linker during maintainer builds." FORCE) |
229 | | ENDIF() |
| 229 | endif() |
230 | 230 | |
231 | | MARK_AS_ADVANCED( |
| 231 | mark_as_advanced( |
232 | 232 | CMAKE_CXX_FLAGS_MAINTAINER |
233 | 233 | CMAKE_C_FLAGS_MAINTAINER |
234 | 234 | CMAKE_EXE_LINKER_FLAGS_MAINTAINER |
235 | 235 | CMAKE_SHARED_LINKER_FLAGS_MAINTAINER ) |
236 | 236 | |
237 | | IF(CMAKE_CONFIGURATION_TYPES) |
238 | | LIST(APPEND CMAKE_CONFIGURATION_TYPES Maintainer) |
239 | | LIST(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES) |
240 | | SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING |
| 237 | if(CMAKE_CONFIGURATION_TYPES) |
| 238 | list(APPEND CMAKE_CONFIGURATION_TYPES Maintainer) |
| 239 | list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES) |
| 240 | set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING |
241 | 241 | "Add the configurations that we need" |
242 | 242 | FORCE) |
243 | 243 | endif() |
244 | 244 | |
245 | | IF(NOT CMAKE_BUILD_TYPE) |
246 | | SET(CMAKE_BUILD_TYPE "Release") |
247 | | ENDIF() |
| 245 | if(NOT CMAKE_BUILD_TYPE) |
| 246 | set(CMAKE_BUILD_TYPE "Release") |
| 247 | endif() |
248 | 248 | |
249 | | SET( CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING |
| 249 | set( CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING |
250 | 250 | "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel Maintainer." |
251 | 251 | FORCE ) |
252 | 252 | |
253 | | SET_DIRECTORY_PROPERTIES(PROPERTIES |
| 253 | set_directory_properties(PROPERTIES |
254 | 254 | COMPILE_DEFINITIONS |
255 | 255 | $<$<OR:$<CONFIG:Debug>,$<CONFIG:Maintainer>>:LEMON_ENABLE_DEBUG> |
256 | 256 | ) |
257 | 257 | |
258 | | INCLUDE(CheckTypeSize) |
| 258 | include(CheckTypeSize) |
259 | 259 | CHECK_TYPE_SIZE("long long" LONG_LONG) |
260 | | SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG}) |
| 260 | set(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG}) |
261 | 261 | |
262 | | INCLUDE(FindThreads) |
| 262 | include(FindThreads) |
263 | 263 | |
264 | | IF(NOT LEMON_THREADING) |
265 | | IF(CMAKE_USE_PTHREADS_INIT) |
266 | | SET(LEMON_THREADING "Pthread") |
267 | | ELSEIF(CMAKE_USE_WIN32_THREADS_INIT) |
268 | | SET(LEMON_THREADING "Win32") |
269 | | ELSE() |
270 | | SET(LEMON_THREADING "None") |
271 | | ENDIF() |
272 | | ENDIF() |
| 264 | if(NOT LEMON_THREADING) |
| 265 | if(CMAKE_USE_PTHREADS_INIT) |
| 266 | set(LEMON_THREADING "Pthread") |
| 267 | elseif(CMAKE_USE_WIN32_THREADS_INIT) |
| 268 | set(LEMON_THREADING "Win32") |
| 269 | else() |
| 270 | set(LEMON_THREADING "None") |
| 271 | endif() |
| 272 | endif() |
273 | 273 | |
274 | | SET( LEMON_THREADING "${LEMON_THREADING}" CACHE STRING |
| 274 | set( LEMON_THREADING "${LEMON_THREADING}" CACHE STRING |
275 | 275 | "Choose the threading library, options are: Pthread Win32 None." |
276 | 276 | FORCE ) |
277 | 277 | |
278 | | IF(LEMON_THREADING STREQUAL "Pthread") |
279 | | SET(LEMON_USE_PTHREAD TRUE) |
280 | | ELSEIF(LEMON_THREADING STREQUAL "Win32") |
281 | | SET(LEMON_USE_WIN32_THREADS TRUE) |
282 | | ENDIF() |
| 278 | if(LEMON_THREADING STREQUAL "Pthread") |
| 279 | set(LEMON_USE_PTHREAD TRUE) |
| 280 | elseif(LEMON_THREADING STREQUAL "Win32") |
| 281 | set(LEMON_USE_WIN32_THREADS TRUE) |
| 282 | endif() |
283 | 283 | |
284 | | ENABLE_TESTING() |
| 284 | enable_testing() |
285 | 285 | |
286 | 286 | |
287 | | INCLUDE(CheckCXXCompilerFlag) |
| 287 | include(CheckCXXCompilerFlag) |
288 | 288 | CHECK_CXX_COMPILER_FLAG("-std=c++11" LEMON_CXX11) |
289 | | IF(LEMON_CXX11) |
290 | | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") |
291 | | ENDIF() |
| 289 | if(LEMON_CXX11) |
| 290 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") |
| 291 | endif() |
292 | 292 | |
293 | 293 | |
294 | | IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
295 | | ADD_CUSTOM_TARGET(check ALL COMMAND ${CMAKE_CTEST_COMMAND}) |
296 | | ELSE() |
297 | | ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND}) |
298 | | ENDIF() |
| 294 | if(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
| 295 | add_custom_target(check ALL COMMAND ${CMAKE_CTEST_COMMAND}) |
| 296 | else() |
| 297 | add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) |
| 298 | endif() |
299 | 299 | |
300 | | ADD_SUBDIRECTORY(lemon) |
301 | | IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) |
302 | | ADD_SUBDIRECTORY(contrib) |
303 | | ADD_SUBDIRECTORY(demo) |
304 | | ADD_SUBDIRECTORY(tools) |
305 | | ADD_SUBDIRECTORY(doc) |
306 | | ADD_SUBDIRECTORY(test) |
307 | | ENDIF() |
| 300 | add_subdirectory(lemon) |
| 301 | if(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) |
| 302 | add_subdirectory(contrib) |
| 303 | add_subdirectory(demo) |
| 304 | add_subdirectory(tools) |
| 305 | add_subdirectory(doc) |
| 306 | add_subdirectory(test) |
| 307 | endif() |
308 | 308 | |
309 | | CONFIGURE_FILE( |
| 309 | configure_file( |
310 | 310 | ${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in |
311 | 311 | ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake |
312 | 312 | @ONLY |
313 | 313 | ) |
314 | | IF(UNIX) |
315 | | INSTALL( |
| 314 | if(UNIX) |
| 315 | install( |
316 | 316 | FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake |
317 | 317 | DESTINATION share/lemon/cmake |
318 | 318 | ) |
319 | | ELSEIF(WIN32) |
320 | | INSTALL( |
| 319 | elseif(WIN32) |
| 320 | install( |
321 | 321 | FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake |
322 | 322 | DESTINATION cmake |
323 | 323 | ) |
324 | | ENDIF() |
| 324 | endif() |
325 | 325 | |
326 | | CONFIGURE_FILE( |
| 326 | configure_file( |
327 | 327 | ${PROJECT_SOURCE_DIR}/cmake/version.cmake.in |
328 | 328 | ${PROJECT_BINARY_DIR}/cmake/version.cmake |
329 | 329 | @ONLY |
330 | 330 | ) |
331 | 331 | |
332 | | SET(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME}) |
333 | | STRING(TOLOWER ${ARCHIVE_BASE_NAME} ARCHIVE_BASE_NAME) |
334 | | SET(ARCHIVE_NAME ${ARCHIVE_BASE_NAME}-${PROJECT_VERSION}) |
335 | | ADD_CUSTOM_TARGET(dist |
| 332 | set(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME}) |
| 333 | string(TOLOWER ${ARCHIVE_BASE_NAME} ARCHIVE_BASE_NAME) |
| 334 | set(ARCHIVE_NAME ${ARCHIVE_BASE_NAME}-${PROJECT_VERSION}) |
| 335 | add_custom_target(dist |
336 | 336 | COMMAND cmake -E remove_directory ${ARCHIVE_NAME} |
337 | 337 | COMMAND hg archive ${ARCHIVE_NAME} |
338 | 338 | COMMAND cmake -E copy cmake/version.cmake ${ARCHIVE_NAME}/cmake/version.cmake |
… |
… |
|
350 | 350 | WORKING_DIRECTORY ${PROJECT_BINARY_DIR}) |
351 | 351 | |
352 | 352 | # CPACK config (Basically for NSIS) |
353 | | IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) |
354 | | SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) |
355 | | SET(CPACK_PACKAGE_VENDOR "EGRES") |
356 | | SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY |
| 353 | if(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) |
| 354 | set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) |
| 355 | set(CPACK_PACKAGE_VENDOR "EGRES") |
| 356 | set(CPACK_PACKAGE_DESCRIPTION_SUMMARY |
357 | 357 | "LEMON - Library for Efficient Modeling and Optimization in Networks") |
358 | | SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") |
| 358 | set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") |
359 | 359 | |
360 | | SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
| 360 | set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
361 | 361 | |
362 | | SET(CPACK_PACKAGE_INSTALL_DIRECTORY |
| 362 | set(CPACK_PACKAGE_INSTALL_DIRECTORY |
363 | 363 | "${PROJECT_NAME} ${PROJECT_VERSION}") |
364 | | SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY |
| 364 | set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY |
365 | 365 | "${PROJECT_NAME} ${PROJECT_VERSION}") |
366 | 366 | |
367 | | SET(CPACK_COMPONENTS_ALL headers library html_documentation bin) |
| 367 | set(CPACK_COMPONENTS_ALL headers library html_documentation bin) |
368 | 368 | |
369 | | SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers") |
370 | | SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library") |
371 | | SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities") |
372 | | SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation") |
| 369 | set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers") |
| 370 | set(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library") |
| 371 | set(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities") |
| 372 | set(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation") |
373 | 373 | |
374 | | SET(CPACK_COMPONENT_HEADERS_DESCRIPTION |
| 374 | set(CPACK_COMPONENT_HEADERS_DESCRIPTION |
375 | 375 | "C++ header files") |
376 | | SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION |
| 376 | set(CPACK_COMPONENT_LIBRARY_DESCRIPTION |
377 | 377 | "DLL and import library") |
378 | | SET(CPACK_COMPONENT_BIN_DESCRIPTION |
| 378 | set(CPACK_COMPONENT_BIN_DESCRIPTION |
379 | 379 | "Command line utilities") |
380 | | SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION |
| 380 | set(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION |
381 | 381 | "Doxygen generated documentation") |
382 | 382 | |
383 | | SET(CPACK_COMPONENT_HEADERS_DEPENDS library) |
| 383 | set(CPACK_COMPONENT_HEADERS_DEPENDS library) |
384 | 384 | |
385 | | SET(CPACK_COMPONENT_HEADERS_GROUP "Development") |
386 | | SET(CPACK_COMPONENT_LIBRARY_GROUP "Development") |
387 | | SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation") |
| 385 | set(CPACK_COMPONENT_HEADERS_GROUP "Development") |
| 386 | set(CPACK_COMPONENT_LIBRARY_GROUP "Development") |
| 387 | set(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation") |
388 | 388 | |
389 | | SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION |
| 389 | set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION |
390 | 390 | "Components needed to develop software using LEMON") |
391 | | SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION |
| 391 | set(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION |
392 | 392 | "Documentation of LEMON") |
393 | 393 | |
394 | | SET(CPACK_ALL_INSTALL_TYPES Full Developer) |
| 394 | set(CPACK_ALL_INSTALL_TYPES Full Developer) |
395 | 395 | |
396 | | SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) |
397 | | SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full) |
398 | | SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full) |
| 396 | set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) |
| 397 | set(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full) |
| 398 | set(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full) |
399 | 399 | |
400 | | SET(CPACK_GENERATOR "NSIS") |
401 | | SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico") |
402 | | SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico") |
403 | | #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp") |
404 | | SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico") |
405 | | SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}") |
406 | | SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu") |
407 | | SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu") |
408 | | SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu") |
409 | | SET(CPACK_NSIS_CREATE_ICONS_EXTRA " |
| 400 | set(CPACK_GENERATOR "NSIS") |
| 401 | set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico") |
| 402 | set(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico") |
| 403 | #set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp") |
| 404 | set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico") |
| 405 | set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}") |
| 406 | set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu") |
| 407 | set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu") |
| 408 | set(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu") |
| 409 | set(CPACK_NSIS_CREATE_ICONS_EXTRA " |
410 | 410 | CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\share\\\\doc\\\\index.html\\\" |
411 | 411 | ") |
412 | | SET(CPACK_NSIS_DELETE_ICONS_EXTRA " |
| 412 | set(CPACK_NSIS_DELETE_ICONS_EXTRA " |
413 | 413 | !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP |
414 | 414 | Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\" |
415 | 415 | ") |
416 | 416 | |
417 | | INCLUDE(CPack) |
418 | | ENDIF() |
| 417 | include(CPack) |
| 418 | endif() |
diff --git a/cmake/FindCOIN.cmake b/cmake/FindCOIN.cmake
a
|
b
|
|
1 | | SET(COIN_ROOT_DIR "" CACHE PATH "COIN root directory") |
| 1 | set(COIN_ROOT_DIR "" CACHE PATH "COIN root directory") |
2 | 2 | |
3 | | FIND_PATH(COIN_INCLUDE_DIR coin/CoinUtilsConfig.h |
| 3 | find_path(COIN_INCLUDE_DIR coin/CoinUtilsConfig.h |
4 | 4 | HINTS ${COIN_ROOT_DIR}/include |
5 | 5 | ) |
6 | | FIND_LIBRARY(COIN_CBC_LIBRARY |
| 6 | find_library(COIN_CBC_LIBRARY |
7 | 7 | NAMES Cbc libCbc |
8 | 8 | HINTS ${COIN_ROOT_DIR}/lib/coin |
9 | 9 | HINTS ${COIN_ROOT_DIR}/lib |
10 | 10 | ) |
11 | | FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY |
| 11 | find_library(COIN_CBC_SOLVER_LIBRARY |
12 | 12 | NAMES CbcSolver libCbcSolver |
13 | 13 | HINTS ${COIN_ROOT_DIR}/lib/coin |
14 | 14 | HINTS ${COIN_ROOT_DIR}/lib |
15 | 15 | ) |
16 | | FIND_LIBRARY(COIN_CGL_LIBRARY |
| 16 | find_library(COIN_CGL_LIBRARY |
17 | 17 | NAMES Cgl libCgl |
18 | 18 | HINTS ${COIN_ROOT_DIR}/lib/coin |
19 | 19 | HINTS ${COIN_ROOT_DIR}/lib |
20 | 20 | ) |
21 | | FIND_LIBRARY(COIN_CLP_LIBRARY |
| 21 | find_library(COIN_CLP_LIBRARY |
22 | 22 | NAMES Clp libClp |
23 | 23 | HINTS ${COIN_ROOT_DIR}/lib/coin |
24 | 24 | HINTS ${COIN_ROOT_DIR}/lib |
25 | 25 | ) |
26 | | FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY |
| 26 | find_library(COIN_COIN_UTILS_LIBRARY |
27 | 27 | NAMES CoinUtils libCoinUtils |
28 | 28 | HINTS ${COIN_ROOT_DIR}/lib/coin |
29 | 29 | HINTS ${COIN_ROOT_DIR}/lib |
30 | 30 | ) |
31 | | FIND_LIBRARY(COIN_OSI_LIBRARY |
| 31 | find_library(COIN_OSI_LIBRARY |
32 | 32 | NAMES Osi libOsi |
33 | 33 | HINTS ${COIN_ROOT_DIR}/lib/coin |
34 | 34 | HINTS ${COIN_ROOT_DIR}/lib |
35 | 35 | ) |
36 | | FIND_LIBRARY(COIN_OSI_CBC_LIBRARY |
| 36 | find_library(COIN_OSI_CBC_LIBRARY |
37 | 37 | NAMES OsiCbc libOsiCbc |
38 | 38 | HINTS ${COIN_ROOT_DIR}/lib/coin |
39 | 39 | HINTS ${COIN_ROOT_DIR}/lib |
40 | 40 | ) |
41 | | FIND_LIBRARY(COIN_OSI_CLP_LIBRARY |
| 41 | find_library(COIN_OSI_CLP_LIBRARY |
42 | 42 | NAMES OsiClp libOsiClp |
43 | 43 | HINTS ${COIN_ROOT_DIR}/lib/coin |
44 | 44 | HINTS ${COIN_ROOT_DIR}/lib |
45 | 45 | ) |
46 | | FIND_LIBRARY(COIN_OSI_VOL_LIBRARY |
| 46 | find_library(COIN_OSI_VOL_LIBRARY |
47 | 47 | NAMES OsiVol libOsiVol |
48 | 48 | HINTS ${COIN_ROOT_DIR}/lib/coin |
49 | 49 | HINTS ${COIN_ROOT_DIR}/lib |
50 | 50 | ) |
51 | | FIND_LIBRARY(COIN_VOL_LIBRARY |
| 51 | find_library(COIN_VOL_LIBRARY |
52 | 52 | NAMES Vol libVol |
53 | 53 | HINTS ${COIN_ROOT_DIR}/lib/coin |
54 | 54 | HINTS ${COIN_ROOT_DIR}/lib |
55 | 55 | ) |
56 | 56 | |
57 | | FIND_LIBRARY(COIN_ZLIB_LIBRARY |
| 57 | find_library(COIN_ZLIB_LIBRARY |
58 | 58 | NAMES z libz |
59 | 59 | HINTS ${COIN_ROOT_DIR}/lib/coin |
60 | 60 | HINTS ${COIN_ROOT_DIR}/lib |
61 | 61 | ) |
62 | | FIND_LIBRARY(COIN_BZ2_LIBRARY |
| 62 | find_library(COIN_BZ2_LIBRARY |
63 | 63 | NAMES bz2 libbz2 |
64 | 64 | HINTS ${COIN_ROOT_DIR}/lib/coin |
65 | 65 | HINTS ${COIN_ROOT_DIR}/lib |
66 | 66 | ) |
67 | 67 | |
68 | | FIND_LIBRARY(COIN_PTHREADS_LIBRARY |
| 68 | find_library(COIN_PTHREADS_LIBRARY |
69 | 69 | NAMES pthreads libpthreads |
70 | 70 | HINTS ${COIN_ROOT_DIR}/lib/coin |
71 | 71 | HINTS ${COIN_ROOT_DIR}/lib |
72 | 72 | ) |
73 | 73 | |
74 | | INCLUDE(FindPackageHandleStandardArgs) |
| 74 | include(FindPackageHandleStandardArgs) |
75 | 75 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG |
76 | 76 | COIN_INCLUDE_DIR |
77 | 77 | COIN_CBC_LIBRARY |
… |
… |
|
86 | 86 | # COIN_VOL_LIBRARY |
87 | 87 | ) |
88 | 88 | |
89 | | IF(COIN_FOUND) |
90 | | SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR}) |
91 | | SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}") |
92 | | IF(COIN_ZLIB_LIBRARY) |
93 | | SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}") |
94 | | ENDIF(COIN_ZLIB_LIBRARY) |
95 | | IF(COIN_BZ2_LIBRARY) |
96 | | SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}") |
97 | | ENDIF(COIN_BZ2_LIBRARY) |
98 | | IF(COIN_PTHREADS_LIBRARY) |
99 | | SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_PTHREADS_LIBRARY}") |
100 | | ENDIF(COIN_PTHREADS_LIBRARY) |
101 | | SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}") |
102 | | SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES}) |
103 | | ENDIF(COIN_FOUND) |
| 89 | if(COIN_FOUND) |
| 90 | set(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR}) |
| 91 | set(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}") |
| 92 | if(COIN_ZLIB_LIBRARY) |
| 93 | set(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}") |
| 94 | endif(COIN_ZLIB_LIBRARY) |
| 95 | if(COIN_BZ2_LIBRARY) |
| 96 | set(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}") |
| 97 | endif(COIN_BZ2_LIBRARY) |
| 98 | if(COIN_PTHREADS_LIBRARY) |
| 99 | set(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_PTHREADS_LIBRARY}") |
| 100 | endif(COIN_PTHREADS_LIBRARY) |
| 101 | set(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}") |
| 102 | set(COIN_LIBRARIES ${COIN_CBC_LIBRARIES}) |
| 103 | endif(COIN_FOUND) |
104 | 104 | |
105 | | MARK_AS_ADVANCED( |
| 105 | mark_as_advanced( |
106 | 106 | COIN_INCLUDE_DIR |
107 | 107 | COIN_CBC_LIBRARY |
108 | 108 | COIN_CBC_SOLVER_LIBRARY |
diff --git a/cmake/FindGLPK.cmake b/cmake/FindGLPK.cmake
a
|
b
|
|
1 | | SET(GLPK_ROOT_DIR "" CACHE PATH "GLPK root directory") |
| 1 | set(GLPK_ROOT_DIR "" CACHE PATH "GLPK root directory") |
2 | 2 | |
3 | | SET(GLPK_REGKEY "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Glpk;InstallPath]") |
4 | | GET_FILENAME_COMPONENT(GLPK_ROOT_PATH ${GLPK_REGKEY} ABSOLUTE) |
| 3 | set(GLPK_REGKEY "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Glpk;InstallPath]") |
| 4 | get_filename_component(GLPK_ROOT_PATH ${GLPK_REGKEY} ABSOLUTE) |
5 | 5 | |
6 | | FIND_PATH(GLPK_INCLUDE_DIR |
| 6 | find_path(GLPK_INCLUDE_DIR |
7 | 7 | glpk.h |
8 | 8 | PATHS ${GLPK_REGKEY}/include |
9 | 9 | HINTS ${GLPK_ROOT_DIR}/include |
10 | 10 | ) |
11 | | FIND_LIBRARY(GLPK_LIBRARY |
| 11 | find_library(GLPK_LIBRARY |
12 | 12 | glpk |
13 | 13 | PATHS ${GLPK_REGKEY}/lib |
14 | 14 | HINTS ${GLPK_ROOT_DIR}/lib |
15 | 15 | ) |
16 | 16 | |
17 | | IF(GLPK_INCLUDE_DIR AND GLPK_LIBRARY) |
18 | | FILE(READ ${GLPK_INCLUDE_DIR}/glpk.h GLPK_GLPK_H) |
| 17 | if(GLPK_INCLUDE_DIR AND GLPK_LIBRARY) |
| 18 | file(READ ${GLPK_INCLUDE_DIR}/glpk.h GLPK_GLPK_H) |
19 | 19 | |
20 | | STRING(REGEX MATCH "define[ ]+GLP_MAJOR_VERSION[ ]+[0-9]+" GLPK_MAJOR_VERSION_LINE "${GLPK_GLPK_H}") |
21 | | STRING(REGEX REPLACE "define[ ]+GLP_MAJOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MAJOR "${GLPK_MAJOR_VERSION_LINE}") |
| 20 | string(REGEX MATCH "define[ ]+GLP_MAJOR_VERSION[ ]+[0-9]+" GLPK_MAJOR_VERSION_LINE "${GLPK_GLPK_H}") |
| 21 | string(REGEX REPLACE "define[ ]+GLP_MAJOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MAJOR "${GLPK_MAJOR_VERSION_LINE}") |
22 | 22 | |
23 | | STRING(REGEX MATCH "define[ ]+GLP_MINOR_VERSION[ ]+[0-9]+" GLPK_MINOR_VERSION_LINE "${GLPK_GLPK_H}") |
24 | | STRING(REGEX REPLACE "define[ ]+GLP_MINOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MINOR "${GLPK_MINOR_VERSION_LINE}") |
| 23 | string(REGEX MATCH "define[ ]+GLP_MINOR_VERSION[ ]+[0-9]+" GLPK_MINOR_VERSION_LINE "${GLPK_GLPK_H}") |
| 24 | string(REGEX REPLACE "define[ ]+GLP_MINOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MINOR "${GLPK_MINOR_VERSION_LINE}") |
25 | 25 | |
26 | | SET(GLPK_VERSION_STRING "${GLPK_VERSION_MAJOR}.${GLPK_VERSION_MINOR}") |
| 26 | set(GLPK_VERSION_STRING "${GLPK_VERSION_MAJOR}.${GLPK_VERSION_MINOR}") |
27 | 27 | |
28 | | IF(GLPK_FIND_VERSION) |
29 | | IF(GLPK_FIND_VERSION_COUNT GREATER 2) |
30 | | MESSAGE(SEND_ERROR "unexpected version string") |
31 | | ENDIF(GLPK_FIND_VERSION_COUNT GREATER 2) |
| 28 | if(GLPK_FIND_VERSION) |
| 29 | if(GLPK_FIND_VERSION_COUNT GREATER 2) |
| 30 | message(SEND_ERROR "unexpected version string") |
| 31 | endif(GLPK_FIND_VERSION_COUNT GREATER 2) |
32 | 32 | |
33 | | MATH(EXPR GLPK_REQUESTED_VERSION "${GLPK_FIND_VERSION_MAJOR}*100 + ${GLPK_FIND_VERSION_MINOR}") |
34 | | MATH(EXPR GLPK_FOUND_VERSION "${GLPK_VERSION_MAJOR}*100 + ${GLPK_VERSION_MINOR}") |
| 33 | math(EXPR GLPK_REQUESTED_VERSION "${GLPK_FIND_VERSION_MAJOR}*100 + ${GLPK_FIND_VERSION_MINOR}") |
| 34 | math(EXPR GLPK_FOUND_VERSION "${GLPK_VERSION_MAJOR}*100 + ${GLPK_VERSION_MINOR}") |
35 | 35 | |
36 | | IF(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION) |
37 | | SET(GLPK_PROPER_VERSION_FOUND FALSE) |
38 | | ELSE(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION) |
39 | | SET(GLPK_PROPER_VERSION_FOUND TRUE) |
40 | | ENDIF(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION) |
41 | | ELSE(GLPK_FIND_VERSION) |
42 | | SET(GLPK_PROPER_VERSION_FOUND TRUE) |
43 | | ENDIF(GLPK_FIND_VERSION) |
44 | | ENDIF(GLPK_INCLUDE_DIR AND GLPK_LIBRARY) |
| 36 | if(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION) |
| 37 | set(GLPK_PROPER_VERSION_FOUND FALSE) |
| 38 | else(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION) |
| 39 | set(GLPK_PROPER_VERSION_FOUND TRUE) |
| 40 | endif(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION) |
| 41 | else(GLPK_FIND_VERSION) |
| 42 | set(GLPK_PROPER_VERSION_FOUND TRUE) |
| 43 | endif(GLPK_FIND_VERSION) |
| 44 | endif(GLPK_INCLUDE_DIR AND GLPK_LIBRARY) |
45 | 45 | |
46 | | INCLUDE(FindPackageHandleStandardArgs) |
| 46 | include(FindPackageHandleStandardArgs) |
47 | 47 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_PROPER_VERSION_FOUND) |
48 | 48 | |
49 | | IF(GLPK_FOUND) |
50 | | SET(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR}) |
51 | | SET(GLPK_LIBRARIES ${GLPK_LIBRARY}) |
52 | | SET(GLPK_BIN_DIR ${GLPK_ROOT_PATH}/bin) |
53 | | ENDIF(GLPK_FOUND) |
| 49 | if(GLPK_FOUND) |
| 50 | set(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR}) |
| 51 | set(GLPK_LIBRARIES ${GLPK_LIBRARY}) |
| 52 | set(GLPK_BIN_DIR ${GLPK_ROOT_PATH}/bin) |
| 53 | endif(GLPK_FOUND) |
54 | 54 | |
55 | | MARK_AS_ADVANCED(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR) |
| 55 | mark_as_advanced(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR) |
diff --git a/cmake/FindGhostscript.cmake b/cmake/FindGhostscript.cmake
a
|
b
|
|
1 | | INCLUDE(FindPackageHandleStandardArgs) |
| 1 | include(FindPackageHandleStandardArgs) |
2 | 2 | |
3 | | FIND_PROGRAM(GHOSTSCRIPT_EXECUTABLE |
| 3 | find_program(GHOSTSCRIPT_EXECUTABLE |
4 | 4 | NAMES gs gswin32c |
5 | 5 | PATHS "$ENV{ProgramFiles}/gs" |
6 | 6 | PATH_SUFFIXES gs8.61/bin gs8.62/bin gs8.63/bin gs8.64/bin gs8.65/bin |
diff --git a/cmake/FindILOG.cmake b/cmake/FindILOG.cmake
a
|
b
|
|
1 | | FIND_PATH(ILOG_ROOT_DIR |
| 1 | find_path(ILOG_ROOT_DIR |
2 | 2 | NAMES cplex |
3 | 3 | DOC "CPLEX STUDIO root directory" |
4 | 4 | PATHS /opt/ibm/ILOG /usr/local/ibm/ILOG /usr/local/ILOG /usr/local/ilog |
… |
… |
|
10 | 10 | NO_DEFAULT_PATH |
11 | 11 | ) |
12 | 12 | |
13 | | IF(WIN32) |
14 | | IF(MSVC_VERSION STREQUAL "1400") |
15 | | SET(ILOG_WIN_COMPILER "windows_vs2005") |
16 | | ELSEIF(MSVC_VERSION STREQUAL "1500") |
17 | | SET(ILOG_WIN_COMPILER "windows_vs2008") |
18 | | ELSEIF(MSVC_VERSION STREQUAL "1600") |
19 | | SET(ILOG_WIN_COMPILER "windows_vs2010") |
20 | | ELSE() |
21 | | SET(ILOG_WIN_COMPILER "windows_vs2008") |
22 | | ENDIF() |
23 | | IF(CMAKE_CL_64) |
24 | | SET(ILOG_WIN_COMPILER "x64_${ILOG_WIN_COMPILER}") |
25 | | SET(ILOG_WIN_PLATFORM "x64_win32") |
26 | | ELSE() |
27 | | SET(ILOG_WIN_COMPILER "x86_${ILOG_WIN_COMPILER}") |
28 | | SET(ILOG_WIN_PLATFORM "x86_win32") |
29 | | ENDIF() |
30 | | ENDIF() |
| 13 | if(WIN32) |
| 14 | if(MSVC_VERSION STREQUAL "1400") |
| 15 | set(ILOG_WIN_COMPILER "windows_vs2005") |
| 16 | elseif(MSVC_VERSION STREQUAL "1500") |
| 17 | set(ILOG_WIN_COMPILER "windows_vs2008") |
| 18 | elseif(MSVC_VERSION STREQUAL "1600") |
| 19 | set(ILOG_WIN_COMPILER "windows_vs2010") |
| 20 | else() |
| 21 | set(ILOG_WIN_COMPILER "windows_vs2008") |
| 22 | endif() |
| 23 | if(CMAKE_CL_64) |
| 24 | set(ILOG_WIN_COMPILER "x64_${ILOG_WIN_COMPILER}") |
| 25 | set(ILOG_WIN_PLATFORM "x64_win32") |
| 26 | else() |
| 27 | set(ILOG_WIN_COMPILER "x86_${ILOG_WIN_COMPILER}") |
| 28 | set(ILOG_WIN_PLATFORM "x86_win32") |
| 29 | endif() |
| 30 | endif() |
31 | 31 | |
32 | | FIND_PATH(ILOG_CPLEX_ROOT_DIR |
| 32 | find_path(ILOG_CPLEX_ROOT_DIR |
33 | 33 | NAMES include/ilcplex |
34 | 34 | HINTS ${ILOG_ROOT_DIR}/cplex ${ILOG_ROOT_DIR}/cplex121 |
35 | 35 | ${ILOG_ROOT_DIR}/cplex122 ${ILOG_ROOT_DIR}/cplex123 |
… |
… |
|
37 | 37 | NO_DEFAULT_PATH |
38 | 38 | ) |
39 | 39 | |
40 | | FIND_PATH(ILOG_CONCERT_ROOT_DIR |
| 40 | find_path(ILOG_CONCERT_ROOT_DIR |
41 | 41 | NAMES include/ilconcert |
42 | 42 | HINTS ${ILOG_ROOT_DIR}/concert ${ILOG_ROOT_DIR}/concert29 |
43 | 43 | DOC "CONCERT root directory" |
44 | 44 | NO_DEFAULT_PATH |
45 | 45 | ) |
46 | 46 | |
47 | | FIND_PATH(ILOG_CPLEX_INCLUDE_DIR |
| 47 | find_path(ILOG_CPLEX_INCLUDE_DIR |
48 | 48 | ilcplex/cplex.h |
49 | 49 | HINTS ${ILOG_CPLEX_ROOT_DIR}/include |
50 | 50 | NO_DEFAULT_PATH |
51 | 51 | ) |
52 | 52 | |
53 | | FIND_PATH(ILOG_CONCERT_INCLUDE_DIR |
| 53 | find_path(ILOG_CONCERT_INCLUDE_DIR |
54 | 54 | ilconcert/ilobasic.h |
55 | 55 | HINTS ${ILOG_CONCERT_ROOT_DIR}/include |
56 | 56 | NO_DEFAULT_PATH |
57 | 57 | ) |
58 | 58 | |
59 | | FIND_LIBRARY(ILOG_CPLEX_LIBRARY |
| 59 | find_library(ILOG_CPLEX_LIBRARY |
60 | 60 | cplex cplex121 cplex122 cplex123 cplex124 |
61 | 61 | HINTS ${ILOG_CPLEX_ROOT_DIR}/lib/x86_sles10_4.1/static_pic |
62 | 62 | ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_sles10_4.1/static_pic |
… |
… |
|
68 | 68 | NO_DEFAULT_PATH |
69 | 69 | ) |
70 | 70 | |
71 | | FIND_LIBRARY(ILOG_CONCERT_LIBRARY |
| 71 | find_library(ILOG_CONCERT_LIBRARY |
72 | 72 | concert |
73 | 73 | HINTS ${ILOG_CONCERT_ROOT_DIR}/lib/x86_sles10_4.1/static_pic |
74 | 74 | ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_sles10_4.1/static_pic |
… |
… |
|
80 | 80 | NO_DEFAULT_PATH |
81 | 81 | ) |
82 | 82 | |
83 | | FIND_FILE(ILOG_CPLEX_DLL |
| 83 | find_file(ILOG_CPLEX_DLL |
84 | 84 | cplex121.dll cplex122.dll cplex123.dll cplex124.dll |
85 | 85 | HINTS ${ILOG_CPLEX_ROOT_DIR}/bin/${ILOG_WIN_PLATFORM} |
86 | 86 | NO_DEFAULT_PATH |
87 | 87 | ) |
88 | 88 | |
89 | | INCLUDE(FindPackageHandleStandardArgs) |
| 89 | include(FindPackageHandleStandardArgs) |
90 | 90 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(ILOG |
91 | 91 | DEFAULT_MSG ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR |
92 | 92 | ) |
93 | 93 | |
94 | | IF(ILOG_FOUND) |
95 | | SET(ILOG_INCLUDE_DIRS ${ILOG_CPLEX_INCLUDE_DIR} ${ILOG_CONCERT_INCLUDE_DIR}) |
96 | | SET(ILOG_LIBRARIES ${ILOG_CPLEX_LIBRARY} ${ILOG_CONCERT_LIBRARY}) |
97 | | IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
98 | | # SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread") |
99 | | SET(ILOG_LIBRARIES ${ILOG_LIBRARIES} "m" "pthread" "dl") |
100 | | ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
101 | | ENDIF(ILOG_FOUND) |
| 94 | if(ILOG_FOUND) |
| 95 | set(ILOG_INCLUDE_DIRS ${ILOG_CPLEX_INCLUDE_DIR} ${ILOG_CONCERT_INCLUDE_DIR}) |
| 96 | set(ILOG_LIBRARIES ${ILOG_CPLEX_LIBRARY} ${ILOG_CONCERT_LIBRARY}) |
| 97 | if(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
| 98 | # set(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread") |
| 99 | set(ILOG_LIBRARIES ${ILOG_LIBRARIES} "m" "pthread" "dl") |
| 100 | endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
| 101 | endif(ILOG_FOUND) |
102 | 102 | |
103 | | MARK_AS_ADVANCED( |
| 103 | mark_as_advanced( |
104 | 104 | ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR ILOG_CPLEX_DLL |
105 | 105 | ILOG_CONCERT_LIBRARY ILOG_CONCERT_INCLUDE_DIR ILOG_CONCERT_DLL |
106 | 106 | ) |
diff --git a/cmake/FindSOPLEX.cmake b/cmake/FindSOPLEX.cmake
a
|
b
|
|
1 | | SET(SOPLEX_ROOT_DIR "" CACHE PATH "SoPlex root directory") |
| 1 | set(SOPLEX_ROOT_DIR "" CACHE PATH "SoPlex root directory") |
2 | 2 | |
3 | | FIND_PATH(SOPLEX_INCLUDE_DIR |
| 3 | find_path(SOPLEX_INCLUDE_DIR |
4 | 4 | soplex.h |
5 | 5 | HINTS ${SOPLEX_ROOT_DIR}/src |
6 | 6 | ) |
7 | | FIND_LIBRARY(SOPLEX_LIBRARY |
| 7 | find_library(SOPLEX_LIBRARY |
8 | 8 | soplex |
9 | 9 | HINTS ${SOPLEX_ROOT_DIR}/lib |
10 | 10 | ) |
11 | 11 | |
12 | | INCLUDE(FindPackageHandleStandardArgs) |
| 12 | include(FindPackageHandleStandardArgs) |
13 | 13 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(SOPLEX DEFAULT_MSG SOPLEX_LIBRARY SOPLEX_INCLUDE_DIR) |
14 | 14 | |
15 | | IF(SOPLEX_FOUND) |
16 | | SET(SOPLEX_INCLUDE_DIRS ${SOPLEX_INCLUDE_DIR}) |
17 | | SET(SOPLEX_LIBRARIES ${SOPLEX_LIBRARY}) |
18 | | IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
19 | | SET(SOPLEX_LIBRARIES "${SOPLEX_LIBRARIES};z") |
20 | | ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
21 | | ENDIF(SOPLEX_FOUND) |
| 15 | if(SOPLEX_FOUND) |
| 16 | set(SOPLEX_INCLUDE_DIRS ${SOPLEX_INCLUDE_DIR}) |
| 17 | set(SOPLEX_LIBRARIES ${SOPLEX_LIBRARY}) |
| 18 | if(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
| 19 | set(SOPLEX_LIBRARIES "${SOPLEX_LIBRARIES};z") |
| 20 | endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
| 21 | endif(SOPLEX_FOUND) |
22 | 22 | |
23 | | MARK_AS_ADVANCED(SOPLEX_LIBRARY SOPLEX_INCLUDE_DIR) |
| 23 | mark_as_advanced(SOPLEX_LIBRARY SOPLEX_INCLUDE_DIR) |
diff --git a/cmake/LEMONConfig.cmake.in b/cmake/LEMONConfig.cmake.in
a
|
b
|
|
1 | | SET(LEMON_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include" CACHE PATH "LEMON include directory") |
2 | | SET(LEMON_INCLUDE_DIRS "${LEMON_INCLUDE_DIR}") |
| 1 | set(LEMON_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include" CACHE PATH "LEMON include directory") |
| 2 | set(LEMON_INCLUDE_DIRS "${LEMON_INCLUDE_DIR}") |
3 | 3 | |
4 | | IF(UNIX) |
5 | | SET(LEMON_LIB_NAME "libemon.a") |
6 | | ELSEIF(WIN32) |
7 | | SET(LEMON_LIB_NAME "lemon.lib") |
8 | | ENDIF(UNIX) |
| 4 | if(UNIX) |
| 5 | set(LEMON_LIB_NAME "libemon.a") |
| 6 | elseif(WIN32) |
| 7 | set(LEMON_LIB_NAME "lemon.lib") |
| 8 | endif(UNIX) |
9 | 9 | |
10 | | SET(LEMON_LIBRARY "@CMAKE_INSTALL_PREFIX@/lib/${LEMON_LIB_NAME}" CACHE FILEPATH "LEMON library") |
11 | | SET(LEMON_LIBRARIES "${LEMON_LIBRARY}") |
| 10 | set(LEMON_LIBRARY "@CMAKE_INSTALL_PREFIX@/lib/${LEMON_LIB_NAME}" CACHE FILEPATH "LEMON library") |
| 11 | set(LEMON_LIBRARIES "${LEMON_LIBRARY}") |
12 | 12 | |
13 | | MARK_AS_ADVANCED(LEMON_LIBRARY LEMON_INCLUDE_DIR) |
| 13 | mark_as_advanced(LEMON_LIBRARY LEMON_INCLUDE_DIR) |
diff --git a/cmake/version.cmake.in b/cmake/version.cmake.in
a
|
b
|
|
1 | | SET(LEMON_VERSION "@LEMON_VERSION@" CACHE STRING "LEMON version string.") |
| 1 | set(LEMON_VERSION "@LEMON_VERSION@" CACHE STRING "LEMON version string.") |
diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
a
|
b
|
|
1 | | INCLUDE_DIRECTORIES( |
| 1 | include_directories( |
2 | 2 | ${PROJECT_SOURCE_DIR} |
3 | 3 | ${PROJECT_BINARY_DIR} |
4 | 4 | ) |
5 | 5 | |
6 | | LINK_DIRECTORIES( |
| 6 | link_directories( |
7 | 7 | ${PROJECT_BINARY_DIR}/lemon |
8 | 8 | ) |
9 | 9 | |
… |
… |
|
14 | 14 | # whitespaces. Moreover, you can add multiple similar blocks if you |
15 | 15 | # want to build more than one executables. |
16 | 16 | |
17 | | # ADD_EXECUTABLE(myprog myprog-main.cc) |
18 | | # TARGET_LINK_LIBRARIES(myprog lemon) |
| 17 | # add_executable(myprog myprog-main.cc) |
| 18 | # target_link_libraries(myprog lemon) |
19 | 19 | |
diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt
a
|
b
|
|
1 | | INCLUDE_DIRECTORIES( |
| 1 | include_directories( |
2 | 2 | ${PROJECT_SOURCE_DIR} |
3 | 3 | ${PROJECT_BINARY_DIR} |
4 | 4 | ) |
5 | 5 | |
6 | | LINK_DIRECTORIES( |
| 6 | link_directories( |
7 | 7 | ${PROJECT_BINARY_DIR}/lemon |
8 | 8 | ) |
9 | 9 | |
10 | | SET(DEMOS |
| 10 | set(DEMOS |
11 | 11 | arg_parser_demo |
12 | 12 | graph_to_eps_demo |
13 | 13 | lgf_demo |
14 | 14 | ) |
15 | 15 | |
16 | | FOREACH(DEMO_NAME ${DEMOS}) |
17 | | ADD_EXECUTABLE(${DEMO_NAME} ${DEMO_NAME}.cc) |
18 | | TARGET_LINK_LIBRARIES(${DEMO_NAME} lemon) |
19 | | ENDFOREACH() |
| 16 | foreach(DEMO_NAME ${DEMOS}) |
| 17 | add_executable(${DEMO_NAME} ${DEMO_NAME}.cc) |
| 18 | target_link_libraries(${DEMO_NAME} lemon) |
| 19 | endforeach() |
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
a
|
b
|
|
1 | | SET(PACKAGE_NAME ${PROJECT_NAME}) |
2 | | SET(PACKAGE_VERSION ${PROJECT_VERSION}) |
3 | | SET(abs_top_srcdir ${PROJECT_SOURCE_DIR}) |
4 | | SET(abs_top_builddir ${PROJECT_BINARY_DIR}) |
| 1 | set(PACKAGE_NAME ${PROJECT_NAME}) |
| 2 | set(PACKAGE_VERSION ${PROJECT_VERSION}) |
| 3 | set(abs_top_srcdir ${PROJECT_SOURCE_DIR}) |
| 4 | set(abs_top_builddir ${PROJECT_BINARY_DIR}) |
5 | 5 | |
6 | | SET(LEMON_DOC_SOURCE_BROWSER "NO" CACHE STRING "Include source into the doc (YES/NO).") |
7 | | SET(LEMON_DOC_USE_MATHJAX "NO" CACHE STRING "Use MathJax to display math formulae (YES/NO).") |
8 | | SET(LEMON_DOC_MATHJAX_RELPATH "http://www.mathjax.org/mathjax" CACHE STRING "MathJax library location.") |
| 6 | set(LEMON_DOC_SOURCE_BROWSER "NO" CACHE STRING "Include source into the doc (YES/NO).") |
| 7 | set(LEMON_DOC_USE_MATHJAX "NO" CACHE STRING "Use MathJax to display math formulae (YES/NO).") |
| 8 | set(LEMON_DOC_MATHJAX_RELPATH "http://www.mathjax.org/mathjax" CACHE STRING "MathJax library location.") |
9 | 9 | |
10 | | SET(LEMON_DOC_LIBSTDC++_URL |
| 10 | set(LEMON_DOC_LIBSTDC++_URL |
11 | 11 | "http://gcc.gnu.org/onlinedocs/gcc-4.7.3/libstdc++/api" |
12 | 12 | CACHE STRING "GCC libstdc++ doxygen doc url.") |
13 | 13 | |
14 | 14 | |
15 | | CONFIGURE_FILE( |
| 15 | configure_file( |
16 | 16 | ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in |
17 | 17 | ${PROJECT_BINARY_DIR}/doc/Doxyfile |
18 | 18 | @ONLY |
19 | 19 | ) |
20 | 20 | |
21 | | CONFIGURE_FILE( |
| 21 | configure_file( |
22 | 22 | ${PROJECT_SOURCE_DIR}/doc/mainpage.dox.in |
23 | 23 | ${PROJECT_BINARY_DIR}/doc/mainpage.dox |
24 | 24 | @ONLY |
25 | 25 | ) |
26 | 26 | |
27 | 27 | # Copy doc from source (if exists) |
28 | | IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/html AND |
| 28 | if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/html AND |
29 | 29 | NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/html/index.html) |
30 | | MESSAGE(STATUS "Copy doc from source tree") |
31 | | EXECUTE_PROCESS( |
| 30 | message(STATUS "Copy doc from source tree") |
| 31 | execute_process( |
32 | 32 | COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/html ${CMAKE_CURRENT_BINARY_DIR}/html |
33 | 33 | ) |
34 | | ENDIF() |
| 34 | endif() |
35 | 35 | |
36 | | IF(DOXYGEN_EXECUTABLE AND PYTHONINTERP_FOUND AND GHOSTSCRIPT_EXECUTABLE) |
37 | | FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/) |
38 | | SET(GHOSTSCRIPT_OPTIONS -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha) |
39 | | ADD_CUSTOM_TARGET(html |
| 36 | if(DOXYGEN_EXECUTABLE AND PYTHONINTERP_FOUND AND GHOSTSCRIPT_EXECUTABLE) |
| 37 | file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/) |
| 38 | set(GHOSTSCRIPT_OPTIONS -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha) |
| 39 | add_custom_target(html |
40 | 40 | COMMAND ${CMAKE_COMMAND} -E remove_directory gen-images |
41 | 41 | COMMAND ${CMAKE_COMMAND} -E make_directory gen-images |
42 | 42 | COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r20 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps |
… |
… |
|
60 | 60 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} |
61 | 61 | ) |
62 | 62 | |
63 | | SET_TARGET_PROPERTIES(html PROPERTIES PROJECT_LABEL BUILD_DOC) |
| 63 | set_target_properties(html PROPERTIES PROJECT_LABEL BUILD_DOC) |
64 | 64 | |
65 | | IF(UNIX) |
66 | | INSTALL( |
| 65 | if(UNIX) |
| 66 | install( |
67 | 67 | DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ |
68 | 68 | DESTINATION share/doc/lemon/html |
69 | 69 | COMPONENT html_documentation |
70 | 70 | ) |
71 | | ELSEIF(WIN32) |
72 | | INSTALL( |
| 71 | elseif(WIN32) |
| 72 | install( |
73 | 73 | DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ |
74 | 74 | DESTINATION doc |
75 | 75 | COMPONENT html_documentation |
76 | 76 | ) |
77 | | ENDIF() |
| 77 | endif() |
78 | 78 | |
79 | | ENDIF() |
| 79 | endif() |
80 | 80 | |
81 | | IF(WGET_FOUND) |
82 | | ADD_CUSTOM_TARGET(update-external-tags |
| 81 | if(WGET_FOUND) |
| 82 | add_custom_target(update-external-tags |
83 | 83 | COMMAND ${WGET_EXECUTABLE} -N ${LEMON_DOC_LIBSTDC++_URL}/libstdc++.tag |
84 | 84 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} |
85 | 85 | ) |
86 | | ENDIF() |
| 86 | endif() |
diff --git a/lemon/CMakeLists.txt b/lemon/CMakeLists.txt
a
|
b
|
|
1 | | INCLUDE_DIRECTORIES( |
| 1 | include_directories( |
2 | 2 | ${PROJECT_SOURCE_DIR} |
3 | 3 | ${PROJECT_BINARY_DIR} |
4 | 4 | ) |
5 | 5 | |
6 | | CONFIGURE_FILE( |
| 6 | configure_file( |
7 | 7 | ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in |
8 | 8 | ${CMAKE_CURRENT_BINARY_DIR}/config.h |
9 | 9 | ) |
10 | 10 | |
11 | | CONFIGURE_FILE( |
| 11 | configure_file( |
12 | 12 | ${CMAKE_CURRENT_SOURCE_DIR}/lemon.pc.in |
13 | 13 | ${CMAKE_CURRENT_BINARY_DIR}/lemon.pc |
14 | 14 | @ONLY |
15 | 15 | ) |
16 | 16 | |
17 | | SET(LEMON_SOURCES |
| 17 | set(LEMON_SOURCES |
18 | 18 | arg_parser.cc |
19 | 19 | base.cc |
20 | 20 | color.cc |
… |
… |
|
24 | 24 | bits/windows.cc |
25 | 25 | ) |
26 | 26 | |
27 | | IF(LEMON_HAVE_GLPK) |
28 | | SET(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc) |
29 | | INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIRS}) |
30 | | IF(WIN32) |
31 | | INSTALL(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin) |
32 | | INSTALL(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin) |
33 | | INSTALL(FILES ${GLPK_BIN_DIR}/zlib1.dll DESTINATION bin) |
34 | | ENDIF() |
35 | | ENDIF() |
| 27 | if(LEMON_HAVE_GLPK) |
| 28 | set(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc) |
| 29 | include_directories(${GLPK_INCLUDE_DIRS}) |
| 30 | if(WIN32) |
| 31 | install(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin) |
| 32 | install(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin) |
| 33 | install(FILES ${GLPK_BIN_DIR}/zlib1.dll DESTINATION bin) |
| 34 | endif() |
| 35 | endif() |
36 | 36 | |
37 | | IF(LEMON_HAVE_CPLEX) |
38 | | SET(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc) |
39 | | INCLUDE_DIRECTORIES(${ILOG_INCLUDE_DIRS}) |
40 | | ENDIF() |
| 37 | if(LEMON_HAVE_CPLEX) |
| 38 | set(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc) |
| 39 | include_directories(${ILOG_INCLUDE_DIRS}) |
| 40 | endif() |
41 | 41 | |
42 | | IF(LEMON_HAVE_CLP) |
43 | | SET(LEMON_SOURCES ${LEMON_SOURCES} clp.cc) |
44 | | INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS}) |
45 | | ENDIF() |
| 42 | if(LEMON_HAVE_CLP) |
| 43 | set(LEMON_SOURCES ${LEMON_SOURCES} clp.cc) |
| 44 | include_directories(${COIN_INCLUDE_DIRS}) |
| 45 | endif() |
46 | 46 | |
47 | | IF(LEMON_HAVE_CBC) |
48 | | SET(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc) |
49 | | INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS}) |
50 | | ENDIF() |
| 47 | if(LEMON_HAVE_CBC) |
| 48 | set(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc) |
| 49 | include_directories(${COIN_INCLUDE_DIRS}) |
| 50 | endif() |
51 | 51 | |
52 | | IF(LEMON_HAVE_SOPLEX) |
53 | | SET(LEMON_SOURCES ${LEMON_SOURCES} soplex.cc) |
54 | | INCLUDE_DIRECTORIES(${SOPLEX_INCLUDE_DIRS}) |
55 | | ENDIF() |
| 52 | if(LEMON_HAVE_SOPLEX) |
| 53 | set(LEMON_SOURCES ${LEMON_SOURCES} soplex.cc) |
| 54 | include_directories(${SOPLEX_INCLUDE_DIRS}) |
| 55 | endif() |
56 | 56 | |
57 | | ADD_LIBRARY(lemon ${LEMON_SOURCES}) |
| 57 | add_library(lemon ${LEMON_SOURCES}) |
58 | 58 | |
59 | | TARGET_LINK_LIBRARIES(lemon |
| 59 | target_link_libraries(lemon |
60 | 60 | ${GLPK_LIBRARIES} ${COIN_LIBRARIES} ${ILOG_LIBRARIES} ${SOPLEX_LIBRARIES} |
61 | 61 | ) |
62 | 62 | |
63 | | IF(UNIX) |
64 | | SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon VERSION ${LEMON_VERSION} SOVERSION ${LEMON_VERSION}) |
65 | | ENDIF() |
| 63 | if(UNIX) |
| 64 | set_target_properties(lemon PROPERTIES OUTPUT_NAME emon VERSION ${LEMON_VERSION} SOVERSION ${LEMON_VERSION}) |
| 65 | endif() |
66 | 66 | |
67 | | INSTALL( |
| 67 | install( |
68 | 68 | TARGETS lemon |
69 | 69 | ARCHIVE DESTINATION lib |
70 | 70 | LIBRARY DESTINATION lib |
71 | 71 | COMPONENT library |
72 | 72 | ) |
73 | 73 | |
74 | | INSTALL( |
| 74 | install( |
75 | 75 | DIRECTORY . bits concepts |
76 | 76 | DESTINATION include/lemon |
77 | 77 | COMPONENT headers |
78 | 78 | FILES_MATCHING PATTERN "*.h" |
79 | 79 | ) |
80 | 80 | |
81 | | INSTALL( |
| 81 | install( |
82 | 82 | FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h |
83 | 83 | DESTINATION include/lemon |
84 | 84 | COMPONENT headers |
85 | 85 | ) |
86 | 86 | |
87 | | INSTALL( |
| 87 | install( |
88 | 88 | FILES ${CMAKE_CURRENT_BINARY_DIR}/lemon.pc |
89 | 89 | DESTINATION lib/pkgconfig |
90 | 90 | ) |
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
a
|
b
|
|
1 | | INCLUDE_DIRECTORIES( |
| 1 | include_directories( |
2 | 2 | ${PROJECT_SOURCE_DIR} |
3 | 3 | ${PROJECT_BINARY_DIR} |
4 | 4 | ) |
5 | 5 | |
6 | | LINK_DIRECTORIES( |
| 6 | link_directories( |
7 | 7 | ${PROJECT_BINARY_DIR}/lemon |
8 | 8 | ) |
9 | 9 | |
10 | | SET(TEST_WITH_VALGRIND "NO" CACHE STRING |
| 10 | set(TEST_WITH_VALGRIND "NO" CACHE STRING |
11 | 11 | "Run the test with valgrind (YES/NO).") |
12 | | SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.") |
| 12 | set(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.") |
13 | 13 | |
14 | | SET(TESTS |
| 14 | set(TESTS |
15 | 15 | adaptors_test |
16 | 16 | arc_look_up_test |
17 | 17 | bellman_ford_test |
… |
… |
|
57 | 57 | vf2_test |
58 | 58 | ) |
59 | 59 | |
60 | | IF(LEMON_HAVE_LP) |
61 | | IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
62 | | ADD_EXECUTABLE(lp_test lp_test.cc) |
63 | | ELSE() |
64 | | ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc) |
65 | | ENDIF() |
| 60 | if(LEMON_HAVE_LP) |
| 61 | if(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
| 62 | add_executable(lp_test lp_test.cc) |
| 63 | else() |
| 64 | add_executable(lp_test EXCLUDE_FROM_ALL lp_test.cc) |
| 65 | endif() |
66 | 66 | |
67 | | SET(LP_TEST_LIBS lemon) |
| 67 | set(LP_TEST_LIBS lemon) |
68 | 68 | |
69 | | IF(LEMON_HAVE_GLPK) |
70 | | SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES}) |
71 | | ENDIF() |
72 | | IF(LEMON_HAVE_CPLEX) |
73 | | SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${ILOG_LIBRARIES}) |
74 | | ENDIF() |
75 | | IF(LEMON_HAVE_CLP) |
76 | | SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES}) |
77 | | ENDIF() |
78 | | IF(LEMON_HAVE_SOPLEX) |
79 | | SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${SOPLEX_LIBRARIES}) |
80 | | ENDIF() |
| 69 | if(LEMON_HAVE_GLPK) |
| 70 | set(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES}) |
| 71 | endif() |
| 72 | if(LEMON_HAVE_CPLEX) |
| 73 | set(LP_TEST_LIBS ${LP_TEST_LIBS} ${ILOG_LIBRARIES}) |
| 74 | endif() |
| 75 | if(LEMON_HAVE_CLP) |
| 76 | set(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES}) |
| 77 | endif() |
| 78 | if(LEMON_HAVE_SOPLEX) |
| 79 | set(LP_TEST_LIBS ${LP_TEST_LIBS} ${SOPLEX_LIBRARIES}) |
| 80 | endif() |
81 | 81 | |
82 | | TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS}) |
83 | | ADD_TEST(lp_test lp_test) |
84 | | ADD_DEPENDENCIES(check lp_test) |
| 82 | target_link_libraries(lp_test ${LP_TEST_LIBS}) |
| 83 | add_test(lp_test lp_test) |
| 84 | add_dependencies(check lp_test) |
85 | 85 | |
86 | | IF(WIN32 AND LEMON_HAVE_GLPK) |
87 | | ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD |
| 86 | if(WIN32 AND LEMON_HAVE_GLPK) |
| 87 | add_custom_command(TARGET lp_test POST_BUILD |
88 | 88 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll $<TARGET_FILE_DIR:lp_test> |
89 | 89 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll $<TARGET_FILE_DIR:lp_test> |
90 | 90 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll $<TARGET_FILE_DIR:lp_test> |
91 | 91 | ) |
92 | | ENDIF() |
| 92 | endif() |
93 | 93 | |
94 | | IF(WIN32 AND LEMON_HAVE_CPLEX) |
95 | | GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) |
96 | | GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) |
97 | | ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD |
| 94 | if(WIN32 AND LEMON_HAVE_CPLEX) |
| 95 | get_target_property(TARGET_LOC lp_test LOCATION) |
| 96 | get_filename_component(TARGET_PATH ${TARGET_LOC} PATH) |
| 97 | add_custom_command(TARGET lp_test POST_BUILD |
98 | 98 | COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH} |
99 | 99 | ) |
100 | | ENDIF() |
101 | | ENDIF() |
| 100 | endif() |
| 101 | endif() |
102 | 102 | |
103 | | IF(LEMON_HAVE_MIP) |
104 | | IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
105 | | ADD_EXECUTABLE(mip_test mip_test.cc) |
106 | | ELSE() |
107 | | ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc) |
108 | | ENDIF() |
| 103 | if(LEMON_HAVE_MIP) |
| 104 | if(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
| 105 | add_executable(mip_test mip_test.cc) |
| 106 | else() |
| 107 | add_executable(mip_test EXCLUDE_FROM_ALL mip_test.cc) |
| 108 | endif() |
109 | 109 | |
110 | | SET(MIP_TEST_LIBS lemon) |
| 110 | set(MIP_TEST_LIBS lemon) |
111 | 111 | |
112 | | IF(LEMON_HAVE_GLPK) |
113 | | SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES}) |
114 | | ENDIF() |
115 | | IF(LEMON_HAVE_CPLEX) |
116 | | SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${ILOG_LIBRARIES}) |
117 | | ENDIF() |
118 | | IF(LEMON_HAVE_CBC) |
119 | | SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES}) |
120 | | ENDIF() |
| 112 | if(LEMON_HAVE_GLPK) |
| 113 | set(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES}) |
| 114 | endif() |
| 115 | if(LEMON_HAVE_CPLEX) |
| 116 | set(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${ILOG_LIBRARIES}) |
| 117 | endif() |
| 118 | if(LEMON_HAVE_CBC) |
| 119 | set(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES}) |
| 120 | endif() |
121 | 121 | |
122 | | TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS}) |
123 | | ADD_TEST(mip_test mip_test) |
124 | | ADD_DEPENDENCIES(check mip_test) |
| 122 | target_link_libraries(mip_test ${MIP_TEST_LIBS}) |
| 123 | add_test(mip_test mip_test) |
| 124 | add_dependencies(check mip_test) |
125 | 125 | |
126 | | IF(WIN32 AND LEMON_HAVE_GLPK) |
127 | | GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) |
128 | | GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) |
129 | | ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD |
| 126 | if(WIN32 AND LEMON_HAVE_GLPK) |
| 127 | get_target_property(TARGET_LOC mip_test LOCATION) |
| 128 | get_filename_component(TARGET_PATH ${TARGET_LOC} PATH) |
| 129 | add_custom_command(TARGET mip_test POST_BUILD |
130 | 130 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} |
131 | 131 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} |
132 | 132 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} |
133 | 133 | ) |
134 | | ENDIF() |
| 134 | endif() |
135 | 135 | |
136 | | IF(WIN32 AND LEMON_HAVE_CPLEX) |
137 | | GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) |
138 | | GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) |
139 | | ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD |
| 136 | if(WIN32 AND LEMON_HAVE_CPLEX) |
| 137 | get_target_property(TARGET_LOC mip_test LOCATION) |
| 138 | get_filename_component(TARGET_PATH ${TARGET_LOC} PATH) |
| 139 | add_custom_command(TARGET mip_test POST_BUILD |
140 | 140 | COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH} |
141 | 141 | ) |
142 | | ENDIF() |
143 | | ENDIF() |
| 142 | endif() |
| 143 | endif() |
144 | 144 | |
145 | | FOREACH(TEST_NAME ${TESTS}) |
146 | | IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
147 | | ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc) |
148 | | ELSE() |
149 | | ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc) |
150 | | ENDIF() |
151 | | TARGET_LINK_LIBRARIES(${TEST_NAME} lemon) |
152 | | IF(TEST_WITH_VALGRIND) |
153 | | ADD_TEST(${TEST_NAME} |
| 145 | foreach(TEST_NAME ${TESTS}) |
| 146 | if(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
| 147 | add_executable(${TEST_NAME} ${TEST_NAME}.cc) |
| 148 | else() |
| 149 | add_executable(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc) |
| 150 | endif() |
| 151 | target_link_libraries(${TEST_NAME} lemon) |
| 152 | if(TEST_WITH_VALGRIND) |
| 153 | add_test(${TEST_NAME} |
154 | 154 | valgrind --error-exitcode=1 ${VALGRIND_FLAGS} |
155 | 155 | ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} ) |
156 | | ELSE() |
157 | | ADD_TEST(${TEST_NAME} ${TEST_NAME}) |
158 | | ENDIF() |
159 | | ADD_DEPENDENCIES(check ${TEST_NAME}) |
160 | | ENDFOREACH() |
| 156 | else() |
| 157 | add_test(${TEST_NAME} ${TEST_NAME}) |
| 158 | endif() |
| 159 | add_dependencies(check ${TEST_NAME}) |
| 160 | endforeach() |
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
a
|
b
|
|
1 | | INCLUDE_DIRECTORIES( |
| 1 | include_directories( |
2 | 2 | ${PROJECT_SOURCE_DIR} |
3 | 3 | ${PROJECT_BINARY_DIR} |
4 | 4 | ) |
5 | 5 | |
6 | | LINK_DIRECTORIES( |
| 6 | link_directories( |
7 | 7 | ${PROJECT_BINARY_DIR}/lemon |
8 | 8 | ) |
9 | 9 | |
10 | | ADD_EXECUTABLE(lgf-gen lgf-gen.cc) |
11 | | TARGET_LINK_LIBRARIES(lgf-gen lemon) |
| 10 | add_executable(lgf-gen lgf-gen.cc) |
| 11 | target_link_libraries(lgf-gen lemon) |
12 | 12 | |
13 | | ADD_EXECUTABLE(dimacs-to-lgf dimacs-to-lgf.cc) |
14 | | TARGET_LINK_LIBRARIES(dimacs-to-lgf lemon) |
| 13 | add_executable(dimacs-to-lgf dimacs-to-lgf.cc) |
| 14 | target_link_libraries(dimacs-to-lgf lemon) |
15 | 15 | |
16 | | ADD_EXECUTABLE(dimacs-solver dimacs-solver.cc) |
17 | | TARGET_LINK_LIBRARIES(dimacs-solver lemon) |
| 16 | add_executable(dimacs-solver dimacs-solver.cc) |
| 17 | target_link_libraries(dimacs-solver lemon) |
18 | 18 | |
19 | | INSTALL( |
| 19 | install( |
20 | 20 | TARGETS lgf-gen dimacs-to-lgf dimacs-solver |
21 | 21 | RUNTIME DESTINATION bin |
22 | 22 | COMPONENT bin |
23 | 23 | ) |
24 | 24 | |
25 | | IF(NOT WIN32) |
26 | | INSTALL( |
| 25 | if(NOT WIN32) |
| 26 | install( |
27 | 27 | PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/lemon-0.x-to-1.x.sh |
28 | 28 | DESTINATION bin |
29 | 29 | COMPONENT bin |
30 | 30 | ) |
31 | | ENDIF() |
| 31 | endif() |