-
Notifications
You must be signed in to change notification settings - Fork 24
/
CMakeLists.txt
123 lines (100 loc) · 3.12 KB
/
CMakeLists.txt
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
OMESSAGE("Antares Solver")
#TODO : see to add bigobj support
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif (MSVC)
add_subdirectory(application)
add_subdirectory(constraints-builder)
add_subdirectory(expressions)
add_subdirectory(hydro)
add_subdirectory(infeasible-problem-analysis)
add_subdirectory(lps)
add_subdirectory(misc)
add_subdirectory(modelConverter)
add_subdirectory(modelParser)
add_subdirectory(systemParser)
add_subdirectory(modeler)
add_subdirectory(optimisation)
add_subdirectory(signal-handling)
add_subdirectory(simulation)
add_subdirectory(ts-generator)
add_subdirectory(utils)
add_subdirectory(variable)
add_subdirectory(optim-model-filler)
#
# Resource file for Windows
#
if (WIN32)
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/win32/solver.o")
FILE(COPY "${CMAKE_CURRENT_SOURCE_DIR}/win32/solver.ico" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/win32/")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/win32/solver.rc.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/win32/solver.rc")
if (MINGW)
# resource compilation for mingw
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/win32/solver.o"
COMMAND windres.exe "-I${CMAKE_CURRENT_SOURCE_DIR}"
"-i${CMAKE_CURRENT_SOURCE_DIR}/win32/solver.rc"
-o "${CMAKE_CURRENT_BINARY_DIR}/win32/solver.o")
set(SRCS ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/win32/solver.o")
else ()
set(SRCS ${SRCS} "win32/solver.rc")
endif ()
endif ()
OMESSAGE(" :: application solver")
set(exec_name "antares-solver")
add_library(solver-lib INTERFACE
${SRCS}
)
add_executable(antares-solver
main.cpp
${SRCS}
modelParser/encoders.hxx
)
set_target_properties(antares-solver PROPERTIES OUTPUT_NAME ${exec_name})
set(ANTARES_SOLVER_LIBS
Antares::args_helper
Antares::date
Antares::benchmarking
Antares::result_writer
Antares::sys
Antares::infoCollection
Antares::checks
Antares::misc
Antares::optimization-options
Antares::signal-handling
Antares::locale
yuni-static-uuid
yuni-static-core
${CMAKE_THREADS_LIBS_INIT}
)
set(ANTARES_SOLVER_LIBS ${ANTARES_SOLVER_LIBS}
antares-solver-hydro
antares-solver-variable
antares-solver-simulation
antares-solver-ts-generator
model_antares
antares-core
)
target_link_libraries(solver-lib
INTERFACE
${ANTARES_SOLVER_LIBS}
)
target_link_libraries(antares-solver
PRIVATE
solver-lib
Antares::application
)
target_include_directories(antares-solver
PRIVATE
${CMAKE_SOURCE_DIR}/solver
)
import_std_libs(antares-solver)
executable_strip(antares-solver)
copy_dependency(sirius_solver antares-solver)
#TODO : not working inside macro
install(TARGETS antares-solver EXPORT antares-solver DESTINATION bin)
INSTALL(EXPORT antares-solver
FILE antares-solverConfig.cmake
DESTINATION cmake
)
#########