@@ -24,8 +24,11 @@ set(PROJECT_GIT_REF "unknown")
24
24
# Library libstack ---------------------------------------------------
25
25
message (STATUS "Building cloe-stacklib library." )
26
26
add_library (cloe-stacklib STATIC
27
+ src/config.hpp
27
28
src/stack.hpp
28
29
src/stack.cpp
30
+ src/stack_factory.hpp
31
+ src/stack_factory.cpp
29
32
src/plugin.hpp
30
33
src/plugin.cpp
31
34
@@ -63,6 +66,7 @@ if(BUILD_TESTING)
63
66
message (STATUS "Building test-stacklib executable." )
64
67
add_executable (test -stacklib
65
68
src/stack_test.cpp
69
+ src/stack_component_test.cpp
66
70
)
67
71
set_target_properties (test -stacklib PROPERTIES
68
72
CXX_STANDARD 17
@@ -78,69 +82,96 @@ if(BUILD_TESTING)
78
82
gtest_add_tests(TARGET test -stacklib)
79
83
endif ()
80
84
81
- # Executable ---------------------------------------------------------
82
- add_executable (cloe-engine
83
- src/main.cpp
84
- src/main_stack.cpp
85
+ # Library libengine ----------------------------------------------
86
+ message (STATUS "Building cloe-enginelib library." )
87
+ add_library (cloe-enginelib STATIC
85
88
src/coordinator.cpp
89
+ src/coordinator.hpp
90
+ src/registrar.hpp
91
+ # These are added below and depend on CLOE_ENGINE_WITH_SERVER:
92
+ # src/server.cpp
93
+ # src/server_mock.cpp
86
94
src/simulation.cpp
95
+ src/simulation.hpp
87
96
src/simulation_context.cpp
88
97
src/simulation_context.hpp
89
98
src/simulation_progress.hpp
90
99
src/utility/command .cpp
100
+ src/utility/command .hpp
101
+ src/utility/defer.hpp
102
+ src/utility/progress.hpp
103
+ src/utility/state_machine.hpp
104
+ src/utility/time_event.hpp
91
105
)
92
- set_target_properties (cloe-engine PROPERTIES
106
+ add_library (cloe::enginelib ALIAS cloe-enginelib)
107
+ set_target_properties (cloe-enginelib PROPERTIES
93
108
CXX_STANDARD 17
94
109
CXX_STANDARD_REQUIRED ON
95
- OUTPUT_NAME cloe- engine
110
+ OUTPUT_NAME engine
96
111
)
97
- target_compile_definitions (cloe-engine
98
- PRIVATE
99
- CLOE_ENGINE_VERSION="${CLOE_ENGINE_VERSION} "
100
- CLOE_ENGINE_TIMESTAMP="${CLOE_ENGINE_TIMESTAMP} "
112
+ target_compile_definitions (cloe-enginelib
113
+ PUBLIC
101
114
PROJECT_SOURCE_DIR =\"${CMAKE_CURRENT_SOURCE_DIR} \"
102
115
)
103
- target_include_directories (cloe-engine
116
+ target_include_directories (cloe-enginelib
104
117
PRIVATE
105
118
src
106
119
)
107
- target_link_libraries (cloe-engine
108
- PRIVATE
109
- CLI11::CLI11
110
- cloe::models
120
+ target_link_libraries (cloe-enginelib
121
+ PUBLIC
111
122
cloe::stacklib
123
+ cloe::models
124
+ cloe::runtime
125
+ fable::fable
126
+ boost::boost
127
+ Threads::Threads
112
128
)
113
129
114
130
option (CLOE_ENGINE_WITH_SERVER "Enable integrated server component?" ON )
115
131
if (CLOE_ENGINE_WITH_SERVER)
116
- message (STATUS "-> Enable server component" )
117
132
if (CLOE_FIND_PACKAGES)
118
133
find_package (cloe-oak REQUIRED QUIET )
119
134
endif ()
120
- target_sources (cloe-engine
121
- PRIVATE
122
- src/server.cpp
123
- )
124
- target_link_libraries (cloe-engine
125
- PRIVATE
126
- cloe::oak
127
- )
128
- target_compile_definitions (cloe-engine
129
- PRIVATE
130
- CLOE_ENGINE_WITH_SERVER=1
131
- )
135
+ target_sources (cloe-enginelib PRIVATE src/server.cpp)
136
+ target_link_libraries (cloe-enginelib PRIVATE cloe::oak)
137
+ target_compile_definitions (cloe-enginelib PUBLIC CLOE_ENGINE_WITH_SERVER=1)
132
138
else ()
133
- message (STATUS "-> Disable server component" )
134
- target_sources (cloe-engine
135
- PRIVATE
136
- src/server_mock.cpp
137
- )
138
- target_compile_definitions (cloe-engine
139
- PRIVATE
140
- CLOE_ENGINE_WITH_SERVER=0
141
- )
139
+ target_sources (cloe-enginelib PRIVATE src/server_mock.cpp)
140
+ target_compile_definitions (cloe-enginelib PUBLIC CLOE_ENGINE_WITH_SERVER=0)
142
141
endif ()
143
142
143
+ # Executable ---------------------------------------------------------
144
+ message (STATUS "Building cloe-engine executable [with server=${CLOE_ENGINE_WITH_SERVER} ]." )
145
+ add_executable (cloe-engine
146
+ src/main.cpp
147
+ src/main_commands.hpp
148
+ src/main_check.cpp
149
+ src/main_dump.cpp
150
+ src/main_run.cpp
151
+ src/main_usage.cpp
152
+ src/main_version.cpp
153
+ )
154
+ set_target_properties (cloe-engine PROPERTIES
155
+ CXX_STANDARD 17
156
+ CXX_STANDARD_REQUIRED ON
157
+ OUTPUT_NAME cloe-engine
158
+ )
159
+ target_compile_definitions (cloe-engine
160
+ PRIVATE
161
+ CLOE_ENGINE_VERSION="${CLOE_ENGINE_VERSION} "
162
+ CLOE_ENGINE_TIMESTAMP="${CLOE_ENGINE_TIMESTAMP} "
163
+ )
164
+ target_include_directories (cloe-engine
165
+ PRIVATE
166
+ src
167
+ )
168
+ target_link_libraries (cloe-engine
169
+ PRIVATE
170
+ cloe::stacklib
171
+ cloe::enginelib
172
+ CLI11::CLI11
173
+ )
174
+
144
175
# Installation -------------------------------------------------------
145
176
install (TARGETS cloe-engine
146
177
RUNTIME
0 commit comments