From 655661866271c70dd5c8ced35656a6acbe986fd7 Mon Sep 17 00:00:00 2001 From: Florian OMNES Date: Tue, 19 Sep 2023 18:35:36 +0200 Subject: [PATCH] Add "Antares::action" CMake library, build only if BUILD_UI=ON --- src/libs/antares/study/CMakeLists.txt | 132 +----------------- src/libs/antares/study/action/CMakeLists.txt | 139 +++++++++++++++++++ src/ui/simulator/CMakeLists.txt | 1 + 3 files changed, 146 insertions(+), 126 deletions(-) create mode 100644 src/libs/antares/study/action/CMakeLists.txt diff --git a/src/libs/antares/study/CMakeLists.txt b/src/libs/antares/study/CMakeLists.txt index 0f0dbaa197..e773901dc6 100644 --- a/src/libs/antares/study/CMakeLists.txt +++ b/src/libs/antares/study/CMakeLists.txt @@ -33,125 +33,6 @@ set(SRC_STUDY_SCENARIO_BUILDER ) source_group("study\\scenario builder" FILES ${SRC_MATRIX}) -set(SRC_STUDY_ACTIONS - action/fwd.h - action/action.h - action/action.hxx - action/action.cpp - action/text.h - action/text.hxx - action/settings/suffix-for-area-names.h - action/settings/suffix-for-area-names.hxx - action/settings/suffix-for-area-names.cpp - action/settings/suffix-for-cluster-names.h - action/settings/suffix-for-cluster-names.hxx - action/settings/suffix-for-cluster-names.cpp - action/settings/suffix-for-constraint-names.h - action/settings/suffix-for-constraint-names.hxx - action/settings/suffix-for-constraint-names.cpp - action/settings/decal-area-position.h - action/settings/decal-area-position.hxx - action/settings/decal-area-position.cpp - action/behavior.h - action/behavior.cpp - action/state.h - action/state.cpp - action/context.h - action/context.cpp) -source_group("study\\actions" FILES ${SRC_STUDY_ACTIONS}) - -set(SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_AREA - action/handler/antares-study/area/create.h - action/handler/antares-study/area/create.hxx - action/handler/antares-study/area/create.cpp - action/handler/antares-study/area/position.h - action/handler/antares-study/area/position.cpp - action/handler/antares-study/area/filtering.h - action/handler/antares-study/area/filtering.cpp - action/handler/antares-study/area/color.h - action/handler/antares-study/area/color.cpp - action/handler/antares-study/area/nodal-optimization.h - action/handler/antares-study/area/nodal-optimization.cpp - action/handler/antares-study/area/reserves.h - action/handler/antares-study/area/reserves.cpp - action/handler/antares-study/area/misc-gen.h - action/handler/antares-study/area/misc-gen.cpp - action/handler/antares-study/area/timeseries.h - action/handler/antares-study/area/timeseries.cpp - action/handler/antares-study/area/ts-generator.h - action/handler/antares-study/area/ts-generator.cpp - action/handler/antares-study/area/ts-node.h - action/handler/antares-study/area/ts-node.hxx - action/handler/antares-study/area/ts-node.cpp - action/handler/antares-study/area/correlation.h - action/handler/antares-study/area/correlation.cpp - action/handler/antares-study/area/correlation-post.h - action/handler/antares-study/area/correlation-post.hxx - action/handler/antares-study/area/correlation-post.cpp - - action/handler/antares-study/area/allocation-hydro.h - action/handler/antares-study/area/allocation-hydro.cpp - action/handler/antares-study/area/allocation-hydro-post.h - action/handler/antares-study/area/allocation-hydro-post.hxx - action/handler/antares-study/area/allocation-hydro-post.cpp) -source_group("study\\actions\\handler\\antares study\\area" FILES ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_AREA}) - -set(SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_LINK - action/handler/antares-study/link/create.h - action/handler/antares-study/link/create.hxx - action/handler/antares-study/link/create.cpp - action/handler/antares-study/link/ntc.h - action/handler/antares-study/link/ntc.cpp - action/handler/antares-study/link/hurdles-cost.h - action/handler/antares-study/link/hurdles-cost.cpp - action/handler/antares-study/link/impedances.h - action/handler/antares-study/link/impedances.cpp - action/handler/antares-study/link/comments.h - action/handler/antares-study/link/comments.hxx - action/handler/antares-study/link/comments.cpp - action/handler/antares-study/link/copper-plate.h - action/handler/antares-study/link/copper-plate.cpp - action/handler/antares-study/link/filtering.h - action/handler/antares-study/link/filtering.cpp - action/handler/antares-study/link/unload-data.h - action/handler/antares-study/link/unload-data.hxx - action/handler/antares-study/link/unload-data.cpp) -source_group("study\\actions\\handler\\antares study\\link" FILES ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_LINK}) - -set(SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_THERMAL - action/handler/antares-study/thermal-cluster/create.h - action/handler/antares-study/thermal-cluster/create.hxx - action/handler/antares-study/thermal-cluster/create.cpp - action/handler/antares-study/thermal-cluster/root-node.h - action/handler/antares-study/thermal-cluster/root-node.hxx - action/handler/antares-study/thermal-cluster/root-node.cpp - action/handler/antares-study/thermal-cluster/common.h - action/handler/antares-study/thermal-cluster/common.cpp -) -source_group("study\\action\\handler\\sntares study\\thermal cluster" FILES ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_THERMAL}) - - -set(SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_CONSTRAINT - action/handler/antares-study/constraint/create.h - action/handler/antares-study/constraint/create.hxx - action/handler/antares-study/constraint/create.cpp - action/handler/antares-study/constraint/comments.h - action/handler/antares-study/constraint/comments.hxx - action/handler/antares-study/constraint/comments.cpp - action/handler/antares-study/constraint/data.h - action/handler/antares-study/constraint/data.hxx - action/handler/antares-study/constraint/data.cpp - action/handler/antares-study/constraint/weights.h - action/handler/antares-study/constraint/weights.cpp - action/handler/antares-study/constraint/offsets.h - action/handler/antares-study/constraint/offsets.cpp - action/handler/antares-study/constraint/enabled.h - action/handler/antares-study/constraint/enabled.hxx - action/handler/antares-study/constraint/enabled.cpp -) -source_group("study\\action\\handler\\antares study\\constraint" FILES ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_CONSTRAINT}) - - set(SRC_AREAS area/constants.h area/area.h @@ -401,11 +282,6 @@ set(SRC_ALL ${SRC_AREAS} ${SRC_XCAST} ${SRC_STUDY_AREA_UI} - ${SRC_STUDY_ACTIONS} - ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_THERMAL} - ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_AREA} - ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_LINK} - ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_CONSTRAINT} ${SRC_STUDY_UI} ${SRC_STUDY_PARAMETERS} ${SRC_STUDY_FINDER} @@ -427,7 +303,6 @@ target_link_libraries(study PUBLIC Boost::boost yuni-static-core - Boost::boost Antares::array #xcast Antares::date #parameters Antares::inifile #parameters @@ -447,4 +322,9 @@ target_include_directories(study PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../.. #Dirty trick to allow inclusion via # Make more than just study visible but it's the lesser evil for now -) \ No newline at end of file +) + +# TODO when removing the UI, also remove this directory & target +if(BUILD_UI) + add_subdirectory(action) +endif() diff --git a/src/libs/antares/study/action/CMakeLists.txt b/src/libs/antares/study/action/CMakeLists.txt new file mode 100644 index 0000000000..40c7bfc4f5 --- /dev/null +++ b/src/libs/antares/study/action/CMakeLists.txt @@ -0,0 +1,139 @@ +set(SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_AREA + handler/antares-study/area/create.h + handler/antares-study/area/create.hxx + handler/antares-study/area/create.cpp + handler/antares-study/area/position.h + handler/antares-study/area/position.cpp + handler/antares-study/area/filtering.h + handler/antares-study/area/filtering.cpp + handler/antares-study/area/color.h + handler/antares-study/area/color.cpp + handler/antares-study/area/nodal-optimization.h + handler/antares-study/area/nodal-optimization.cpp + handler/antares-study/area/reserves.h + handler/antares-study/area/reserves.cpp + handler/antares-study/area/misc-gen.h + handler/antares-study/area/misc-gen.cpp + handler/antares-study/area/timeseries.h + handler/antares-study/area/timeseries.cpp + handler/antares-study/area/ts-generator.h + handler/antares-study/area/ts-generator.cpp + handler/antares-study/area/ts-node.h + handler/antares-study/area/ts-node.hxx + handler/antares-study/area/ts-node.cpp + handler/antares-study/area/correlation.h + handler/antares-study/area/correlation.cpp + handler/antares-study/area/correlation-post.h + handler/antares-study/area/correlation-post.hxx + handler/antares-study/area/correlation-post.cpp + + handler/antares-study/area/allocation-hydro.h + handler/antares-study/area/allocation-hydro.cpp + handler/antares-study/area/allocation-hydro-post.h + handler/antares-study/area/allocation-hydro-post.hxx + handler/antares-study/area/allocation-hydro-post.cpp) +source_group("study\\actions\\handler\\antares study\\area" FILES ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_AREA}) + +set(SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_LINK + handler/antares-study/link/create.h + handler/antares-study/link/create.hxx + handler/antares-study/link/create.cpp + handler/antares-study/link/ntc.h + handler/antares-study/link/ntc.cpp + handler/antares-study/link/hurdles-cost.h + handler/antares-study/link/hurdles-cost.cpp + handler/antares-study/link/impedances.h + handler/antares-study/link/impedances.cpp + handler/antares-study/link/comments.h + handler/antares-study/link/comments.hxx + handler/antares-study/link/comments.cpp + handler/antares-study/link/copper-plate.h + handler/antares-study/link/copper-plate.cpp + handler/antares-study/link/filtering.h + handler/antares-study/link/filtering.cpp + handler/antares-study/link/unload-data.h + handler/antares-study/link/unload-data.hxx + handler/antares-study/link/unload-data.cpp) +source_group("study\\actions\\handler\\antares study\\link" FILES ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_LINK}) + +set(SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_THERMAL + handler/antares-study/thermal-cluster/create.h + handler/antares-study/thermal-cluster/create.hxx + handler/antares-study/thermal-cluster/create.cpp + handler/antares-study/thermal-cluster/root-node.h + handler/antares-study/thermal-cluster/root-node.hxx + handler/antares-study/thermal-cluster/root-node.cpp + handler/antares-study/thermal-cluster/common.h + handler/antares-study/thermal-cluster/common.cpp +) +source_group("study\\action\\handler\\sntares study\\thermal cluster" FILES ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_THERMAL}) + + +set(SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_CONSTRAINT + handler/antares-study/constraint/create.h + handler/antares-study/constraint/create.hxx + handler/antares-study/constraint/create.cpp + handler/antares-study/constraint/comments.h + handler/antares-study/constraint/comments.hxx + handler/antares-study/constraint/comments.cpp + handler/antares-study/constraint/data.h + handler/antares-study/constraint/data.hxx + handler/antares-study/constraint/data.cpp + handler/antares-study/constraint/weights.h + handler/antares-study/constraint/weights.cpp + handler/antares-study/constraint/offsets.h + handler/antares-study/constraint/offsets.cpp + handler/antares-study/constraint/enabled.h + handler/antares-study/constraint/enabled.hxx + handler/antares-study/constraint/enabled.cpp +) +source_group("study\\action\\handler\\antares study\\constraint" FILES ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_CONSTRAINT}) + +set(SRC_STUDY_ACTIONS + fwd.h + action.h + action.hxx + action.cpp + text.h + text.hxx + settings/suffix-for-area-names.h + settings/suffix-for-area-names.hxx + settings/suffix-for-area-names.cpp + settings/suffix-for-cluster-names.h + settings/suffix-for-cluster-names.hxx + settings/suffix-for-cluster-names.cpp + settings/suffix-for-constraint-names.h + settings/suffix-for-constraint-names.hxx + settings/suffix-for-constraint-names.cpp + settings/decal-area-position.h + settings/decal-area-position.hxx + settings/decal-area-position.cpp + behavior.h + behavior.cpp + state.h + state.cpp + context.h + context.cpp) +source_group("study\\actions" FILES ${SRC_STUDY_ACTIONS}) + + +set(SRC_HANDLER + ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_THERMAL} + ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_AREA} + ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_LINK} + ${SRC_STUDY_ACTIONS_HANDLER_ANTARES_STUDY_CONSTRAINT} + ${SRC_STUDY_ACTIONS}) + +add_library(antares-action ${SRC_HANDLER}) + +target_link_libraries(antares-action + PUBLIC + yuni-static-core + Antares::result_writer #study.h + Antares::date #parameters + Antares::inifile #parameters + Antares::object + Antares::study +) + +add_library(Antares::action ALIAS antares-action) diff --git a/src/ui/simulator/CMakeLists.txt b/src/ui/simulator/CMakeLists.txt index 8bf2961a0c..4e048c02ce 100644 --- a/src/ui/simulator/CMakeLists.txt +++ b/src/ui/simulator/CMakeLists.txt @@ -148,6 +148,7 @@ set(ANTARES_LIBS antares-core Antares::date Antares::study + Antares::action yuni-static-core yuni-static-uuid model_antares