File tree Expand file tree Collapse file tree 2 files changed +23
-8
lines changed Expand file tree Collapse file tree 2 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 25
25
# CMake is available at https://cmake.org/download/
26
26
#
27
27
28
- cmake_minimum_required (VERSION 3.0 )
28
+ cmake_minimum_required (VERSION 3.13 )
29
29
30
30
if ("${CMAKE_BINARY_DIR} " STREQUAL "${CMAKE_SOURCE_DIR} " )
31
31
message (FATAL_ERROR "In-source builds are disabled." )
@@ -44,6 +44,8 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
44
44
SET (CMAKE_POSITION_INDEPENDENT_CODE ON )
45
45
46
46
47
+ # Searches for and create install rules for vcruntime.dll, msvcp.dll, etc.
48
+ include (InstallRequiredSystemLibraries )
47
49
48
50
# Sets default install prefix when cmakecache is initialized for first time
49
51
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
Original file line number Diff line number Diff line change @@ -21,12 +21,6 @@ IF (APPLE)
21
21
set (CMAKE_MACOSX_RPATH 1 )
22
22
ENDIF (APPLE )
23
23
24
- IF (MSVC )
25
- set (CMAKE_C_FLAGS_RELEASE "/GL" )
26
- add_definitions (-D_CRT_SECURE_NO_DEPRECATE )
27
- ENDIF (MSVC )
28
-
29
-
30
24
31
25
set (HEADER_PATH
32
26
"${PROJECT_SOURCE_DIR} /include"
@@ -142,6 +136,25 @@ else()
142
136
endif ()
143
137
endif ()
144
138
139
+ target_compile_options (epanet2
140
+ PUBLIC
141
+ "$<$<CXX_COMPILER_ID:MSVC>:"
142
+ "$<$<CONFIG:Release>:/GL>"
143
+ ">"
144
+ )
145
+
146
+ target_compile_definitions (epanet2
147
+ PUBLIC
148
+ "_CRT_SECURE_NO_DEPRECATE"
149
+ )
150
+
151
+ target_link_options (epanet2
152
+ PUBLIC
153
+ "$<$<CXX_COMPILER_ID:MSVC>:"
154
+ "$<$<CONFIG:Release>:/LTCG>"
155
+ ">"
156
+ )
157
+
145
158
target_include_directories (epanet2
146
159
PUBLIC
147
160
$< BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /include>
@@ -157,7 +170,7 @@ install(TARGETS epanet2
157
170
FRAMEWORK DESTINATION "${TOOL_DIST} "
158
171
)
159
172
160
- # Need to list files out individually otherwise is won't work
173
+ # Need to list files out individually otherwise it won't work
161
174
install (
162
175
FILES
163
176
"${PROJECT_SOURCE_DIR} /include/epanet2.def"
You can’t perform that action at this time.
0 commit comments