lixiaojun
2024-07-30 f45bba0b5ecf73df67af6cb60e57ea956d82a8ab
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
# EPANET COMMAND LINE EXECUTABLE
cmake_minimum_required (VERSION 2.8.8)
 
 
# Sets for output directory for executables and libraries.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
 
# Sets the position independent code property for all targets.
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 
 
# Link to multi-threaded static runtime library
IF (MSVC)
  add_definitions(-D_CRT_SECURE_NO_DEPRECATE -MT)
ENDIF (MSVC)
 
 
# Set up file groups for exe target
set(EPANET_CLI_SOURCES main.c)
include_directories(include)
 
source_group("CLI" FILES ${EPANET_CLI_SOURCES})
 
 
# Creates the EPANET command line executable
add_executable(runepanet ${EPANET_CLI_SOURCES})
if(NOT WIN32)
    target_link_libraries(runepanet LINK_PUBLIC epanet2 m)
else(NOT WIN32)
    target_link_libraries(runepanet LINK_PUBLIC epanet2)
endif(NOT WIN32)