forked from LimitPointSystems/SheafSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem_definitions.cmake
More file actions
519 lines (455 loc) · 20.5 KB
/
system_definitions.cmake
File metadata and controls
519 lines (455 loc) · 20.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
#
# Copyright (c) 2014 Limit Point Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Install the Windows Runtime lins
#
if(WIN32)
include(InstallRequiredSystemLibraries)
endif()
##
# This file is the system level counterpart to the component_definitions file
# found in the top level of any component. Functions and variables
# that need to have system scope should be declared and/or defined here.
##
set(BUILD_SHEAFSCOPE OFF CACHE BOOL "Toggle build of the SheafScope. If OFF, then no need to look for JDK or VTK unless BUILD_BINDINGS is on.")
set(INSTALL_DOCS ON CACHE BOOL "Toggle install state of Documentation.")
#
# Establish the version number for this build.
# This is only relevant for releases. 0.0.0.0 is chosen here
# simply as a stub.
#
set(LIB_VERSION 0.0.0.0 CACHE STRING "Library version number for release purposes")
mark_as_advanced(LIB_VERSION)
#
# Establish the list of components in this system
#
set(COMPONENTS sheaves fiber_bundles geometry fields tools CACHE STRING "List of components in this system" FORCE)
#
# Set the default value for install location
#
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND LIB_VERSION MATCHES "0.0.0.0" )
if(LINUX64GNU OR LINUX64INTEL)
set(CMAKE_INSTALL_PREFIX
"$ENV{HOME}/SheafSystem" CACHE PATH "SheafSystem install prefix" FORCE
)
else()
set(CMAKE_INSTALL_PREFIX
"$ENV{USERPROFILE}/SheafSystem" CACHE PATH "SheafSystem install prefix" FORCE
)
endif()
endif()
#
# Now fix the install path.
#
file(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX} CMAKE_INSTALL_PREFIX)
#
# Platform definitions
#
# OS is 64 bit Windows, compiler is cl
if(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" AND MSVC AND CMAKE_SIZEOF_VOID_P MATCHES "8")
set(WIN64MSVC ON CACHE BOOL "MS compiler in use.")
mark_as_advanced(FORCE WIN64MSVC)
# OS is 64 bit Windows, compiler is icl
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" AND CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND CMAKE_SIZEOF_VOID_P MATCHES "8")
set(WIN64INTEL ON CACHE BOOL "Intel compiler in use.")
mark_as_advanced(WIN64INTEL)
# OS is 64 bit linux, compiler is g++
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SIZEOF_VOID_P MATCHES "8")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if(GCC_VERSION VERSION_EQUAL 4.4 OR GCC_VERSION VERSION_GREATER 4.4 )
set(CMAKE_CXX_FLAGS "-std=c++0x")
elseif(GCC_VERSION VERSION_GREATER 4.2.1 AND GCC_VERSION VERSION_LESS 4.4 )
set(CMAKE_CXX_FLAGS "-ansi")
elseif(GCC_VERSION VERSION_LESS 4.2.2)
message(FATAL "g++ ${GCC_VERSION} is unsupported. Version must be >= 4.2.2")
endif()
set(LINUX64GNU ON CACHE BOOL "GNU CXX compiler ${GCC_VERSION} in use.")
mark_as_advanced(LINUX64GNU)
# OS is 64 bit linux, compiler is icpc
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux" AND CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND CMAKE_SIZEOF_VOID_P MATCHES "8")
set(LINUX64INTEL ON CACHE BOOL "Intel compiler in use.")
mark_as_advanced(LINUX64INTEL)
else()
message(FATAL_ERROR "A 64 bit Windows or Linux environment was not detected; exiting")
endif()
#
# Define the exports files
#
set(EXPORTS_FILE ${PROJECT_NAME}-exports.cmake CACHE STRING "System exports file name")
set(INSTALL_CONFIG_FILE ${PROJECT_NAME}-install.cmake CACHE STRING "Install config file name")
mark_as_advanced(EXPORTS_FILE)
mark_as_advanced(INSTALL_CONFIG_FILE)
#
# Delete the exports file at the start of each cmake run
#
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/${EXPORTS_FILE})
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/${INSTALL_CONFIG_FILE})
#
# Set the default build type.
#
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug_contracts" CACHE STRING
"Choose the type of build, options are: ${CMAKE_CONFIGURATION_TYPES}."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
#
# Tell CMake which configurations are "debug"
#
set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS "Debug_contracts" "Debug_no_contracts")
#
# Establish the file name suffix for debug type compiler output
#
if(WIN64MSVC OR WIN64INTEL)
set(CMAKE_DEBUG_CONTRACTS_POSTFIX "_d" CACHE STRING "Debug libs suffix")
set(CMAKE_DEBUG_NO_CONTRACTS_POSTFIX "_d" CACHE STRING "Debug libs suffix")
else()
set(CMAKE_DEBUG_CONTRACTS_POSTFIX "_debug" CACHE STRING "Debug libs suffix")
set(CMAKE_DEBUG_NO_CONTRACTS_POSTFIX "_debug" CACHE STRING "Debug libs suffix")
endif()
mark_as_advanced(FORCE CMAKE_DEBUG_CONTRACTS_POSTFIX)
mark_as_advanced(FORCE CMAKE_DEBUG_NO_CONTRACTS_POSTFIX)
#
# Toggle language bindings build
#
set(BUILD_BINDINGS OFF CACHE BOOL "Toggle build of language bindings.")
#
# Toggle multi-process compilation in win32.
#
if(WIN32)
set(ENABLE_WIN32_MP ON CACHE BOOL "Toggle win32 compiler MP directive. Works for MS and Intel. Default is ON.")
mark_as_advanced(FORCE ENABLE_WIN32_MP)
endif()
#
# Toggle intel compiler warnings.
#
set(INTELWARN CACHE BOOL "Toggle Intel compiler warnings")
mark_as_advanced(FORCE INTELWARN)
#
# Type of system documentation to build: Dev or User
# User docs do not contain source code listing. Otherwise,
# Dev and User are identical.
#
set(DOC_STATE Dev CACHE STRING "Type of documentation to build: [Dev|User]")
#
# Enable coverage results
#
if(LINUX64GNU OR LINUX64INTEL)
set(ENABLE_COVERAGE OFF CACHE BOOL "Set to ON to compile with coverage support. Default is OFF.")
endif()
#
# Set the location of the coverage folder and then create it.
#
if(ENABLE_COVERAGE)
set(COVERAGE_DIR ${CMAKE_BINARY_DIR}/coverage CACHE STRING "Directory for coverage files")
mark_as_advanced(FORCE COVERAGE_DIR)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_DIR})
endif()
#
# Default linux installation location is /usr/local
# Set a default where the user has write permission ; in this
# case, the top of the components source tree.
# "lib", "include", and "bin" will be appended to this location.
# See "add_install_target" in cmake_modules/component_functions.cmake for source.
#
if(LINUX64GNU OR LINUX64INTEL)
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR} CACHE STRING "System install location")
elseif(WIN64MSVC OR WIN64INTEL)
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR} CACHE STRING "System install location")
endif()
#
# Set the cmake module path.
#
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" CACHE STRING "Location of Cmake modules")
#
# Targets with global scope are declared and optionally defined in
# target_declarations.cmake; otherwise defined at first use.
#
include(${CMAKE_MODULE_PATH}/target_declarations.cmake)
#
# Prerequisite discovery
#
include(${CMAKE_MODULE_PATH}/find_prerequisites.cmake)
#
# Utility function to add components to a system.
#
function(add_components)
foreach(comp ${COMPONENTS})
clear_component_variables(${comp})
add_subdirectory(${comp})
endforeach()
endfunction(add_components)
#
# Clear cached variables at the start of each cmake run.
# This prevents the variables from containing diplicate entries.
#
function(clear_component_variables comp)
string(TOUPPER ${comp} COMP)
# clear the srcs vars so consecutive cmake runs don't
# list the same sources n times.
unset(${COMP}_SRCS CACHE)
# clear the unit tests var so consecutive cmake runs don't
# list the same sources n times.
unset(${COMP}_UNIT_TEST_SRCS CACHE)
# clear the example binaries var so consecutive cmake runs don't
# list the same sources n times.
unset(${COMP}_EXAMPLE_SRCS CACHE)
# clear the unit tests var so consecutive cmake runs don't
# list the same unit tests n times.
unset(${COMP}_UNIT_TESTS CACHE)
# clear the includes var so consecutive cmake runs don't
# list the same includes n times.
unset(${COMP}_INCS CACHE)
# clear the installed includes var so consecutive cmake runs don't
# list the same includes n times.
unset(${COMP}_INST_INCS CACHE)
# clear the ipath var so consecutive cmake runs don't
# list the same include paths n times.
unset(${COMP}_IPATH CACHE)
# clear the ipaths var so consecutive cmake runs don't
# list the same include paths n times.
unset(${COMP}_IPATHS CACHE)
# clear the ipath var so consecutive cmake runs don't
# list the same include paths n times.
unset(${COMP}_CLASSPATH CACHE)
endfunction(clear_component_variables)
#
# Make emacs tags
#
function(add_tags_target)
if(LINUX64GNU OR LINUX64INTEL)
add_custom_target(tags
COMMAND find ${CMAKE_CURRENT_SOURCE_DIR} -name build -prune -o -name "*.cc" -print -o -name "*.h" -print -o -name "*.t.cc" -print | etags --c++ --members -
)
endif()
endfunction(add_tags_target)
#
# Set the compiler flags per build configuration
#
function(set_compiler_flags)
# Toggle multi-process compilation in Windows
if(ENABLE_WIN32_MP)
set(MP "/MP")
else()
set(MP "")
endif()
if(WIN64MSVC)
set(LPS_CXX_FLAGS "${MP} /GR /nologo /DWIN32 /D_WINDOWS /W1 /EHsc"
CACHE STRING "C++ Compiler Flags")
set(LPS_SHARED_LINKER_FLAGS
"/INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE /MACHINE:X64"
CACHE STRING "Linker Flags for Shared Libs")
set(LPS_EXE_LINKER_FLAGS
"/INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE /MACHINE:X64"
CACHE STRING "Linker Flags for Executables")
elseif(WIN64INTEL)
set(LPS_CXX_FLAGS
"/D_USRDLL ${MP} /GR /nologo /DWIN32 /D_WINDOWS /W1 /wd2651 /EHsc /Qprof-gen:srcpos /D_HDF5USEDLL_"
CACHE STRING "C++ Compiler Flags")
set(LPS_SHARED_LINKER_FLAGS
"/INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE /NXCOMPAT /MACHINE:X64"
CACHE STRING "Linker Flags")
elseif(LINUX64INTEL)
if(ENABLE_COVERAGE)
if(INTELWARN)
set(LPS_CXX_FLAGS
"-ansi -m64 -w1 -wd186,1125 -Wno-deprecated -prof-gen=srcpos")
else()
set(LPS_CXX_FLAGS
"-ansi -m64 -w0 -Wno-deprecated -prof-gen=srcpos")
endif()
else()
if(INTELWARN)
set(LPS_CXX_FLAGS "-ansi -m64 -w1 -wd186,1125 -Wno-deprecated ")
else()
set(LPS_CXX_FLAGS "-ansi -m64 -w0 -Wno-deprecated ")
endif()
endif() # ENABLE_COVERAGE
elseif(LINUX64GNU)
# 12/20/13 -- added "-Wno-abi to suppress the following:
#"SheafSystem/sheaves/support/primitive_attributes.h:115:
#note: The ABI of passing union with long double has changed in GCC 4.4"
# The probrem is still there; we have only suppressed the warning.
set(LPS_CXX_FLAGS "-m64 -Wno-deprecated -Wno-abi")
endif()
mark_as_advanced(FORCE LPS_CXX_FLAGS LPS_SHARED_LINKER_FLAGS
LPS_EXE_LINKER_FLAGS)
#
# DEBUG_CONTRACTS section
#
# Configuration specific flags
if(WIN64MSVC OR WIN64INTEL)
set(CMAKE_CXX_FLAGS_DEBUG_CONTRACTS
"${LPS_CXX_FLAGS} /Zi /D\"_ITERATOR_DEBUG_LEVEL=2\" /MDd /LDd /Od "
CACHE STRING "Flags used by the C++ compiler for Debug_contracts builds" )
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG_CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /DEBUG /NODEFAULTLIB:MSVCRT"
CACHE STRING "Flags used by the linker for shared libraries for Debug_contracts builds" )
set(CMAKE_EXE_LINKER_FLAGS_DEBUG_CONTRACTS "${LPS_EXE_LINKER_FLAGS} /DEBUG"
CACHE STRING "Flags used by the linker for executables for Debug_contracts builds")
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG_CONTRACTS "${LPS_SHARED_LINKER_FLAGS} /DEBUG"
CACHE STRING "Debug_contracts linker flags - binding libs" )
else() # Linux
set(CMAKE_CXX_FLAGS_DEBUG_CONTRACTS "${LPS_CXX_FLAGS} -g "
CACHE STRING "Flags used by the C++ compiler for Debug_contracts builds" )
set(CMAKE_EXE_LINKER_FLAGS_DEBUG_CONTRACTS ${CMAKE_EXE_LINKER_FLAGS}
CACHE STRING "Flags used by the linker for executables for Debug_contracts builds")
endif()
mark_as_advanced(FORCE CMAKE_CXX_FLAGS_DEBUG_CONTRACTS
CMAKE_EXE_LINKER_FLAGS_DEBUG_CONTRACTS
CMAKE_SHARED_LINKER_FLAGS_DEBUG_CONTRACTS
CMAKE_MODULE_LINKER_FLAGS_DEBUG_CONTRACTS)
#
# DEBUG_NO_CONTRACTS section
#
if(WIN64MSVC OR WIN64INTEL)
set(CMAKE_CXX_FLAGS_DEBUG_NO_CONTRACTS
"${LPS_CXX_FLAGS} /Zi /D\"_ITERATOR_DEBUG_LEVEL=2\" /MDd /LDd /Od /DNDEBUG "
CACHE STRING "Flags used by the C++ compiler for Debug_no_contracts builds" )
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG_NO_CONTRACTS
"${LPS_SHARED_LINKER_FLAGS} /DEBUG /NODEFAULTLIB:MSVCRT"
CACHE STRING "Flags used by the linker for shared libraries for Debug_contracts builds" )
set(CMAKE_EXE_LINKER_FLAGS_DEBUG_NO_CONTRACTS
"${LPS_EXE_LINKER_FLAGS} /DEBUG"
CACHE STRING "Flags used by the linker for executables for Debug_contracts builds")
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG_NO_CONTRACTS
"${LPS_SHARED_LINKER_FLAGS} /DEBUG"
CACHE STRING "Debug_no_contracts linker flags - binding libs" )
else()
set(CMAKE_CXX_FLAGS_DEBUG_NO_CONTRACTS "${LPS_CXX_FLAGS} -g -DNDEBUG" CACHE
STRING "Flags used by the C++ compiler for Debug_no_contracts builds" )
endif()
mark_as_advanced(FORCE CMAKE_CXX_FLAGS_DEBUG_NO_CONTRACTS
CMAKE_EXE_LINKER_FLAGS_DEBUG_NO_CONTRACTS
CMAKE_SHARED_LINKER_FLAGS_DEBUG_NO_CONTRACTS
CMAKE_MODULE_LINKER_FLAGS_DEBUG_NO_CONTRACTS)
#
# RELEASE_CONTRACTS section
#
if(WIN64MSVC OR WIN64INTEL)
set(CMAKE_CXX_FLAGS_RELEASE_CONTRACTS
"${LPS_CXX_FLAGS} /MD /LD /O2 "
CACHE STRING "Flags used by the C++ compiler for Release_contracts builds" )
set(CMAKE_EXE_LINKER_FLAGS_RELEASE_CONTRACTS
"${LPS_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD /NXCOMPAT"
CACHE STRING "Flags used by the linker for executables for Release_contracts builds" )
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE_CONTRACTS
"${LPS_SHARED_LINKER_FLAGS}"
CACHE STRING "Flags used by the linker for shared libraries for Release_contracts builds" )
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE_CONTRACTS
"${LPS_SHARED_LINKER_FLAGS}"
CACHE STRING "Release_contracts linker flags - binding libs" )
else()
set(CMAKE_CXX_FLAGS_RELEASE_CONTRACTS "${LPS_CXX_FLAGS} "
CACHE STRING "Flags used by the C++ compiler for Release_contracts builds" )
set(CMAKE_EXE_LINKER_FLAGS_RELEASE_CONTRACTS "${LPS_EXE_LINKER_FLAGS}"
CACHE STRING "Flags used by the linker for executables for Release_contracts builds" )
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE_CONTRACTS "${LPS_SHARED_LINKER_FLAGS}"
CACHE STRING "Flags used by the linker for shared libraries for Release_contracts builds" )
endif()
mark_as_advanced(FORCE CMAKE_CXX_FLAGS_RELEASE_CONTRACTS
CMAKE_EXE_LINKER_FLAGS_RELEASE_CONTRACTS
CMAKE_SHARED_LINKER_FLAGS_RELEASE_CONTRACTS
CMAKE_MODULE_LINKER_FLAGS_RELEASE_CONTRACTS)
#
# RELEASE_NO_CONTRACTS section
#
if(WIN64MSVC OR WIN64INTEL)
set(CMAKE_CXX_FLAGS_RELEASE_NO_CONTRACTS
"${LPS_CXX_FLAGS} /MD /LD /O2 /DNDEBUG"
CACHE STRING "Flags used by the C++ compiler for Release_no_contracts builds" )
set(CMAKE_EXE_LINKER_FLAGS_RELEASE_NO_CONTRACTS
"${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRTD /NXCOMPAT"
CACHE STRING "Flags used by the linker for executables for Release_no_contracts builds" )
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE_NO_CONTRACTS
"${LPS_SHARED_LINKER_FLAGS}"
CACHE STRING "Flags used by the linker for shared libraries for Release_no_contracts builds" )
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE_NO_CONTRACTS
"${LPS_SHARED_LINKER_FLAGS}"
CACHE STRING "Release_no_contracts linker flags - binding libs" )
else()
set(CMAKE_CXX_FLAGS_RELEASE_NO_CONTRACTS
"${LPS_CXX_FLAGS} -DNDEBUG"
CACHE STRING "Flags used by the C++ compiler for Release_no_contracts builds" )
set(CMAKE_EXE_LINKER_FLAGS_RELEASE_NO_CONTRACTS
"${CMAKE_EXE_LINKER_FLAGS}"
CACHE STRING "Flags used by the linker for executables for Release_no_contracts builds" )
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE_NO_CONTRACTS
"${LPS_SHARED_LINKER_FLAGS}"
CACHE STRING "Flags used by the linker for shared libraries for Release_no_contracts builds" )
endif()
mark_as_advanced(FORCE CMAKE_CXX_FLAGS_RELEASE_NO_CONTRACTS
CMAKE_EXE_LINKER_FLAGS_RELEASE_NO_CONTRACTS
CMAKE_SHARED_LINKER_FLAGS_RELEASE_NO_CONTRACTS
CMAKE_MODULE_LINKER_FLAGS_RELEASE_NO_CONTRACTS)
#
# RelWithDebInfo_contracts section
#
if(WIN64MSVC OR WIN64INTEL)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_CONTRACTS
"${LPS_CXX_FLAGS} /MD /LD /O2 " CACHE
STRING "RelWithDebInfo_contracts compiler flags" )
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_CONTRACTS
"${LPS_EXE_LINKER_FLAGS} /DEBUG /NODEFAULTLIB:MSVCRTD /NXCOMPAT"
CACHE STRING "RelWithDebInfo_contracts linker flags - executables" )
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_CONTRACTS
"${LPS_SHARED_LINKER_FLAGS} /DEBUG" CACHE
STRING "RelWithDebInfo_contracts linker flags - shared libs" )
set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_CONTRACTS
"${LPS_SHARED_LINKER_FLAGS} /DEBUG" CACHE
STRING "RelWithDebInfo_contracts linker flags - binding libs" )
endif()
mark_as_advanced(FORCE CMAKE_CXX_FLAGS_RELWITHDEBINFO_CONTRACTS
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_CONTRACTS
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_CONTRACTS
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_CONTRACTS)
#
# RelWithDebInfo_no_contracts section
#
# Configuration specific flags
if(WIN64MSVC OR WIN64INTEL)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_NO_CONTRACTS
"${LPS_CXX_FLAGS} /MD /LD /O2 /DNDEBUG" CACHE
STRING "RelWithDebInfo_no_contracts compiler flags" )
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_NO_CONTRACTS
"${CMAKE_EXE_LINKER_FLAGS} /DEBUG /NODEFAULTLIB:MSVCRTD /NXCOMPAT"
CACHE STRING "RelWithDebInfo_no_contracts linker flags - executables" )
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_NO_CONTRACTS
"${LPS_SHARED_LINKER_FLAGS} /DEBUG" CACHE
STRING "RelWithDebInfo_no_contracts linker flags - shared libs" )
set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_NO_CONTRACTS
"${LPS_SHARED_LINKER_FLAGS} /DEBUG" CACHE
STRING "RelWithDebInfo_no_contracts linker flags - binding libs" )
endif()
mark_as_advanced(FORCE CMAKE_CXX_FLAGS_RELWITHDEBINFO_NO_CONTRACTS
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_NO_CONTRACTS
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_NO_CONTRACTS
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_NO_CONTRACTS)
endfunction(set_compiler_flags)
#
# Get the current system date and store it in RESULT
#
macro(get_date RESULT)
if(WIN32)
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
elseif(UNIX)
execute_process(COMMAND "date" "+%m/%d/%Y" OUTPUT_VARIABLE ${RESULT})
string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
else(WIN32)
message(WARNING "date not implemented")
set(${RESULT} 000000)
endif(WIN32)
endmacro(get_date)