# HG changeset patch
# User Alpar Juttner <alpar@cs.elte.hu>
# Date 1611214613 -3600
# Thu Jan 21 08:36:53 2021 +0100
# Node ID 736a341e604b983e4ae9f4f47120fad0bef131c7
# Parent 8c567e298d7f3fad82cc66754f2fb6c4a420366b
Update CMakeLists.txt to match current CMAKE versions (#641)
diff --git a/CMakeLists.txt b/CMakeLists.txt
a
|
b
|
|
5 | 5 | ENDIF(POLICY CMP0048) |
6 | 6 | |
7 | 7 | IF(POLICY CMP0043) |
8 | | CMAKE_POLICY(SET CMP0043 OLD) |
| 8 | CMAKE_POLICY(SET CMP0043 NEW) |
9 | 9 | ENDIF(POLICY CMP0043) |
10 | 10 | |
11 | 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 OLD) |
| 13 | CMAKE_POLICY(SET CMP0026 NEW) |
14 | 14 | ENDIF(POLICY CMP0026) |
15 | 15 | |
16 | 16 | SET(PROJECT_NAME "LEMON") |
… |
… |
|
196 | 196 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LEMON_CXX_WARNING_FLAGS}") |
197 | 197 | |
198 | 198 | IF(MSVC) |
199 | | SET(CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}") |
| 199 | SET( CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}") |
200 | 200 | SET( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING |
201 | | "Flags used by the C++ compiler during maintainer builds." |
| 201 | "Flags used by the C++ compiler during maintainer builds." FORCE |
202 | 202 | ) |
203 | 203 | SET( CMAKE_C_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING |
204 | | "Flags used by the C compiler during maintainer builds." |
| 204 | "Flags used by the C compiler during maintainer builds." FORCE |
205 | 205 | ) |
206 | 206 | SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER |
207 | 207 | "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING |
208 | | "Flags used for linking binaries during maintainer builds." |
| 208 | "Flags used for linking binaries during maintainer builds." FORCE |
209 | 209 | ) |
210 | 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 | FORCE |
213 | 214 | ) |
214 | 215 | ELSE() |
215 | 216 | SET( CMAKE_CXX_FLAGS_MAINTAINER "-Werror -ggdb -O0" CACHE STRING |
216 | | "Flags used by the C++ compiler during maintainer builds." |
| 217 | "Flags used by the C++ compiler during maintainer builds." FORCE |
217 | 218 | ) |
218 | 219 | SET( CMAKE_C_FLAGS_MAINTAINER "-Werror -O0" CACHE STRING |
219 | | "Flags used by the C compiler during maintainer builds." |
| 220 | "Flags used by the C compiler during maintainer builds." FORCE |
220 | 221 | ) |
221 | 222 | SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER |
222 | 223 | "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING |
223 | | "Flags used for linking binaries during maintainer builds." |
| 224 | "Flags used for linking binaries during maintainer builds." FORCE |
224 | 225 | ) |
225 | 226 | SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER |
226 | 227 | "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING |
227 | | "Flags used by the shared libraries linker during maintainer builds." |
228 | | ) |
| 228 | "Flags used by the shared libraries linker during maintainer builds." FORCE) |
229 | 229 | ENDIF() |
230 | 230 | |
231 | 231 | MARK_AS_ADVANCED( |
… |
… |
|
251 | 251 | FORCE ) |
252 | 252 | |
253 | 253 | SET_DIRECTORY_PROPERTIES(PROPERTIES |
254 | | COMPILE_DEFINITIONS_DEBUG "LEMON_ENABLE_DEBUG" |
255 | | COMPILE_DEFINITIONS_MAINTAINER "LEMON_ENABLE_DEBUG" |
| 254 | COMPILE_DEFINITIONS |
| 255 | $<$<OR:$<CONFIG:Debug>,$<CONFIG:Maintainer>>:LEMON_ENABLE_DEBUG> |
256 | 256 | ) |
257 | 257 | |
258 | 258 | INCLUDE(CheckTypeSize) |
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
a
|
b
|
|
84 | 84 | ADD_DEPENDENCIES(check lp_test) |
85 | 85 | |
86 | 86 | IF(WIN32 AND LEMON_HAVE_GLPK) |
87 | | GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) |
88 | | GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) |
89 | 87 | ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD |
90 | | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} |
91 | | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} |
92 | | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} |
| 88 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll $<TARGET_FILE_DIR:lp_test> |
| 89 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll $<TARGET_FILE_DIR:lp_test> |
| 90 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll $<TARGET_FILE_DIR:lp_test> |
93 | 91 | ) |
94 | 92 | ENDIF() |
95 | 93 | |