diff --git a/ACore/CMakeLists.txt b/ACore/CMakeLists.txt index 364ac2b71..e0b93557d 100644 --- a/ACore/CMakeLists.txt +++ b/ACore/CMakeLists.txt @@ -1,62 +1,168 @@ -# Note: -# If new src or test is added make sure you touch this file # - - -# crypt is not needed on Apple machines -if(NOT DEFINED APPLE) - set(CRYPT_LIB crypt) -endif() - -# Only really needed for File.cpp -add_definitions( -DCMAKE ) - -# We place generated file in /ACore/src/ so that we can still use boost build -configure_file( ecflow_version.h.in ${CMAKE_SOURCE_DIR}/ACore/src/ecflow_version.h ) - -# place in binary directory since this is different for each user -configure_file( ecflow_source_build_dir.h.in ${CMAKE_BINARY_DIR}/ecflow_source_build_dir.h ) - -# Use transitive nature: i.e if any lib/exe uses lib core, they -# will also inherit the boost libs. +# Copyright 2023- ECMWF. # -file( GLOB srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp" "src/*.hpp" "src/*.h" ) -ecbuild_add_library( TARGET core - NOINSTALL - TYPE STATIC - SOURCES ${srcs} - ) -target_include_directories(core PUBLIC src - ${Boost_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR} ) +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# + +configure_file(ecflow_version.h.in ${CMAKE_BINARY_DIR}/generated/ecflow_version.h) +configure_file(ecflow_source_build_dir.h.in ${CMAKE_BINARY_DIR}/generated/ecflow_source_build_dir.h) -# This ensures that for debug config, we only link with debug boost libs, for other configs, we link with optimised boost libs -if ( Boost_VERSION_STRING VERSION_LESS "1.69.0" ) - target_link_libraries(core ${Boost_FILESYSTEM_LIBRARY_RELEASE} - ${Boost_DATE_TIME_LIBRARY_RELEASE} - ${Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE} - ${Boost_SYSTEM_LIBRARY_RELEASE} - ${CRYPT_LIB} - ) -else() - # for boost version 1.69 or greater Boost.System is now header-only. - target_link_libraries(core ${Boost_FILESYSTEM_LIBRARY_RELEASE} - ${Boost_DATE_TIME_LIBRARY_RELEASE} - ${Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE} - ${CRYPT_LIB} - ) -endif() +set(srcs + # Headers + ${CMAKE_BINARY_DIR}/generated/ecflow_version.h + ${CMAKE_BINARY_DIR}/generated/ecflow_source_build_dir.h + src/AssertTimer.hpp + src/Cal.hpp + src/Calendar.hpp + src/CalendarUpdateParams.hpp + src/CheckPt.hpp + src/Child.hpp + src/CommandLine.hpp + src/DState.hpp + src/DebugPerf.hpp + src/DurationTimer.hpp + src/Ecf.hpp + src/EcfPortLock.hpp + src/Extract.hpp + src/File.hpp + src/File_r.hpp + src/Host.hpp + src/Indentor.hpp + src/Log.hpp + src/LogVerification.hpp + src/NOrder.hpp + src/NState.hpp + src/NodePath.hpp + src/Passwd.hpp + src/PasswdFile.hpp + src/PasswordEncryption.hpp + src/Pid.hpp + src/PrintStyle.hpp + src/SState.hpp + src/Serialization.hpp + src/SerializationTest.hpp + src/Stl.hpp + src/Str.hpp + src/StringSplitter.hpp + src/TestUtil.hpp + src/TimeSeries.hpp + src/TimeSlot.hpp + src/TimeStamp.hpp + src/User.hpp + src/Version.hpp + src/WhiteListFile.hpp + src/cereal_boost_time.hpp + src/cereal_optional_nvp.hpp + src/perf_timer.hpp + # Sources + src/AssertTimer.cpp + src/Cal.cpp + src/Calendar.cpp + src/Child.cpp + src/CommandLine.cpp + src/DState.cpp + src/DurationTimer.cpp + src/Ecf.cpp + src/Extract.cpp + src/File.cpp + src/File_r.cpp + src/Host.cpp + src/Indentor.cpp + src/Log.cpp + src/LogVerification.cpp + src/NOrder.cpp + src/NState.cpp + src/NodePath.cpp + src/Passwd.cpp + src/PasswdFile.cpp + src/Pid.cpp + src/PrintStyle.cpp + src/SState.cpp + src/Str.cpp + src/StringSplitter.cpp + src/TimeSeries.cpp + src/TimeSlot.cpp + src/TimeStamp.cpp + src/User.cpp + src/Version.cpp + src/WhiteListFile.cpp +) +ecbuild_add_library( + TARGET + core + NOINSTALL + TYPE STATIC + SOURCES + ${srcs} + PUBLIC_INCLUDES + src + ${CMAKE_BINARY_DIR}/generated + PUBLIC_LIBS + $<$:Boost::system> + Boost::filesystem + Boost::date_time + Boost::program_options + $<$>:crypt> + DEFINITIONS + CMAKE +) target_clangformat(core) -# ${LIBRT} See: https://stackoverflow.com/questions/13653361/another-undefined-reference-error-when-linking-boost-libraries -file( GLOB test_srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "test/*.cpp" "test/*.hpp" ) -ecbuild_add_test( TARGET u_acore - SOURCES ${test_srcs} - INCLUDES src ${Boost_INCLUDE_DIRS} - LIBS core ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} - ${Boost_TIMER_LIBRARY} ${Boost_CHRONO_LIBRARY} ${LIBRT} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - ) +set(test_srcs + # Headers + test/TestVersioning.hpp + # Sources + test/TestCalendar.cpp + test/TestCereal.cpp + test/TestCerealOptionalNVP.cpp + test/TestCerealWithHierarchy.cpp + test/TestClassDataMemberInit.cpp + test/TestCommandLine.cpp + test/TestCore_main.cpp # contains main() function for test driver + test/TestFile.cpp + test/TestGetUserDetails.cpp + test/TestLog.cpp + test/TestMigration.cpp + test/TestNodePath.cpp + test/TestPasswdFile.cpp + test/TestPasswordEncryption.cpp + test/TestPerfTimer.cpp + test/TestRealCalendar.cpp + test/TestSanitizerAS.cpp + test/TestSanitizerUB.cpp + test/TestSerialisation.cpp + test/TestStackTrace.cpp + test/TestStr.cpp + test/TestStringSplitPerf.cpp + test/TestStringSplitter.cpp + test/TestTimeSeries.cpp + test/TestTimeSlot.cpp + test/TestVersion.cpp + test/TestVersioning.cpp + test/TestWhiteListFile.cpp +) -target_clangformat(u_acore CONDITION ENABLE_TESTS) +ecbuild_add_test( + TARGET + u_acore + SOURCES + ${test_srcs} + LIBS + core + Boost::boost # Boost header-only libraries must be available (namely unit_test_framework) +# +# Important! +# +# Boost::timer, Boost::chrono are required when certain definitions are manually turned on, e.g. +# - FILE_PERF_CHECK_IMPLEMENTATIONS, at TestFile.cpp +# - STRING_SPLIT_IMPLEMENTATIONS_PERF_CHECK_, at TestStringSplitPerf.cpp +# +) +target_clangformat(u_acore + CONDITION ENABLE_TESTS +) diff --git a/ACore/src/ecflow_version.h b/ACore/src/ecflow_version.h deleted file mode 100644 index f6d0dbeaa..000000000 --- a/ACore/src/ecflow_version.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef ecflow_version_config_h -#define ecflow_version_config_h - -// clang-format off -#define ECFLOW_VERSION "5.11.3" -#define ECFLOW_RELEASE "5" -#define ECFLOW_MAJOR "11" -#define ECFLOW_MINOR "3" - -// available but not used -// PROJECT_VERSION=5.11.3 -// PROJECT_VERSION_MAJOR=5 -// PROJECT_VERSION_MINOR=11 -// PROJECT_VERSION_PATCH=3 - -#endif diff --git a/ACore/test/TestCore_main.cpp b/ACore/test/TestCore_main.cpp new file mode 100644 index 000000000..f54bd0d29 --- /dev/null +++ b/ACore/test/TestCore_main.cpp @@ -0,0 +1,12 @@ +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ + +#define BOOST_TEST_MODULE TestCore +#include diff --git a/ACore/test/TestFile.cpp b/ACore/test/TestFile.cpp index a5eb5ffa8..a2be84311 100644 --- a/ACore/test/TestFile.cpp +++ b/ACore/test/TestFile.cpp @@ -25,6 +25,7 @@ // #define FILE_PERF_CHECK_IMPLEMENTATIONS 1; #ifdef FILE_PERF_CHECK_IMPLEMENTATIONS #include + #include "Str.hpp" #endif #include "File.hpp" diff --git a/ACore/test/TestNodePath.cpp b/ACore/test/TestNodePath.cpp index e2235d01f..b2ec32223 100644 --- a/ACore/test/TestNodePath.cpp +++ b/ACore/test/TestNodePath.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE TestCore //============================================================================ // Name : Request // Author : Avi diff --git a/ANattr/CMakeLists.txt b/ANattr/CMakeLists.txt index c006fe922..f8ea8631a 100644 --- a/ANattr/CMakeLists.txt +++ b/ANattr/CMakeLists.txt @@ -1,31 +1,97 @@ -# Note: -# If new src or test cpp files are added make sure you touch this file # -file( GLOB srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp" "src/*.hpp" ) +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# -ecbuild_add_library( TARGET nodeattr - NOINSTALL - TYPE STATIC - SOURCES ${srcs} - ) - -target_link_libraries(nodeattr PRIVATE core) -target_include_directories(nodeattr PUBLIC src - ../ACore/src - ${Boost_INCLUDE_DIRS}) +set(srcs + # Headers + src/AutoArchiveAttr.hpp + src/AutoCancelAttr.hpp + src/ClockAttr.hpp + src/CronAttr.hpp + src/DateAttr.hpp + src/DayAttr.hpp + src/GenericAttr.hpp + src/LateAttr.hpp + src/NodeAttr.hpp + src/QueueAttr.hpp + src/RepeatAttr.hpp + src/TimeAttr.hpp + src/TodayAttr.hpp + src/Variable.hpp + src/VerifyAttr.hpp + src/Zombie.hpp + src/ZombieAttr.hpp + # Sources + src/AutoArchiveAttr.cpp + src/AutoCancelAttr.cpp + src/ClockAttr.cpp + src/CronAttr.cpp + src/DateAttr.cpp + src/DayAttr.cpp + src/GenericAttr.cpp + src/LateAttr.cpp + src/NodeAttr.cpp + src/QueueAttr.cpp + src/RepeatAttr.cpp + src/TimeAttr.cpp + src/TodayAttr.cpp + src/Variable.cpp + src/VerifyAttr.cpp + src/Zombie.cpp + src/ZombieAttr.cpp +) +ecbuild_add_library( + TARGET + nodeattr + NOINSTALL + TYPE STATIC + SOURCES + ${srcs} + PUBLIC_INCLUDES + src + PUBLIC_LIBS + core + Boost::date_time +) target_clangformat(nodeattr) -file( GLOB test_srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "test/*.cpp" ) - -# libboost_unit_test_framework undefined reference to `clock_gettime', ${LIBRT} needed for boost 1.71 -ecbuild_add_test( TARGET u_anattr - SOURCES ${test_srcs} - INCLUDES src ${Boost_INCLUDE_DIRS} - LIBS nodeattr ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS u_acore - ) +set(test_srcs + # Sources + test/TestAttributes_main.cpp + test/TestAttrSerialization.cpp + test/TestCron.cpp + test/TestDateAttr.cpp + test/TestDayAttr.cpp + test/TestLabel.cpp + test/TestLateAttr.cpp + test/TestMigration.cpp + test/TestRepeat.cpp + test/TestSizeOf.cpp + test/TestTimeAttr.cpp + test/TestTodayAttr.cpp + test/TestVariable.cpp + test/TestZombieAttr.cpp +) -target_clangformat(u_anattr CONDITION ENABLE_TESTS) +ecbuild_add_test( + TARGET + u_anattr + SOURCES + ${test_srcs} + LIBS + nodeattr + TEST_DEPENDS + u_acore + Boost::boost # Boost header-only libraries must be available (namely unit_test_framework) +) +target_clangformat(u_anattr + CONDITION ENABLE_TESTS +) diff --git a/ANattr/test/TestAttrSerialization.cpp b/ANattr/test/TestAttrSerialization.cpp index e6adc431d..a008fe0d9 100644 --- a/ANattr/test/TestAttrSerialization.cpp +++ b/ANattr/test/TestAttrSerialization.cpp @@ -1,5 +1,3 @@ -#define BOOST_TEST_MODULE TestANattr - /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // Name : // Author : Avi diff --git a/ANattr/test/TestAttributes_main.cpp b/ANattr/test/TestAttributes_main.cpp new file mode 100644 index 000000000..28ca1f9d4 --- /dev/null +++ b/ANattr/test/TestAttributes_main.cpp @@ -0,0 +1,12 @@ +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ + +#define BOOST_TEST_MODULE TestAttributes +#include diff --git a/ANode/CMakeLists.txt b/ANode/CMakeLists.txt index cfef82add..42299aed3 100644 --- a/ANode/CMakeLists.txt +++ b/ANode/CMakeLists.txt @@ -1,101 +1,365 @@ -# Note: -# If new src or test cpp files are added make sure you touch this file +# +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # -file(GLOB srcs - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - "src/*.cpp" "src/*.hpp" "parser/src/*.cpp" "parser/src/*.hpp") - -ecbuild_add_library( TARGET node - NOINSTALL - TYPE STATIC - SOURCES ${srcs} - ) -target_link_libraries(node PRIVATE nodeattr core) -target_include_directories(node PUBLIC ../ACore/src - ../ANattr/src - src - parser/src) +set(srcs + # Headers + src/AbstractObserver.hpp + src/Alias.hpp + src/Aspect.hpp + src/Attr.hpp + src/AutoRestoreAttr.hpp + src/ClientSuiteMgr.hpp + src/ClientSuites.hpp + src/CmdContext.hpp + src/Defs.hpp + src/DefsDelta.hpp + src/EcfFile.hpp + src/ExprAst.hpp + src/ExprAstVisitor.hpp + src/ExprDuplicate.hpp + src/ExprParser.hpp + src/Expression.hpp + src/Family.hpp + src/Flag.hpp + src/InLimit.hpp + src/InLimitMgr.hpp + src/JobCreationCtrl.hpp + src/JobProfiler.hpp + src/Jobs.hpp + src/JobsParam.hpp + src/Limit.hpp + src/LimitFwd.hpp + src/Memento.hpp + src/MiscAttrs.hpp + src/Node.hpp + src/NodeContainer.hpp + src/NodeFwd.hpp + src/NodeState.hpp + src/NodeStats.hpp + src/NodeTreeVisitor.hpp + src/ResolveExternsVisitor.hpp + src/ServerState.hpp + src/Signal.hpp + src/Submittable.hpp + src/Suite.hpp + src/SuiteChanged.hpp + src/System.hpp + src/Task.hpp + src/TaskScriptGenerator.hpp + src/move_peer.hpp + parser/src/AutoArchiveParser.hpp + parser/src/AutoCancelParser.hpp + parser/src/AutoRestoreParser.hpp + parser/src/CalendarParser.hpp + parser/src/ClockParser.hpp + parser/src/CronParser.hpp + parser/src/DateParser.hpp + parser/src/DayParser.hpp + parser/src/DefsParser.hpp + parser/src/DefsStateParser.hpp + parser/src/DefsStatusParser.hpp + parser/src/DefsStructureParser.hpp + parser/src/EventParser.hpp + parser/src/ExternParser.hpp + parser/src/GenericParser.hpp + parser/src/InlimitParser.hpp + parser/src/LabelParser.hpp + parser/src/LateParser.hpp + parser/src/LimitParser.hpp + parser/src/MeterParser.hpp + parser/src/Parser.hpp + parser/src/QueueParser.hpp + parser/src/RepeatParser.hpp + parser/src/TimeParser.hpp + parser/src/TodayParser.hpp + parser/src/TriggerParser.hpp + parser/src/VariableParser.hpp + parser/src/VerifyParser.hpp + parser/src/ZombieAttrParser.hpp + # Sources + src/Alias.cpp + src/Attr.cpp + src/AutoRestoreAttr.cpp + src/ClientSuiteMgr.cpp + src/ClientSuites.cpp + src/CmdContext.cpp + src/Defs.cpp + src/DefsDelta.cpp + src/EcfFile.cpp + src/ExprAst.cpp + src/ExprAstVisitor.cpp + src/ExprDuplicate.cpp + src/ExprParser.cpp + src/Expression.cpp + src/Family.cpp + src/Flag.cpp + src/InLimit.cpp + src/InLimitMgr.cpp + src/JobCreationCtrl.cpp + src/JobProfiler.cpp + src/Jobs.cpp + src/JobsParam.cpp + src/Limit.cpp + src/Memento.cpp + src/MiscAttrs.cpp + src/Node.cpp + src/NodeAdd.cpp + src/NodeChange.cpp + src/NodeContainer.cpp + src/NodeDelete.cpp + src/NodeFind.cpp + src/NodeMemento.cpp + src/NodeStats.cpp + src/NodeTime.cpp + src/NodeTreeVisitor.cpp + src/ResolveExternsVisitor.cpp + src/ServerState.cpp + src/Signal.cpp + src/Submittable.cpp + src/Suite.cpp + src/SuiteChanged.cpp + src/System.cpp + src/Task.cpp + src/TaskScriptGenerator.cpp + parser/src/AutoArchiveParser.cpp + parser/src/AutoCancelParser.cpp + parser/src/AutoRestoreParser.cpp + parser/src/CalendarParser.cpp + parser/src/ClockParser.cpp + parser/src/CronParser.cpp + parser/src/DateParser.cpp + parser/src/DayParser.cpp + parser/src/DefsParser.cpp + parser/src/DefsStateParser.cpp + parser/src/DefsStatusParser.cpp + parser/src/DefsStructureParser.cpp + parser/src/EventParser.cpp + parser/src/ExternParser.cpp + parser/src/GenericParser.cpp + parser/src/InlimitParser.cpp + parser/src/LabelParser.cpp + parser/src/LateParser.cpp + parser/src/LimitParser.cpp + parser/src/MeterParser.cpp + parser/src/Parser.cpp + parser/src/QueueParser.cpp + parser/src/RepeatParser.cpp + parser/src/TimeParser.cpp + parser/src/TodayParser.cpp + parser/src/TriggerParser.cpp + parser/src/VariableParser.cpp + parser/src/VerifyParser.cpp + parser/src/ZombieAttrParser.cpp +) +ecbuild_add_library( + TARGET + node + NOINSTALL + TYPE STATIC + SOURCES + ${srcs} + PUBLIC_INCLUDES + src + parser/src + PUBLIC_LIBS + nodeattr +) target_clangformat(node) -add_subdirectory( parser ) - -# Use following to populate list: -# cd $WK/ANode -# find test -name \*.cpp | sort - -# no way to exclude file ? -#file( GLOB test_srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "test/*.cpp" ) - -list( APPEND test_srcs -# HEADERS -test/MyDefsFixture.hpp -# SOURCES -test/Test_ECFLOW-195.cpp -test/Test_ECFLOW-247.cpp -test/Test_ECFLOW-417.cpp -test/TestAdd.cpp -test/TestAlias.cpp -test/TestAssignmentOperator.cpp -test/TestChangeMgrSingleton.cpp -test/TestClientSuiteMgr.cpp -test/TestCopyConstructor.cpp -test/TestDefStatus.cpp -test/TestDefs.cpp -test/TestEcfFile.cpp -test/TestEcfFileLocator.cpp -test/TestEnviromentSubstitution.cpp -test/TestExprParser.cpp -test/TestExprRepeatDateArithmetic.cpp -test/TestExprRepeatDateListArithmetic.cpp -test/TestFindAbsNodePath.cpp -test/TestFlag.cpp -test/TestHistoryParser.cpp -test/TestInLimit.cpp -test/TestJobCreator.cpp -test/TestJobProfiler.cpp -test/TestLimit.cpp -test/TestMigration.cpp -test/TestMovePeer.cpp -test/TestMissNextTimeSlot.cpp -test/TestNodeBeginReque.cpp -test/TestNodeState.cpp -test/TestOrder.cpp -test/TestPersistence.cpp -test/TestPreProcessing.cpp -test/TestRepeatWithTimeDependencies.cpp -test/TestReplace.cpp -test/TestSetState.cpp -test/TestSystem.cpp -test/TestTaskScriptGenerator.cpp -test/TestTimeDependencies.cpp -test/TestVariableGeneration.cpp -test/TestVariableInheritance.cpp -test/TestVariableSubstitution.cpp -test/TestVariableSubstitutionDefs.cpp -test/TestZombies.cpp + +set(test_srcs + # Headers + test/MyDefsFixture.hpp + # Sources + test/TestAdd.cpp + test/TestAlias.cpp + test/TestAssignmentOperator.cpp + test/TestChangeMgrSingleton.cpp + test/TestClientSuiteMgr.cpp + test/TestCopyConstructor.cpp + test/TestDefStatus.cpp + test/TestDefs.cpp + test/TestEcfFile.cpp + test/TestEcfFileLocator.cpp + test/TestEnviromentSubstitution.cpp + test/TestExprParser.cpp + test/TestExprRepeatDateArithmetic.cpp + test/TestExprRepeatDateListArithmetic.cpp + test/TestFindAbsNodePath.cpp + test/TestFlag.cpp + test/TestHistoryParser.cpp + test/TestInLimit.cpp + test/TestJobCreator.cpp + test/TestJobProfiler.cpp + test/TestLimit.cpp + test/TestMigration.cpp + test/TestMissNextTimeSlot.cpp + test/TestMovePeer.cpp + test/TestNodeBeginReque.cpp + test/TestNodeState.cpp + test/TestNode_main.cpp # test entry point + test/TestOrder.cpp + test/TestPersistence.cpp + test/TestPreProcessing.cpp + test/TestRepeatWithTimeDependencies.cpp + test/TestReplace.cpp + test/TestSetState.cpp + test/TestSystem.cpp + test/TestTaskScriptGenerator.cpp + test/TestTimeDependencies.cpp + test/TestVariableGeneration.cpp + test/TestVariableInheritance.cpp + test/TestVariableSubstitution.cpp + test/TestVariableSubstitutionDefs.cpp + test/TestZombies.cpp + test/Test_ECFLOW-195.cpp + test/Test_ECFLOW-247.cpp + test/Test_ECFLOW-417.cpp ) -# libboost_unit_test_framework undefined reference to `clock_gettime', ${LIBRT} needed for boost 1.71 -ecbuild_add_test(TARGET u_anode - SOURCES ${test_srcs} - INCLUDES ${Boost_INCLUDE_DIRS} - LIBS node ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS u_anattr - ) +ecbuild_add_test( + TARGET + u_anode + SOURCES + ${test_srcs} + LIBS + node + Boost::boost # Boost header-only libraries must be available (namely unit_test_framework) + TEST_DEPENDS + u_anattr +) +target_clangformat(u_anode + CONDITION ENABLE_TESTS) + -target_clangformat(u_anode CONDITION ENABLE_TESTS) +set(test_srcs + # Headers + parser/test/PersistHelper.hpp + # Sources + parser/test/PersistHelper.cpp + parser/test/TestAutoAddExterns.cpp + parser/test/TestDefsStructurePersistAndReload.cpp + parser/test/TestMementoPersistAndReload.cpp + parser/test/TestMigration.cpp + parser/test/TestParser.cpp + parser/test/TestParser_main.cpp # test entry point + parser/test/TestVariableParsing.cpp +) +ecbuild_add_test( + TARGET + u_aparser + SOURCES + ${test_srcs} + INCLUDES + test + LIBS + node + Boost::boost # Boost header-only libraries must be available (namely unit_test_framework) + TEST_DEPENDS + u_anode +) +target_clangformat(u_aparser + CONDITION ENABLE_TESTS +) if (ENABLE_ALL_TESTS) - list( APPEND stest_srcs test/TestSingleExprParse.cpp ) - ecbuild_add_test( TARGET u_anode_stest - SOURCES ${stest_srcs} - INCLUDES ${Boost_INCLUDE_DIRS} - LIBS node ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS u_anattr - ) - target_clangformat(u_anode_stest CONDITION ENABLE_TESTS) + set(test_srcs + test/TestSingleExprParse.cpp + test/TestSingleExprParse_main.cpp # test entry point + ) + + ecbuild_add_test( + TARGET + u_anode_stest + SOURCES + ${test_srcs} + LIBS + node + Boost::boost # Boost header-only libraries must be available (namely unit_test_framework) + TEST_DEPENDS + u_anattr + ) + target_clangformat(u_anode_stest + CONDITION ENABLE_TESTS + ) + + + set(test_srcs + # Headers + parser/test/PersistHelper.hpp + # Sources + parser/test/PersistHelper.cpp + parser/test/TestParserPerformance_main.cpp # test entry point + parser/test/TestSingleDefsFile.cpp + ) + + ecbuild_add_test( + TARGET + perf_aparser + SOURCES + ${test_srcs} + LIBS + node + Boost::boost # Boost header-only libraries must be available (namely unit_test_framework) + Boost::timer + ) + target_clangformat(perf_aparser + CONDITION ENABLE_TESTS + ) + + + set(test_srcs + # Headers + parser/test/PersistHelper.hpp + # Sources + parser/test/ParseTimer.cpp + parser/test/PersistHelper.cpp + ) + + # The following is not technically a test (as it makes no checks), + # but a tool to measure the time it takes to parse 'mega.def' file + ecbuild_add_test( + TARGET + perf_aparser_timer + ARGS + ${CMAKE_CURRENT_SOURCE_DIR}/test/data/single_defs/mega.def + SOURCES + ${test_srcs} + LIBS + node + Boost::boost # Boost header-only libraries must be available + Boost::timer + ) + target_clangformat(perf_aparser_timer + CONDITION ENABLE_TESTS + ) + + # The following is not technically a test (as it makes no checks), + # but a tool to parse 'mega.def' file + set(test_srcs + parser/test/ParseOnly.cpp + ) + ecbuild_add_test( + TARGET + perf_aparser_only + ARGS + ${CMAKE_CURRENT_SOURCE_DIR}/test/data/single_defs/mega.def + SOURCES + ${test_srcs} + LIBS + node + Boost::boost # Boost header-only libraries must be available (namely unit_test_framework) + ) + target_clangformat(perf_aparser_only + CONDITION ENABLE_TESTS + ) + endif() diff --git a/ANode/parser/CMakeLists.txt b/ANode/parser/CMakeLists.txt deleted file mode 100644 index 5814f9626..000000000 --- a/ANode/parser/CMakeLists.txt +++ /dev/null @@ -1,92 +0,0 @@ -# Note: -# If new src or test cpp files are added make sure you touch this file -# - -# =================================================================== -# Use following to populate list: -# cd $WK/ANode/parser -# find test -name \*.cpp | sort -list( APPEND test_srcs - # HEADERS - test/PersistHelper.hpp - # SOURCES - test/PersistHelper.cpp - test/TestAutoAddExterns.cpp - test/TestDefsStructurePersistAndReload.cpp - test/TestMementoPersistAndReload.cpp - test/TestMigration.cpp - test/TestParser.cpp - test/TestVariableParsing.cpp -) -ecbuild_add_test( TARGET u_aparser - SOURCES ${test_srcs} - LIBS node nodeattr core - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} - INCLUDES src - ../../ACore/src - ../../ANattr/src - ../test # ANode/test - ../src # ANode/src - ${Boost_INCLUDE_DIRS} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS u_anode - ) -target_clangformat(u_aparser CONDITION ENABLE_TESTS) - -if (ENABLE_ALL_TESTS) - # - # Tests parser for a single defs file but with a range of tests - # - list( APPEND t2_src test/TestSingleDefsFile.cpp test/PersistHelper.cpp ) - ecbuild_add_test( TARGET perf_aparser - SOURCES ${t2_src} - LIBS node nodeattr core - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} - ${Boost_TIMER_LIBRARY} ${Boost_CHRONO_LIBRARY} ${LIBRT} - INCLUDES src - ../../ACore/src - ../../ANattr/src - ../test # ANode/test - ../src # ANode/src - ${Boost_INCLUDE_DIRS} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - ) - target_clangformat(perf_aparser CONDITION ENABLE_TESTS) - - # - # Timer for arbitary defs file, - # - list( APPEND t3_src test/ParseTimer.cpp test/PersistHelper.cpp ) - ecbuild_add_test( TARGET perf_aparser_timer - ARGS ${CMAKE_CURRENT_SOURCE_DIR}/test/data/single_defs/mega.def - SOURCES ${t3_src} - LIBS node nodeattr core - ${Boost_TIMER_LIBRARY} ${Boost_CHRONO_LIBRARY} ${LIBRT} - INCLUDES src - ../../ACore/src - ../../ANattr/src - ../src # ANode/src - ../test # ANode/test - ${Boost_INCLUDE_DIRS} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - ) - target_clangformat(perf_aparser_timer CONDITION ENABLE_TESTS) - # - # Tests parser for a single defs file. - # - list( APPEND t4_src test/ParseOnly.cpp ) - ecbuild_add_test( TARGET perf_aparser_only - ARGS ${CMAKE_CURRENT_SOURCE_DIR}/test/data/single_defs/mega.def - SOURCES ${t4_src} - LIBS node nodeattr core - INCLUDES src - ../../ACore/src - ../../ANattr/src - ../src # ANode/src - ../test # ANode/test - ${Boost_INCLUDE_DIRS} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - ) - target_clangformat(perf_aparser_only CONDITION ENABLE_TESTS) - -endif() diff --git a/ANode/parser/test/TestParser.cpp b/ANode/parser/test/TestParser.cpp index 1b6ac91fa..db7573b16 100644 --- a/ANode/parser/test/TestParser.cpp +++ b/ANode/parser/test/TestParser.cpp @@ -1,4 +1,4 @@ -#define BOOST_TEST_MODULE TestParser + /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // Name : Request // Author : Avi @@ -19,6 +19,7 @@ #include #include + #include #include "Defs.hpp" diff --git a/ANode/parser/test/TestParserPerformance_main.cpp b/ANode/parser/test/TestParserPerformance_main.cpp new file mode 100644 index 000000000..4ed368daa --- /dev/null +++ b/ANode/parser/test/TestParserPerformance_main.cpp @@ -0,0 +1,12 @@ +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ + +#define BOOST_TEST_MODULE TestParserPerformance +#include diff --git a/ANode/parser/test/TestParser_main.cpp b/ANode/parser/test/TestParser_main.cpp new file mode 100644 index 000000000..83cf59ab9 --- /dev/null +++ b/ANode/parser/test/TestParser_main.cpp @@ -0,0 +1,12 @@ +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ + +#define BOOST_TEST_MODULE TestParser +#include diff --git a/ANode/parser/test/TestSingleDefsFile.cpp b/ANode/parser/test/TestSingleDefsFile.cpp index 532fe24c9..3e55ef494 100644 --- a/ANode/parser/test/TestSingleDefsFile.cpp +++ b/ANode/parser/test/TestSingleDefsFile.cpp @@ -1,5 +1,3 @@ -#define BOOST_TEST_MODULE TestParser - //============================================================================ // Name : // Author : Avi @@ -23,6 +21,7 @@ #include #include #include + #include #include diff --git a/ANode/test/TestExprParser.cpp b/ANode/test/TestExprParser.cpp index e525ecbf8..44237c03f 100644 --- a/ANode/test/TestExprParser.cpp +++ b/ANode/test/TestExprParser.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE TestNode /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // Name : // Author : Avi diff --git a/ANode/test/TestNode_main.cpp b/ANode/test/TestNode_main.cpp new file mode 100644 index 000000000..f2af1407b --- /dev/null +++ b/ANode/test/TestNode_main.cpp @@ -0,0 +1,12 @@ +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ + +#define BOOST_TEST_MODULE TestNode +#include diff --git a/ANode/test/TestSingleExprParse.cpp b/ANode/test/TestSingleExprParse.cpp index b5b4d0bb5..e77b94a3f 100644 --- a/ANode/test/TestSingleExprParse.cpp +++ b/ANode/test/TestSingleExprParse.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE TestSingle /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // Name : // Author : Avi @@ -19,6 +18,7 @@ #include #include #include // requires boost date and time lib, for to_simple_string + #include #include "ExprAst.hpp" diff --git a/ANode/test/TestSingleExprParse_main.cpp b/ANode/test/TestSingleExprParse_main.cpp new file mode 100644 index 000000000..9719ea8e7 --- /dev/null +++ b/ANode/test/TestSingleExprParse_main.cpp @@ -0,0 +1,12 @@ +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ + +#define BOOST_TEST_MODULE TestSingleExpression +#include diff --git a/Base/CMakeLists.txt b/Base/CMakeLists.txt index 68c91afcd..d4b517f6a 100644 --- a/Base/CMakeLists.txt +++ b/Base/CMakeLists.txt @@ -1,189 +1,206 @@ - # ======================================================= - # to list all sources to build use: - # cd $WK/Base - # find src -name \*.cpp >> CMakeLists.txt - # ======================================================= - list( APPEND srcs - # HEADERS - src/AbstractClientEnv.hpp - src/AbstractServer.hpp - src/Client.hpp - src/ClientOptionsParser.hpp - src/ClientToServerRequest.hpp - src/Cmd.hpp - src/Connection.hpp - src/Gnuplot.hpp - src/ServerReply.hpp - src/ServerToClientResponse.hpp - src/Stats.hpp - src/WhyCmd.hpp - src/ZombieCtrl.hpp - src/cts/ClientToServerCmd.hpp - src/cts/CtsApi.hpp - src/cts/CtsCmdRegistry.hpp - src/cts/EditHistoryMgr.hpp - src/cts/TaskApi.hpp - src/stc/BlockClientZombieCmd.hpp - src/stc/DefsCache.hpp - src/stc/DefsCmd.hpp - src/stc/ErrorCmd.hpp - src/stc/GroupSTCCmd.hpp - src/stc/PreAllocatedReply.hpp - src/stc/SClientHandleCmd.hpp - src/stc/SClientHandleSuitesCmd.hpp - src/stc/SNewsCmd.hpp - src/stc/SNodeCmd.hpp - src/stc/SServerLoadCmd.hpp - src/stc/SStatsCmd.hpp - src/stc/SStringCmd.hpp - src/stc/SStringVecCmd.hpp - src/stc/SSuitesCmd.hpp - src/stc/SSyncCmd.hpp - src/stc/ServerToClientCmd.hpp - src/stc/StcCmd.hpp - src/stc/ZombieGetCmd.hpp - # SOURCES - src/ZombieCtrl.cpp - src/Stats.cpp - src/Client.cpp - src/ClientOptionsParser.cpp - src/ServerReply.cpp - src/Connection.cpp - src/stc/BlockClientZombieCmd.cpp - src/stc/DefsCache.cpp - src/stc/DefsCmd.cpp - src/stc/PreAllocatedReply.cpp - src/stc/SStringVecCmd.cpp - src/stc/StcCmd.cpp - src/stc/SSuitesCmd.cpp - src/stc/SClientHandleCmd.cpp - src/stc/SStringCmd.cpp - src/stc/ServerToClientCmd.cpp - src/stc/SClientHandleSuitesCmd.cpp - src/stc/SServerLoadCmd.cpp - src/stc/SNodeCmd.cpp - src/stc/SStatsCmd.cpp - src/stc/SSyncCmd.cpp - src/stc/SNewsCmd.cpp - src/stc/ErrorCmd.cpp - src/stc/GroupSTCCmd.cpp - src/stc/ZombieGetCmd.cpp - src/ClientToServerRequest.cpp - src/Gnuplot.cpp - src/WhyCmd.cpp - src/ServerToClientResponse.cpp - src/cts/CSyncCmd.cpp - src/cts/ZombieCmd.cpp - src/cts/OrderNodeCmd.cpp - src/cts/CheckPtCmd.cpp - src/cts/CtsNodeCmd.cpp - src/cts/GroupCTSCmd.cpp - src/cts/UserCmd.cpp - src/cts/ClientHandleCmd.cpp - src/cts/PlugCmd.cpp - src/cts/QueryCmd.cpp - src/cts/ForceCmd.cpp - src/cts/LoadDefsCmd.cpp - src/cts/CFileCmd.cpp - src/cts/ShowCmd.cpp - src/cts/CtsCmd.cpp - src/cts/TaskApi.cpp - src/cts/EditScriptCmd.cpp - src/cts/FreeDepCmd.cpp - src/cts/PathsCmd.cpp - src/cts/DeleteCmd.cpp - src/cts/EditHistoryMgr.cpp - src/cts/LogMessageCmd.cpp - src/cts/CtsApi.cpp - src/cts/ReplaceNodeCmd.cpp - src/cts/RequeueNodeCmd.cpp - src/cts/BeginCmd.cpp - src/cts/LogCmd.cpp - src/cts/AlterCmd.cpp - src/cts/TaskCmds.cpp - src/cts/CtsCmdRegistry.cpp - src/cts/RunNodeCmd.cpp - src/cts/ClientToServerCmd.cpp - src/cts/ServerVersionCmd.cpp -) - -if(OPENSSL_FOUND) - list( APPEND srcs - # HEADERS - src/Openssl.hpp - src/ssl_connection.hpp - src/SslClient.hpp - # SOURCES - src/Openssl.cpp - src/ssl_connection.cpp - src/SslClient.cpp - ) -endif() +# +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# -ecbuild_add_library( TARGET base - NOINSTALL - TYPE STATIC - SOURCES ${srcs} - ) - -# This ensures that for debug config, we only link with debug boost libs, for other configs, we link with optimised boost libs -target_link_libraries(base node nodeattr core ${Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE}) -target_include_directories(base PUBLIC src - ../ACore/src - ../ANattr/src - ../ANode/src - ../Base/src - ../Base/src/cts - ../Base/src/stc ) +set(srcs + # Headers + src/AbstractClientEnv.hpp + src/AbstractServer.hpp + src/Client.hpp + src/ClientOptionsParser.hpp + src/ClientToServerRequest.hpp + src/Cmd.hpp + src/Connection.hpp + src/Gnuplot.hpp + src/ServerReply.hpp + src/ServerToClientResponse.hpp + src/Stats.hpp + src/WhyCmd.hpp + src/ZombieCtrl.hpp + $<$:src/Openssl.hpp> + $<$:src/ssl_connection.hpp> + $<$:src/SslClient.hpp> + src/cts/ClientToServerCmd.hpp + src/cts/CtsApi.hpp + src/cts/CtsCmdRegistry.hpp + src/cts/EditHistoryMgr.hpp + src/cts/TaskApi.hpp + src/stc/BlockClientZombieCmd.hpp + src/stc/DefsCache.hpp + src/stc/DefsCmd.hpp + src/stc/ErrorCmd.hpp + src/stc/GroupSTCCmd.hpp + src/stc/PreAllocatedReply.hpp + src/stc/SClientHandleCmd.hpp + src/stc/SClientHandleSuitesCmd.hpp + src/stc/SNewsCmd.hpp + src/stc/SNodeCmd.hpp + src/stc/SServerLoadCmd.hpp + src/stc/SStatsCmd.hpp + src/stc/SStringCmd.hpp + src/stc/SStringVecCmd.hpp + src/stc/SSuitesCmd.hpp + src/stc/SSyncCmd.hpp + src/stc/ServerToClientCmd.hpp + src/stc/StcCmd.hpp + src/stc/ZombieGetCmd.hpp + # Sources + src/Client.cpp + src/ClientOptionsParser.cpp + src/ClientToServerRequest.cpp + src/Connection.cpp + src/Gnuplot.cpp + src/ServerReply.cpp + src/ServerToClientResponse.cpp + src/Stats.cpp + src/WhyCmd.cpp + src/ZombieCtrl.cpp + $<$:src/Openssl.cpp> + $<$:src/ssl_connection.cpp> + $<$:src/SslClient.cpp> + src/cts/AlterCmd.cpp + src/cts/BeginCmd.cpp + src/cts/CFileCmd.cpp + src/cts/CSyncCmd.cpp + src/cts/CheckPtCmd.cpp + src/cts/ClientHandleCmd.cpp + src/cts/ClientToServerCmd.cpp + src/cts/CtsApi.cpp + src/cts/CtsCmd.cpp + src/cts/CtsCmdRegistry.cpp + src/cts/CtsNodeCmd.cpp + src/cts/DeleteCmd.cpp + src/cts/EditHistoryMgr.cpp + src/cts/EditScriptCmd.cpp + src/cts/ForceCmd.cpp + src/cts/FreeDepCmd.cpp + src/cts/GroupCTSCmd.cpp + src/cts/LoadDefsCmd.cpp + src/cts/LogCmd.cpp + src/cts/LogMessageCmd.cpp + src/cts/OrderNodeCmd.cpp + src/cts/PathsCmd.cpp + src/cts/PlugCmd.cpp + src/cts/QueryCmd.cpp + src/cts/ReplaceNodeCmd.cpp + src/cts/RequeueNodeCmd.cpp + src/cts/RunNodeCmd.cpp + src/cts/ServerVersionCmd.cpp + src/cts/ShowCmd.cpp + src/cts/TaskApi.cpp + src/cts/TaskCmds.cpp + src/cts/UserCmd.cpp + src/cts/ZombieCmd.cpp + src/stc/BlockClientZombieCmd.cpp + src/stc/DefsCache.cpp + src/stc/DefsCmd.cpp + src/stc/ErrorCmd.cpp + src/stc/GroupSTCCmd.cpp + src/stc/PreAllocatedReply.cpp + src/stc/SClientHandleCmd.cpp + src/stc/SClientHandleSuitesCmd.cpp + src/stc/SNewsCmd.cpp + src/stc/SNodeCmd.cpp + src/stc/SServerLoadCmd.cpp + src/stc/SStatsCmd.cpp + src/stc/SStringCmd.cpp + src/stc/SStringVecCmd.cpp + src/stc/SSuitesCmd.cpp + src/stc/SSyncCmd.cpp + src/stc/ServerToClientCmd.cpp + src/stc/StcCmd.cpp + src/stc/ZombieGetCmd.cpp +) +ecbuild_add_library( + TARGET + base + NOINSTALL + TYPE STATIC + SOURCES + ${srcs} + PUBLIC_INCLUDES + src + src/cts + src/stc + PUBLIC_LIBS + node + Boost::boost # Boost header-only libraries must be available (namely asio) +) target_clangformat(base) -list( APPEND test_srcs - test/MockServer.hpp - test/TestHelper.hpp - test/TestAlterCmd.cpp - test/TestArchiveAndRestoreCmd.cpp - test/TestClientHandleCmd.cpp - test/TestCmd.cpp - test/TestDeleteNodeCmd.cpp - test/TestECFLOW-189.cpp - test/TestForceCmd.cpp - test/TestFreeDepCmd.cpp - test/TestInLimitAndLimit.cpp - test/TestLogCmd.cpp - test/TestMeterCmd.cpp - test/TestQueryCmd.cpp - test/TestQueueCmd.cpp - test/TestProgramOptions.cpp - test/TestRequest.cpp - test/TestRequeueNodeCmd.cpp - test/TestResolveDependencies.cpp - test/TestSSyncCmd_CH1.cpp - test/TestSSyncCmd.cpp - test/TestSSyncCmdOrder.cpp - test/TestStatsCmd.cpp +set(test_srcs + # Headers + test/MockServer.hpp + test/TestHelper.hpp + # Sources + test/TestAlterCmd.cpp + test/TestArchiveAndRestoreCmd.cpp + test/TestBase_main.cpp # test entry point + test/TestClientHandleCmd.cpp + test/TestCmd.cpp + test/TestDeleteNodeCmd.cpp + test/TestECFLOW-189.cpp + test/TestForceCmd.cpp + test/TestFreeDepCmd.cpp + test/TestInLimitAndLimit.cpp + test/TestLogCmd.cpp + test/TestMeterCmd.cpp + test/TestProgramOptions.cpp + test/TestQueryCmd.cpp + test/TestQueueCmd.cpp + test/TestRequest.cpp + test/TestRequeueNodeCmd.cpp + test/TestResolveDependencies.cpp + test/TestSSyncCmd.cpp + test/TestSSyncCmdOrder.cpp + test/TestSSyncCmd_CH1.cpp + test/TestStatsCmd.cpp ) -# if OpenSSL not enabled ${OPENSSL_LIBRARIES}, is empty -# libboost_unit_test_framework undefined reference to `clock_gettime', ${LIBRT} needed for boost 1.71 -ecbuild_add_test( TARGET u_base - SOURCES ${test_srcs} - LIBS base pthread ${OPENSSL_LIBRARIES} - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} - INCLUDES ../ANode/test ${Boost_INCLUDE_DIRS} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS u_aparser - ) +ecbuild_add_test( + TARGET + u_base + SOURCES + ${test_srcs} + INCLUDES + ../ANode/test + LIBS + base + Threads::Threads + $<$:OpenSSL::SSL> + TEST_DEPENDS + u_aparser +) +target_clangformat(u_base + CONDITION ENABLE_TESTS +) -target_clangformat(u_base CONDITION ENABLE_TESTS) +# The following is not technically a test (as it makes no checks), +# but a tool to measure the time it takes to generate a job file +if (ENABLE_ALL_TESTS) + set(test_srcs + # Sources + test/TestJobGenPerf.cpp + ) - if (ENABLE_ALL_TESTS) - ecbuild_add_test( TARGET perf_job_gen - SOURCES test/TestJobGenPerf.cpp - LIBS base nodeattr node core pthread - INCLUDES ../ANode/test ${Boost_INCLUDE_DIRS} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - ) - target_clangformat(perf_job_gen CONDITION ENABLE_TESTS) - endif() + ecbuild_add_test( + TARGET + perf_job_gen + SOURCES + ${test_srcs} + LIBS + base + Threads::Threads + ) + target_clangformat(perf_job_gen + CONDITION ENABLE_TESTS + ) +endif() diff --git a/Base/test/TestBase_main.cpp b/Base/test/TestBase_main.cpp new file mode 100644 index 000000000..8552d1615 --- /dev/null +++ b/Base/test/TestBase_main.cpp @@ -0,0 +1,12 @@ +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ + +#define BOOST_TEST_MODULE TestBase +#include diff --git a/Base/test/TestResolveDependencies.cpp b/Base/test/TestResolveDependencies.cpp index 5860755c8..32569643f 100644 --- a/Base/test/TestResolveDependencies.cpp +++ b/Base/test/TestResolveDependencies.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE TestBase //============================================================================ // Name : // Author : Avi diff --git a/CMakeLists.txt b/CMakeLists.txt index 557129014..7ddd5792f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ cmake_minimum_required( VERSION 3.12.0 FATAL_ERROR ) # =========================================================================== # Change the default if NO CMAKE_BUILD_TYPE specified if (NOT DEFINED CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release CACHE STRING "Build Configuration type" FORCE) + set(CMAKE_BUILD_TYPE Release CACHE STRING "Build Configuration type" FORCE) endif() find_package( ecbuild 3.4 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild ) # Before project() @@ -63,124 +63,127 @@ option( ENABLE_HTTP "Enable HTTP server (experimental)" ON ) option( ENABLE_UDP "Enable UDP server (experimental)" ON ) option( ENABLE_DOCS "Enable Documentation" OFF ) + +# ========================================================================================= +# Dependency: Qt # ========================================================================================= -# Qt for ecFlowUI. +# Qt for ecFlowUI. # Algorithm: we test for Qt6 - if it's there, then use it; otherwise look for Qt5. # if we don't find that, then we cannot build ecFlowUI. -# ========================================================================================= +# ----------------------------------------------------------------------------------------- if(ENABLE_UI) - ecbuild_info("") - ecbuild_info("------------------------------ Qt start ---------------------------") - ecbuild_info("ecFlowUI is enabled - searching for Qt6/Qt5") - ecbuild_info("To use a self-built Qt installation, try setting CMAKE_PREFIX_PATH") - - find_package(Qt6Widgets) - if( Qt6Widgets_FOUND ) - find_package(Qt6Core5Compat REQUIRED) - find_package(Qt6Gui REQUIRED) - find_package(Qt6Network REQUIRED) - find_package(Qt6Svg REQUIRED) - find_package(Qt6Charts) - - ecbuild_debug("Qt6 version ${Qt6Widgets_VERSION_STRING} was found") - set(ECFLOW_QT_INCLUDE_DIR ${Qt6Core5Compat_INCLUDE_DIRS} ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Gui_INCLUDE_DIRS} ${Qt6Network_INCLUDE_DIRS} ${Qt6Svg_INCLUDE_DIRS}) - set(ECFLOW_QT_LIBRARIES ${Qt6Core5Compat_LIBRARIES} ${Qt6Widgets_LIBRARIES} ${Qt6Gui_LIBRARIES} ${Qt6Network_LIBRARIES} ${Qt6Svg_LIBRARIES}) - set(ECFLOW_QT6 1) - add_definitions(-DECFLOW_QT6) - - if(Qt6Charts_FOUND) - ecbuild_info("Qt6Charts was found - the server log viewer will be built") - list(APPEND ECFLOW_QT_INCLUDE_DIR ${Qt6Charts_INCLUDE_DIRS}) - list(APPEND ECFLOW_QT_LIBRARIES ${Qt6Charts_LIBRARIES}) - set(ECFLOW_LOGVIEW 1) - add_definitions(-DECFLOW_LOGVIEW) - else() - ecbuild_info("Qt6Charts was not found - the server log viewer will not be built") - endif() + ecbuild_info("") + ecbuild_info("------------------------------ Qt start ---------------------------") + ecbuild_info("ecFlowUI is enabled - searching for Qt6/Qt5") + ecbuild_info("To use a self-built Qt installation, try setting CMAKE_PREFIX_PATH") + + find_package(Qt6Widgets) + if( Qt6Widgets_FOUND ) + find_package(Qt6Core5Compat REQUIRED) + find_package(Qt6Gui REQUIRED) + find_package(Qt6Network REQUIRED) + find_package(Qt6Svg REQUIRED) + find_package(Qt6Charts) + + ecbuild_debug("Qt6 version ${Qt6Widgets_VERSION_STRING} was found") + set(ECFLOW_QT_INCLUDE_DIR ${Qt6Core5Compat_INCLUDE_DIRS} ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Gui_INCLUDE_DIRS} ${Qt6Network_INCLUDE_DIRS} ${Qt6Svg_INCLUDE_DIRS}) + set(ECFLOW_QT_LIBRARIES ${Qt6Core5Compat_LIBRARIES} ${Qt6Widgets_LIBRARIES} ${Qt6Gui_LIBRARIES} ${Qt6Network_LIBRARIES} ${Qt6Svg_LIBRARIES}) + set(ECFLOW_QT6 1) + add_definitions(-DECFLOW_QT6) + + if(Qt6Charts_FOUND) + ecbuild_info("Qt6Charts was found - the server log viewer will be built") + list(APPEND ECFLOW_QT_INCLUDE_DIR ${Qt6Charts_INCLUDE_DIRS}) + list(APPEND ECFLOW_QT_LIBRARIES ${Qt6Charts_LIBRARIES}) + set(ECFLOW_LOGVIEW 1) + add_definitions(-DECFLOW_LOGVIEW) else() - find_package(Qt5Widgets) - if (Qt5Widgets_FOUND) - find_package(Qt5Gui REQUIRED) - find_package(Qt5Network REQUIRED) - find_package(Qt5Svg REQUIRED) - find_package(Qt5Charts) - - ecbuild_info("Qt5 version ${Qt5Widgets_VERSION_STRING} was found") - set(ECFLOW_QT_INCLUDE_DIR ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Svg_INCLUDE_DIRS}) - set(ECFLOW_QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Svg_LIBRARIES}) - set(ECFLOW_QT5 1) - add_definitions(-DECFLOW_QT5) - - if(Qt5Charts_FOUND) - ecbuild_info("Qt5Charts was found - the server log viewer will be built") - list(APPEND ECFLOW_QT_INCLUDE_DIR ${Qt5Charts_INCLUDE_DIRS}) - list(APPEND ECFLOW_QT_LIBRARIES ${Qt5Charts_LIBRARIES}) - set(ECFLOW_LOGVIEW 1) - add_definitions(-DECFLOW_LOGVIEW) - else() - ecbuild_info("Qt5Charts was not found - the server log viewer will not be built") - endif() - else() - ecbuild_critical("Qt5 Widgets, Network and Gui not found - these are required for ecFlowUI; or use -DENABLE_UI=OFF") - endif() + ecbuild_info("Qt6Charts was not found - the server log viewer will not be built") endif() + else() + find_package(Qt5Widgets) + if (Qt5Widgets_FOUND) + find_package(Qt5Gui REQUIRED) + find_package(Qt5Network REQUIRED) + find_package(Qt5Svg REQUIRED) + find_package(Qt5Charts) + + ecbuild_info("Qt5 version ${Qt5Widgets_VERSION_STRING} was found") + set(ECFLOW_QT_INCLUDE_DIR ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Svg_INCLUDE_DIRS}) + set(ECFLOW_QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Svg_LIBRARIES}) + set(ECFLOW_QT5 1) + add_definitions(-DECFLOW_QT5) + + if(Qt5Charts_FOUND) + ecbuild_info("Qt5Charts was found - the server log viewer will be built") + list(APPEND ECFLOW_QT_INCLUDE_DIR ${Qt5Charts_INCLUDE_DIRS}) + list(APPEND ECFLOW_QT_LIBRARIES ${Qt5Charts_LIBRARIES}) + set(ECFLOW_LOGVIEW 1) + add_definitions(-DECFLOW_LOGVIEW) + else() + ecbuild_info("Qt5Charts was not found - the server log viewer will not be built") + endif() + else() + ecbuild_critical("Qt5 Widgets, Network and Gui not found - these are required for ecFlowUI; or use -DENABLE_UI=OFF") + endif() + endif() - set(ECFLOW_QT 1) - add_definitions(-DQT_NO_KEYWORDS) # We need to disable keywords because there is a problem in using Qt and boost together. - ecbuild_info("------------------------------ Qt end----------------------------") - ecbuild_info("") + set(ECFLOW_QT 1) + add_definitions(-DQT_NO_KEYWORDS) # We need to disable keywords because there is a problem in using Qt and boost together. + ecbuild_info("------------------------------ Qt end----------------------------") + ecbuild_info("") endif() # sanity check - cannot set ENABLE_UI_BACKTRACE if UI is OFF if(ENABLE_UI_BACKTRACE AND (NOT ENABLE_UI)) - ecbuild_warn("Cannot ENABLE_UI_BACKTRACE if UI is not enabled") - set(ENABLE_UI_BACKTRACE OFF) + ecbuild_warn("Cannot ENABLE_UI_BACKTRACE if UI is not enabled") + set(ENABLE_UI_BACKTRACE OFF) endif() # sanity check - cannot set UI_BACKTRACE_EMAIL_ADDRESS_FILE if UI and ENABLE_UI_BACKTRACE are OFF if(UI_BACKTRACE_EMAIL_ADDRESS_FILE AND (NOT ENABLE_UI)) - ecbuild_warn("Cannot set UI_BACKTRACE_EMAIL_ADDRESS_FILE if UI is not enabled") - set(UI_BACKTRACE_EMAIL_ADDRESS_FILE) + ecbuild_warn("Cannot set UI_BACKTRACE_EMAIL_ADDRESS_FILE if UI is not enabled") + set(UI_BACKTRACE_EMAIL_ADDRESS_FILE) endif() # sanity check - cannot set UI_LOG_FILE if ENABLE_UI_USAGE_LOG is OFF if(UI_LOG_FILE AND (NOT ENABLE_UI_USAGE_LOG)) - ecbuild_warn("Cannot set UI_LOG_FILE if ENABLE_UI_USAGE_LOG is not enabled") - set(UI_LOG_FILE) + ecbuild_warn("Cannot set UI_LOG_FILE if ENABLE_UI_USAGE_LOG is not enabled") + set(UI_LOG_FILE) endif() # sanity check - if ENABLE_UI_USAGE_LOG is ON, we must also have UI_LOG_FILE if(ENABLE_UI_USAGE_LOG AND (NOT UI_LOG_FILE)) - ecbuild_error("If ENABLE_UI_USAGE_LOG is set, UI_LOG_FILE must also be set") + ecbuild_error("If ENABLE_UI_USAGE_LOG is set, UI_LOG_FILE must also be set") endif() # sanity check - if ENABLE_UI_USAGE_LOG is ON, we must also have UI_LOG_FILE if(ENABLE_UI_USAGE_LOG AND (NOT LOGUI_LOG_FILE)) - ecbuild_error("If ENABLE_UI_USAGE_LOG is set, LOGUI_LOG_FILE must also be set") + ecbuild_error("If ENABLE_UI_USAGE_LOG is set, LOGUI_LOG_FILE must also be set") endif() # sanity check - if ENABLE_UI_USAGE_LOG is ON, we must also have UI_LOG_SITE_TAG if(ENABLE_UI_USAGE_LOG AND (NOT UI_LOG_SITE_TAG)) - ecbuild_error("If ENABLE_UI_USAGE_LOG is set, UI_LOG_SITE_TAG must also be set") + ecbuild_error("If ENABLE_UI_USAGE_LOG is set, UI_LOG_SITE_TAG must also be set") endif() # sanity check - cannot set UI_SYSTEM_SERVERS_LIST if UI IS OFF if(UI_SYSTEM_SERVERS_LIST AND (NOT ENABLE_UI)) - ecbuild_warn("Cannot set UI_SYSTEM_SERVERS_LIST if UI is not enabled") - set(UI_SYSTEM_SERVERS_LIST) + ecbuild_warn("Cannot set UI_SYSTEM_SERVERS_LIST if UI is not enabled") + set(UI_SYSTEM_SERVERS_LIST) endif() if(ENABLE_HTTP AND NOT ENABLE_SERVER) - ecbuild_warn("ENABLE_SERVER is disabled, therefore HTTP_SERVER will also be disabled") - set(ENABLE_HTTP OFF) + ecbuild_warn("ENABLE_SERVER is disabled, therefore HTTP_SERVER will also be disabled") + set(ENABLE_HTTP OFF) endif() if(ENABLE_UDP AND NOT ENABLE_SERVER) - ecbuild_warn("ENABLE_SERVER is disabled, therefore UDP_SERVER will also be disabled") - set(ENABLE_UDP OFF) + ecbuild_warn("ENABLE_SERVER is disabled, therefore UDP_SERVER will also be disabled") + set(ENABLE_UDP OFF) endif() @@ -198,35 +201,42 @@ ecbuild_info( "ENABLE_UDP : ${ENABLE_UDP}" ) if (ENABLE_UI) - ecbuild_info( "ENABLE_UI_BACKTRACE : ${ENABLE_UI_BACKTRACE}" ) - if(UI_BACKTRACE_EMAIL_ADDRESS_FILE) - ecbuild_info( "UI_BACKTRACE_EMAIL_ADDRESS_FILE : ${UI_BACKTRACE_EMAIL_ADDRESS_FILE}" ) - endif() - - if(LOGUI_BACKTRACE_EMAIL_ADDRESS_FILE) - ecbuild_info( "LOGUI_BACKTRACE_EMAIL_ADDRESS_FILE : ${LOGUI_BACKTRACE_EMAIL_ADDRESS_FILE}" ) - endif() - - if(UI_SYSTEM_SERVERS_LIST) - ecbuild_info( "UI_SYSTEM_SERVERS_LIST : ${UI_SYSTEM_SERVERS_LIST}" ) - endif() - - ecbuild_info( "ENABLE_UI_USAGE_LOG : ${ENABLE_UI_USAGE_LOG}" ) - if(ENABLE_UI_USAGE_LOG) - ecbuild_info( "UI_LOG_FILE : ${UI_LOG_FILE}" ) - ecbuild_info( "LOGUI_LOG_FILE : ${LOGUI_LOG_FILE}" ) - ecbuild_info( "UI_LOG_SITE_TAG : ${UI_LOG_SITE_TAG}" ) - endif() + ecbuild_info( "ENABLE_UI_BACKTRACE : ${ENABLE_UI_BACKTRACE}" ) + if (UI_BACKTRACE_EMAIL_ADDRESS_FILE) + ecbuild_info( "UI_BACKTRACE_EMAIL_ADDRESS_FILE : ${UI_BACKTRACE_EMAIL_ADDRESS_FILE}" ) + endif() + + if(LOGUI_BACKTRACE_EMAIL_ADDRESS_FILE) + ecbuild_info( "LOGUI_BACKTRACE_EMAIL_ADDRESS_FILE : ${LOGUI_BACKTRACE_EMAIL_ADDRESS_FILE}" ) + endif() + + if(UI_SYSTEM_SERVERS_LIST) + ecbuild_info( "UI_SYSTEM_SERVERS_LIST : ${UI_SYSTEM_SERVERS_LIST}" ) + endif() + + ecbuild_info( "ENABLE_UI_USAGE_LOG : ${ENABLE_UI_USAGE_LOG}" ) + if(ENABLE_UI_USAGE_LOG) + ecbuild_info( "UI_LOG_FILE : ${UI_LOG_FILE}" ) + ecbuild_info( "LOGUI_LOG_FILE : ${LOGUI_LOG_FILE}" ) + ecbuild_info( "UI_LOG_SITE_TAG : ${UI_LOG_SITE_TAG}" ) + endif() endif() ecbuild_info("") # ========================================================================================= -# cereal is embedded +# Dependency: Cereal (embedded) # ========================================================================================= include_directories( ${CMAKE_SOURCE_DIR}/cereal/include ) - +# ========================================================================================= +# Dependency: pthreads +# ========================================================================================= +find_package(Threads REQUIRED) + +# ========================================================================================= +# Dependency: Boost +# ========================================================================================= message( STATUS "====================================================================================================================" ) message( STATUS "BOOST" ) # this can help in some situations: @@ -267,15 +277,15 @@ find_package( Boost ${ECFLOW_BOOST_VERSION} ) # HAVE_TESTS is defined if ecbuild ENABLE_TESTS is set, (by default this is set) if(HAVE_TESTS) - list(APPEND _boost_testlibs unit_test_framework test_exec_monitor ) + list(APPEND _boost_testlibs unit_test_framework test_exec_monitor ) endif() # Need timer for boost::time::cpu_timer this needs boost:chrono, which need librt These are used in the test only if ( Boost_VERSION_STRING VERSION_LESS "1.69.0" ) - find_package( Boost ${ECFLOW_BOOST_VERSION} REQUIRED COMPONENTS system timer chrono ${_boost_testlibs} filesystem program_options date_time ) + find_package( Boost ${ECFLOW_BOOST_VERSION} REQUIRED COMPONENTS system timer chrono ${_boost_testlibs} filesystem program_options date_time ) else() - # for boost version 1.69 or greater Boost.System is now header-only. - find_package( Boost ${ECFLOW_BOOST_VERSION} REQUIRED COMPONENTS timer chrono ${_boost_testlibs} filesystem program_options date_time ) + # for boost version 1.69 or greater Boost.System is now header-only. + find_package( Boost ${ECFLOW_BOOST_VERSION} REQUIRED COMPONENTS timer chrono ${_boost_testlibs} filesystem program_options date_time ) endif() ecbuild_info( "Boost_LIBRARIES : ${Boost_LIBRARIES}" ) @@ -284,8 +294,8 @@ ecbuild_info( "Boost_LIBRARIES : ${Boost_LIBRARIES}" ) # ?? # ======================================================================================= if (NOT "${CMAKE_PREFIX_PATH}" EQUAL "${_CMAKE_PREFIX_PATH_BACKUP}") - set (CMAKE_PREFIX_PATH ${_CMAKE_PREFIX_PATH_BACKUP}) # restore CMAKE_PREFIX_PATH - ecbuild_debug("Resetting CMAKE_PREFIX_PATH to ${CMAKE_PREFIX_PATH}") + set (CMAKE_PREFIX_PATH ${_CMAKE_PREFIX_PATH_BACKUP}) # restore CMAKE_PREFIX_PATH + ecbuild_debug("Resetting CMAKE_PREFIX_PATH to ${CMAKE_PREFIX_PATH}") endif() @@ -294,23 +304,23 @@ message( STATUS "=============================================================== message( STATUS "LIB RT needed by some test, boost_timer->boost_chrono-> -lrt" ) find_library(LIBRT rt) if(LIBRT) - message( STATUS "LIB RT FOUND" ) + message( STATUS "LIB RT FOUND" ) else() - # set to empty string to avoid lots of conditional around ecbuild_add_test - message( STATUS "LIB RT NOTFOUND -> LIBRT set to empty string for ecbuild_add_test" ) - set(LIBRT "") + # set to empty string to avoid lots of conditional around ecbuild_add_test + message( STATUS "LIB RT NOTFOUND -> LIBRT set to empty string for ecbuild_add_test" ) + set(LIBRT "") endif() message( STATUS "====================================================================================================================" ) message( STATUS "SSL" ) if (ENABLE_SSL) - find_package(OpenSSL REQUIRED) - if (OPENSSL_FOUND) - include_directories( ${OPENSSL_INCLUDE_DIR} ) - add_definitions( -DECF_OPENSSL ) - else() - ecbuild_warn("Can *not* find openssl libraries. ecflow will build without ssl support") - endif() + find_package(OpenSSL REQUIRED) + if (OPENSSL_FOUND) + include_directories( ${OPENSSL_INCLUDE_DIR} ) + add_definitions( -DECF_OPENSSL ) + else() + ecbuild_warn("Can *not* find openssl libraries. ecflow will build without ssl support") + endif() endif() # ========================================================================================= @@ -319,10 +329,10 @@ endif() if( CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]" ) - ecbuild_info( "INFO: DEBUG BUILD" ) + ecbuild_info( "INFO: DEBUG BUILD" ) - # Tell C/C++ that we're doing a debug build - add_definitions( -DDEBUG ) + # Tell C/C++ that we're doing a debug build + add_definitions( -DDEBUG ) endif() @@ -331,7 +341,7 @@ endif() # fatal error: recursive template instantiation exceeded maximum depth of 256 # ========================================================================================= if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024") endif() # ========================================================================================= @@ -351,25 +361,25 @@ add_subdirectory( Client ) add_subdirectory( Doc ) if (ENABLE_SERVER) - add_subdirectory( Server ) - add_subdirectory( tools ) - add_subdirectory( Test ) + add_subdirectory( Server ) + add_subdirectory( tools ) + add_subdirectory( Test ) endif() if (ENABLE_PYTHON) - if ( ENABLE_PYTHON_PTR_REGISTER ) - add_definitions( -DECF_ENABLE_PYTHON_PTR_REGISTER ) - endif() - add_subdirectory( Pyext ) -endif() - + if ( ENABLE_PYTHON_PTR_REGISTER ) + add_definitions( -DECF_ENABLE_PYTHON_PTR_REGISTER ) + endif() + add_subdirectory( Pyext ) +endif() + if (ENABLE_UI) - add_subdirectory( Viewer ) - add_subdirectory( share ) + add_subdirectory( Viewer ) + add_subdirectory( share ) endif() if (ENABLE_HTTP) - add_subdirectory( Http ) + add_subdirectory( Http ) endif() if (ENABLE_UDP) @@ -381,27 +391,27 @@ endif() # ========================================================================================= find_package(Doxygen) if (DOXYGEN_FOUND) - ecbuild_info( "DOXYGEN_FOUND - use 'make doxygen' first" ) + ecbuild_info( "DOXYGEN_FOUND - use 'make doxygen' first" ) - # exclude some dirs not related to documentation - set( DOXYGEN_EXCLUDE_PATTERNS */bin/* */bdir/* */Debug/* */test/* */Doc/* */doc/* */samples/* SCRATCH tools build_scripts cereal ) + # exclude some dirs not related to documentation + set( DOXYGEN_EXCLUDE_PATTERNS */bin/* */bdir/* */Debug/* */test/* */Doc/* */doc/* */samples/* SCRATCH tools build_scripts cereal ) - set( DOXYGEN_SOURCE_BROWSER YES) - set( DOXYGEN_EXTRACT_PRIVATE YES) - set( DOXYGEN_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Doc/doxygen") + set( DOXYGEN_SOURCE_BROWSER YES) + set( DOXYGEN_EXTRACT_PRIVATE YES) + set( DOXYGEN_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/Doc/doxygen") - # this target will only be built if specifically asked to. - # run "make doxygen" to create the doxygen documentation - doxygen_add_docs( - doxygen - ${PROJECT_SOURCE_DIR} - COMMENT "Generate documentation for ecFlow" - ) + # this target will only be built if specifically asked to. + # run "make doxygen" to create the doxygen documentation + doxygen_add_docs( + doxygen + ${PROJECT_SOURCE_DIR} + COMMENT "Generate documentation for ecFlow" + ) - # Add an install target to install the docs, *IF* the use has run 'make doxygen' - if (EXISTS ${DOXYGEN_OUTPUT_DIRECTORY}) - install(DIRECTORY ${DOXYGEN_OUTPUT_DIRECTORY} DESTINATION ${CMAKE_INSTALL_DOCDIR}) - endif() + # Add an install target to install the docs, *IF* the use has run 'make doxygen' + if (EXISTS ${DOXYGEN_OUTPUT_DIRECTORY}) + install(DIRECTORY ${DOXYGEN_OUTPUT_DIRECTORY} DESTINATION ${CMAKE_INSTALL_DOCDIR}) + endif() else () ecbuild_info("Doxygen need to be installed to generate the doxygen documentation") endif() @@ -410,30 +420,40 @@ endif() # tar ball, by default ecbuild will tar everything apart from hard wired directory called 'build' # hence we can tell it, what directories not to pack # ========================================================================================= -ecbuild_dont_pack( DIRS - .settings - bamboo - ACore/doc ANattr/doc ANode/doc Client/doc CSim/doc Pyext/doc Server/doc - ecbuild - SCRATCH - CUSTOMER - build_scripts/nightly build_scripts/test_bench - Debug - bdir - bdir_xcode - bin - Doc/misc Doc/sphinx-examples +ecbuild_dont_pack( + DIRS + .settings + bamboo + ACore/doc + ANattr/doc + ANode/doc + Client/doc + CSim/doc + Pyext/doc + Server/doc + ecbuild + SCRATCH + CUSTOMER + build_scripts/nightly + build_scripts/test_bench + Debug + bdir + bdir_xcode + bin + Doc/misc + Doc/sphinx-examples ) # ignore eclipse files -ecbuild_dont_pack( FILES - .project - .cproject - .pydevproject - Pyext/.pydevproject - Pyext/samples/test.py - Pyext/samples/confluence_add_attachment.py - build_scripts/.pydevproject +ecbuild_dont_pack( + FILES + .project + .cproject + .pydevproject + Pyext/.pydevproject + Pyext/samples/test.py + Pyext/samples/confluence_add_attachment.py + build_scripts/.pydevproject ) # ========================================================================================= diff --git a/CSim/CMakeLists.txt b/CSim/CMakeLists.txt index 3cfee3565..c39c1fc91 100644 --- a/CSim/CMakeLists.txt +++ b/CSim/CMakeLists.txt @@ -1,72 +1,87 @@ -list( APPEND srcs - # HEADERS - src/Analyser.hpp - src/AstAnalyserVisitor.hpp - src/DefsAnalyserVisitor.hpp - src/FlatAnalyserVisitor.hpp - src/Simulator.hpp - src/SimulatorVisitor.hpp - # SOURCES - src/Analyser.cpp - src/AstAnalyserVisitor.cpp - src/DefsAnalyserVisitor.cpp - src/FlatAnalyserVisitor.cpp - src/Simulator.cpp - src/SimulatorVisitor.cpp -) -ecbuild_add_library( TARGET libsimu - NOINSTALL - TYPE STATIC - SOURCES ${srcs} - ) +# +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# -target_link_libraries(libsimu node nodeattr core) -target_include_directories(libsimu PUBLIC src - ../ACore/src - ../ANattr/src - ../ANode/src - ../Base/src +set(srcs + # Headers + src/Analyser.hpp + src/AstAnalyserVisitor.hpp + src/DefsAnalyserVisitor.hpp + src/FlatAnalyserVisitor.hpp + src/Simulator.hpp + src/SimulatorVisitor.hpp + # Sources + src/Analyser.cpp + src/AstAnalyserVisitor.cpp + src/DefsAnalyserVisitor.cpp + src/FlatAnalyserVisitor.cpp + src/Simulator.cpp + src/SimulatorVisitor.cpp +) +ecbuild_add_library( + TARGET + libsimu + NOINSTALL + TYPE STATIC + SOURCES + ${srcs} + PUBLIC_INCLUDES + src + PUBLIC_LIBS + node + nodeattr + core ) - target_clangformat(libsimu) -list( APPEND test_srcs - # HEADERS - test/TestUtil.hpp - # SOURCES - test/TestAutoArchive.cpp - test/TestAutoCancel.cpp - test/TestAutoRestore.cpp - test/TestMeter.cpp - test/TestTime.cpp - test/TestUtil.cpp - test/TestSimulator.cpp - test/TestAutoCancel.cpp - test/TestRepeat.cpp - test/TestToday.cpp - test/TestAnalysis.cpp +set(test_srcs + # Headers + test/TestUtil.hpp + # Sources + test/TestAnalysis.cpp + test/TestAutoArchive.cpp + test/TestAutoCancel.cpp + test/TestAutoCancel.cpp + test/TestAutoRestore.cpp + test/TestMeter.cpp + test/TestRepeat.cpp + test/TestSimulator.cpp + test/TestTime.cpp + test/TestToday.cpp + test/TestUtil.cpp +) +ecbuild_add_test( + TARGET + c_csim + SOURCES + ${test_srcs} + LIBS + libsimu + Threads::Threads + TEST_DEPENDS u_base ) -ecbuild_add_test( TARGET c_csim - SOURCES ${test_srcs} - LIBS libsimu - pthread - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} - INCLUDES ../ANode/test ${Boost_INCLUDE_DIRS} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS u_base - ) - target_clangformat(c_csim CONDITION ENABLE_TESTS) if (ENABLE_ALL_TESTS) - ecbuild_add_test( TARGET c_csim_single - SOURCES test/TestSingleSimulator.cpp test/TestUtil.cpp - LIBS libsimu - pthread - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} - INCLUDES ../ANode/test ${Boost_INCLUDE_DIRS} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS u_base - ) + + ecbuild_add_test( + TARGET + c_csim_single + SOURCES + test/TestSingleSimulator.cpp + test/TestUtil.cpp + LIBS + libsimu + Threads::Threads + TEST_DEPENDS + u_base + ) target_clangformat(c_csim_single CONDITION ENABLE_TESTS) + endif() diff --git a/CSim/test/TestSimulator.cpp b/CSim/test/TestSimulator.cpp index 5fa827d89..01cffd6b9 100644 --- a/CSim/test/TestSimulator.cpp +++ b/CSim/test/TestSimulator.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE TestSimulator //============================================================================ // Name : // Author : Avi @@ -19,7 +18,8 @@ #include #include -#include +#define BOOST_TEST_MODULE TestSimulator +#include #include "File.hpp" #include "Simulator.hpp" diff --git a/CSim/test/TestSingleSimulator.cpp b/CSim/test/TestSingleSimulator.cpp index a006ef27f..9e0ba4480 100644 --- a/CSim/test/TestSingleSimulator.cpp +++ b/CSim/test/TestSingleSimulator.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE TestSingleSimulator //============================================================================ // Name : // Author : Avi @@ -23,7 +22,8 @@ #include #include #include -#include +#define BOOST_TEST_MODULE TestSingleSimulator +#include #include "Defs.hpp" #include "Family.hpp" diff --git a/Client/CMakeLists.txt b/Client/CMakeLists.txt index 6b5248989..bd14e0d9e 100644 --- a/Client/CMakeLists.txt +++ b/Client/CMakeLists.txt @@ -1,66 +1,73 @@ - # ======================================================= - # LIB - # to list all sources to build use: - # cd $WK/Client - # find src -name \*.cpp --print - # ======================================================= - -# Excludes src/ClientMain.cpp -list( APPEND srcs - # HEADERS - src/ClientCmdCache.hpp - src/ClientEnvironment.hpp - src/ClientInvoker.hpp - src/ClientOptions.hpp - src/Help.hpp - src/Rtt.hpp - src/UrlCmd.hpp - # SOURCES - src/ClientCmdCache.cpp - src/Rtt.cpp - src/ClientEnvironment.cpp - src/ClientInvoker.cpp - src/Help.cpp - src/Rtt.cpp - src/ClientOptions.cpp - src/UrlCmd.cpp +# +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# + +set(srcs + # Headers + src/ClientCmdCache.hpp + src/ClientEnvironment.hpp + src/ClientInvoker.hpp + src/ClientOptions.hpp + src/Help.hpp + src/Rtt.hpp + src/UrlCmd.hpp + # Sources + src/ClientCmdCache.cpp + src/Rtt.cpp + src/ClientEnvironment.cpp + src/ClientInvoker.cpp + src/Help.cpp + src/Rtt.cpp + src/ClientOptions.cpp + src/UrlCmd.cpp ) -ecbuild_add_library( TARGET libclient - NOINSTALL - TYPE STATIC - SOURCES ${srcs} - ) - -target_link_libraries(libclient base node nodeattr core pthread) -target_include_directories(libclient PUBLIC src - ../ACore/src - ../ANattr/src - ../ANode/src - ../Base/src - ../Base/src/cts - ../Base/src/stc ) +ecbuild_add_library( + TARGET + libclient + NOINSTALL + TYPE STATIC + SOURCES + ${srcs} + PUBLIC_INCLUDES + src + PUBLIC_LIBS + base + Threads::Threads +) target_clangformat(libclient) # ======================================================================== # EXE ecflow_client, if OpenSSL not enabled ${OPENSSL_LIBRARIES}, is empty -ecbuild_add_executable( TARGET ecflow_client - SOURCES src/ClientMain.cpp - LIBS libclient ${OPENSSL_LIBRARIES} - INCLUDES ${Boost_INCLUDE_DIRS} - ) +ecbuild_add_executable( + TARGET + ecflow_client + SOURCES + src/ClientMain.cpp + LIBS + libclient + $<$:OpenSSL::SSL> +) +target_clangformat(ecflow_client) # Override default behaviour that add RPATHS during install # The only thing that seem to work is set INSTALL_RPATH to "" # Using SKIP_BUILD_RPATH,BUILD_WITH_INSTALL_RPATH,INSTALL_RPATH_USE_LINK_PATH # had no effect # -SET_TARGET_PROPERTIES(ecflow_client PROPERTIES - INSTALL_RPATH "" - ) +SET_TARGET_PROPERTIES(ecflow_client + PROPERTIES + INSTALL_RPATH "" +) + -target_clangformat(ecflow_client) # use, i.e. don't skip the full RPATH for the build tree #SET(CMAKE_SKIP_BUILD_RPATH FALSE) @@ -79,96 +86,116 @@ target_clangformat(ecflow_client) # ================================================================================ # TEST -# Use following to populate list: -# cd $WK/Client -# find test -name \*.cpp | sort - -list( APPEND test_srcs - # HEADERS - test/InvokeServer.hpp - # SOURCES - test/TestClientEnvironment.cpp - test/TestClientOptions.cpp - test/TestClientInterface.cpp - test/TestJobGenOnly.cpp - test/TestLifeCycle.cpp - test/TestInitAddVariables.cpp - test/TestRtt.cpp - test/TestUrlCmd.cpp - ) +set(test_srcs + # Headers + test/InvokeServer.hpp + # Sources + test/TestClient_main.cpp # test entry point + test/TestClientEnvironment.cpp + test/TestClientOptions.cpp + test/TestClientInterface.cpp + test/TestJobGenOnly.cpp + test/TestLifeCycle.cpp + test/TestInitAddVariables.cpp + test/TestRtt.cpp + test/TestUrlCmd.cpp +) if (ENABLE_SERVER) - list(APPEND test_srcs - # HEADERS - test/SCPort.hpp - # SOURCES - test/SCPort.cpp - test/TestClientTimeout.cpp - test/TestClientHandleCmd.cpp - test/TestCheckPtDefsCmd.cpp - test/TestCustomUser.cpp - test/TestGroupCmd.cpp - test/TestLoadDefsCmd.cpp - test/TestLogAndCheckptErrors.cpp - test/TestPasswdFile.cpp - test/TestPlugCmd.cpp - test/TestServer.cpp - test/TestServerAndLifeCycle.cpp - test/TestServerLoad.cpp - test/TestSignalSIGTERM.cpp - test/TestWhiteListFile.cpp - ) + list(APPEND test_srcs + # Headers + test/SCPort.hpp + # Sources + test/SCPort.cpp + test/TestClientTimeout.cpp + test/TestClientHandleCmd.cpp + test/TestCheckPtDefsCmd.cpp + test/TestCustomUser.cpp + test/TestGroupCmd.cpp + test/TestLoadDefsCmd.cpp + test/TestLogAndCheckptErrors.cpp + test/TestPasswdFile.cpp + test/TestPlugCmd.cpp + test/TestServer.cpp + test/TestServerAndLifeCycle.cpp + test/TestServerLoad.cpp + test/TestSignalSIGTERM.cpp + test/TestWhiteListFile.cpp + ) endif() - -# if OpenSSL not enabled ${OPENSSL_LIBRARIES}, is empty -# boost_timer -> boost_chrono -> librt -ecbuild_add_test( TARGET s_client - SOURCES ${test_srcs} - LIBS libclient ${OPENSSL_LIBRARIES} - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} - ${Boost_TIMER_LIBRARY} ${Boost_CHRONO_LIBRARY} ${LIBRT} - INCLUDES ../ANode/test - ../Base/test - ${Boost_INCLUDE_DIRS} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS u_base - ) - -target_clangformat(s_client CONDITION ENABLE_TESTS) + +ecbuild_add_test( + TARGET + s_client + SOURCES + ${test_srcs} + INCLUDES + ../Base/test + ../ANode/test + LIBS + libclient + Boost::boost # Boost header-only libraries must be available (namely unit_test_framework) + Boost::timer + $<$:OpenSSL::SSL> + TEST_DEPENDS + u_base +) +target_clangformat(s_client + CONDITION ENABLE_TESTS +) if (ENABLE_ALL_TESTS AND ENABLE_SERVER) - # - # Simple stand alone test - # - # libboost_unit_test_framework undefined reference to `clock_gettime', ${LIBRT} needed for boost 1.71 - ecbuild_add_test( TARGET perf_test_large_defs - SOURCES test/TestSinglePerf.cpp test/SCPort.cpp - LIBS libclient ${OPENSSL_LIBRARIES} - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} - INCLUDES ../ANode/test - ../Base/test - ${Boost_INCLUDE_DIRS} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS u_base - ) - - target_clangformat(perf_test_large_defs CONDITION ENABLE_TESTS) - - # - # test migration - # - ecbuild_add_test( TARGET m_test_migration - SOURCES test/TestMigration.cpp test/SCPort.cpp - LIBS libclient ${OPENSSL_LIBRARIES} - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} - INCLUDES ../ANode/test - ../Base/test - ${Boost_INCLUDE_DIRS} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS u_base - ) - - target_clangformat(m_test_migration CONDITION ENABLE_TESTS) + # + # Simple stand alone test + # + ecbuild_add_test( + TARGET + perf_test_large_defs + SOURCES + # Headers + test/SCPort.hpp + # Sources + test/SCPort.cpp + test/TestSinglePerf.cpp + test/TestSinglePerf_main.cpp # test entry point + INCLUDES + ../Base/test + LIBS + libclient + Boost::boost # Boost header-only libraries must be available (namely unit_test_framework) + $<$:OpenSSL::SSL> + TEST_DEPENDS + u_base + ) + target_clangformat(perf_test_large_defs + CONDITION ENABLE_TESTS + ) + + # + # test migration + # + ecbuild_add_test( + TARGET + m_test_migration + SOURCES + # Headers + test/SCPort.hpp + # Sources + test/SCPort.cpp + test/TestMigration.cpp + test/TestMigration_main.cpp # test entry point + INCLUDES + ../Base/test + LIBS + libclient + Boost::boost # Boost header-only libraries must be available (namely unit_test_framework) + $<$:OpenSSL::SSL> + TEST_DEPENDS + u_base + ) + target_clangformat(m_test_migration + CONDITION ENABLE_TESTS + ) endif() diff --git a/Client/test/TestClientEnvironment.cpp b/Client/test/TestClientEnvironment.cpp index ba84425f4..226468b32 100644 --- a/Client/test/TestClientEnvironment.cpp +++ b/Client/test/TestClientEnvironment.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE TestClient //============================================================================ // Name : // Author : Avi diff --git a/Client/test/TestClient_main.cpp b/Client/test/TestClient_main.cpp new file mode 100644 index 000000000..b52b51027 --- /dev/null +++ b/Client/test/TestClient_main.cpp @@ -0,0 +1,12 @@ +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ + +#define BOOST_TEST_MODULE TestClient +#include diff --git a/Client/test/TestMigration.cpp b/Client/test/TestMigration.cpp index 3f90af013..a4439f6e2 100644 --- a/Client/test/TestMigration.cpp +++ b/Client/test/TestMigration.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE TestMigration //============================================================================ // Name : // Author : Avi diff --git a/Client/test/TestMigration_main.cpp b/Client/test/TestMigration_main.cpp new file mode 100644 index 000000000..9b62af188 --- /dev/null +++ b/Client/test/TestMigration_main.cpp @@ -0,0 +1,12 @@ +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ + +#define BOOST_TEST_MODULE TestMigration +#include diff --git a/Client/test/TestSinglePerf.cpp b/Client/test/TestSinglePerf.cpp index c9c10a23c..cf8152ac9 100644 --- a/Client/test/TestSinglePerf.cpp +++ b/Client/test/TestSinglePerf.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE TestSingle //============================================================================ // Name : // Author : Avi diff --git a/Client/test/TestSinglePerf_main.cpp b/Client/test/TestSinglePerf_main.cpp new file mode 100644 index 000000000..85185f41d --- /dev/null +++ b/Client/test/TestSinglePerf_main.cpp @@ -0,0 +1,12 @@ +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ + +#define BOOST_TEST_MODULE TestSinglePerf +#include diff --git a/Http/CMakeLists.txt b/Http/CMakeLists.txt index 8fb90def6..4fa48b07a 100644 --- a/Http/CMakeLists.txt +++ b/Http/CMakeLists.txt @@ -1,86 +1,85 @@ - # ======================================================= - # LIB - # to list all sources to build use: - # cd $WK/Client - # find src -name \*.cpp --print - # ======================================================= - - # Excludes src/HttpMain.cpp -list( APPEND srcs - # HEADERS - src/ApiV1.hpp - src/ApiV1Impl.hpp - src/Base64.hpp - src/BasicAuth.hpp - src/HttpServer.hpp - src/HttpServerException.hpp - src/JSON.hpp - src/Options.hpp - src/TokenStorage.hpp - src/TypeToJson.hpp - # SOURCES - src/HttpServer.cpp - src/ApiV1.cpp - src/ApiV1Impl.cpp - src/BasicAuth.cpp - src/TypeToJson.cpp - src/TokenStorage.cpp -) +# +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# # cpp-httplib requires at least OpenSSL 1.1.1 for https support # so if we have OpenSSL enabled and the version is less than this, # we should disable SSL capabilities from the HTTP server if (OPENSSL_FOUND) - if (OPENSSL_VERSION VERSION_LESS 1.1.1) - ecbuild_warn("HTTP_SERVER requires at least OpenSSL 1.1.1 for https support (have version ${OPENSSL_VERSION}) - disabling https in HTTP server") - remove_definitions( -DECF_OPENSSL ) - set(DISABLED_SSL_IN_HTTP_SERVER 1) - endif() -endif() - - -ecbuild_add_library( TARGET libhttp - NOINSTALL - TYPE STATIC - SOURCES ${srcs} - ) - -target_link_libraries(libhttp base node nodeattr core pthread) -target_include_directories(libhttp PUBLIC src - ../ACore/src - ../ANattr/src - ../ANode/src - ../Base/src - ../Base/src/cts - ../Base/src/stc - ../Client/src - ../cpp-httplib - ../json + if (OPENSSL_VERSION VERSION_LESS 1.1.1) + ecbuild_warn("HTTP_SERVER requires at least OpenSSL 1.1.1 for https support (have version ${OPENSSL_VERSION}) - disabling https in HTTP server") + remove_definitions(-DECF_OPENSSL) + set(DISABLED_SSL_IN_HTTP_SERVER 1) + endif () +endif () + +set(srcs + # Headers + src/ApiV1.hpp + src/ApiV1Impl.hpp + src/Base64.hpp + src/BasicAuth.hpp + src/HttpServer.hpp + src/HttpServerException.hpp + src/JSON.hpp + src/Options.hpp + src/TokenStorage.hpp + src/TypeToJson.hpp + # Sources + src/HttpServer.cpp + src/ApiV1.cpp + src/ApiV1Impl.cpp + src/BasicAuth.cpp + src/TypeToJson.cpp + src/TokenStorage.cpp ) +ecbuild_add_library( + TARGET libhttp + NOINSTALL + TYPE STATIC + SOURCES + ${srcs} + PUBLIC_INCLUDES + src + ../json + ../cpp-httplib + PUBLIC_LIBS + base + libclient +) target_clangformat(libhttp) # ======================================================================== # EXE ecflow_http, if OpenSSL not enabled ${OPENSSL_LIBRARIES}, is empty -ecbuild_add_executable( TARGET ecflow_http - SOURCES - src/HttpMain.cpp - LIBS libhttp libclient ${OPENSSL_LIBRARIES} - INCLUDES ${Boost_INCLUDE_DIRS} ../cpp-httplib - ) +ecbuild_add_executable( + TARGET ecflow_http + SOURCES + src/HttpMain.cpp + LIBS + libhttp + libclient + $<$:OpenSSL::SSL> +) +target_clangformat(ecflow_http) # Override default behaviour that add RPATHS during install # The only thing that seem to work is set INSTALL_RPATH to "" # Using SKIP_BUILD_RPATH,BUILD_WITH_INSTALL_RPATH,INSTALL_RPATH_USE_LINK_PATH # had no effect # -SET_TARGET_PROPERTIES(ecflow_http PROPERTIES - INSTALL_RPATH "" - ) - -target_clangformat(ecflow_http) +SET_TARGET_PROPERTIES(ecflow_http + PROPERTIES + INSTALL_RPATH "" +) # use, i.e. don't skip the full RPATH for the build tree #SET(CMAKE_SKIP_BUILD_RPATH FALSE) @@ -98,39 +97,44 @@ target_clangformat(ecflow_http) if (ENABLE_HTTP AND ENABLE_SERVER) - list(APPEND test_srcs - # HEADERS + if (OPENSSL_FOUND AND NOT DISABLED_SSL_IN_HTTP_SERVER) + + set(test_srcs + # Headers test/Certificate.hpp test/InvokeServer.hpp test/TokenFile.hpp - # SOURCES + # Sources test/TestApiV1.cpp - ) - - if (OPENSSL_FOUND AND NOT DISABLED_SSL_IN_HTTP_SERVER) - - ecbuild_add_test( TARGET s_http - SOURCES ${test_srcs} - LIBS libhttp libclient libserver ${OPENSSL_LIBRARIES} - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} - ${Boost_TIMER_LIBRARY} ${Boost_CHRONO_LIBRARY} ${LIBRT} - INCLUDES src - ../ANode/test - ../Base/test - ../Server/src - ${Boost_INCLUDE_DIRS} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS u_base s_client - ) - - target_clangformat(s_http CONDITION ENABLE_TESTS) - else() + test/TestApiV1_main.cpp # test entry point + ) + + ecbuild_add_test( + TARGET s_http + SOURCES + ${test_srcs} + INCLUDES + ../Base/test + LIBS + libhttp + libclient + libserver + Boost::boost # Boost header-only libraries must be available (namely unit_test_framework) + $<$:OpenSSL::SSL> + TEST_DEPENDS + u_base + s_client + ) + target_clangformat(s_http + CONDITION ENABLE_TESTS + ) + else () message(WARNING "SSL not enabled - will not run HTTP server tests") - endif() + endif () -endif() +endif () # =================================================================== # install # =================================================================== -install (TARGETS ecflow_http DESTINATION bin) +install(TARGETS ecflow_http DESTINATION bin) diff --git a/Http/test/TestApiV1.cpp b/Http/test/TestApiV1.cpp index abb162d3d..b1caae61d 100644 --- a/Http/test/TestApiV1.cpp +++ b/Http/test/TestApiV1.cpp @@ -1,4 +1,12 @@ -#define BOOST_TEST_MODULE TestHttp +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ #ifdef ECF_OPENSSL #define CPPHTTPLIB_OPENSSL_SUPPORT diff --git a/Http/test/TestApiV1_main.cpp b/Http/test/TestApiV1_main.cpp new file mode 100644 index 000000000..d464cbee5 --- /dev/null +++ b/Http/test/TestApiV1_main.cpp @@ -0,0 +1,12 @@ +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ + +#define BOOST_TEST_MODULE TestHttp +#include diff --git a/Pyext/CMakeLists.txt b/Pyext/CMakeLists.txt index 6084f5d5f..a49060f3d 100644 --- a/Pyext/CMakeLists.txt +++ b/Pyext/CMakeLists.txt @@ -28,6 +28,7 @@ set(INIT_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/ecflow/__init__.py.in") set(INIT_PY_OUT "${CMAKE_CURRENT_SOURCE_DIR}/ecflow/__init__.py") configure_file(${INIT_PY_IN} ${INIT_PY_OUT} ) + # ============================================================================= # Configure setup.py. Note used locally. Uses existing libraries # ============================================================================= @@ -40,145 +41,145 @@ configure_file(${SETUP_PY_IN} ${SETUP_PY_OUT} ) # local includes # ============================================================================== include_directories( - ../ACore/src - ../ANattr/src - ../ANode/src - ../Base/src - ../Base/src/cts - ../Base/src/stc - ../Client/src - ../CSim/src - ) + ../ACore/src + ../ANattr/src + ../ANode/src + ../Base/src + ../Base/src/cts + ../Base/src/stc + ../Client/src + ../CSim/src +) message( STATUS "====================================================================================================================" ) message( STATUS "PYTHON2" ) message( STATUS "====================================================================================================================" ) if(${CMAKE_VERSION} VERSION_LESS "3.12.0") - # We only support python2 extension for cmake less 3.12.0 - # cmake 3.12.0 or greater allows multiple boost python libs & hence multiple extensions to be built - # Using -DPYTHON_EXECUTABLE=/usr/local/apps/python3/3.6.5-01/bin/python3 is not suffcient as the wrong(python2) libs are found - ecbuild_find_python( VERSION 2.6 REQUIRED ) - message( STATUS " PYTHON_FOUND : ${PYTHON_FOUND}" ) - message( STATUS " PYTHONINTERP_FOUND : ${PYTHONINTERP_FOUND}" ) - message( STATUS " PYTHONLIBS_FOUND : ${PYTHONLIBS_FOUND}" ) - message( STATUS " PYTHON_VERSION_STRING : ${PYTHON_VERSION_STRING}" ) - message( STATUS " PYTHON_VERSION_MAJOR : ${PYTHON_VERSION_MAJOR}" ) - message( STATUS " PYTHON_VERSION_MINOR : ${PYTHON_VERSION_MINOR}" ) - message( STATUS " PYTHON_VERSION_PATCH : ${PYTHON_VERSION_PATCH}" ) - message( STATUS " PYTHON_CONFIG_EXECUTABLE : ${PYTHON_CONFIG_EXECUTABLE}" ) - message( STATUS " PYTHON_EXECUTABLE : ${PYTHON_EXECUTABLE}" ) - message( STATUS " PYTHON_INCLUDE_DIRS : ${PYTHON_INCLUDE_DIRS}" ) - message( STATUS " PYTHON_LIBRARIES : ${PYTHON_LIBRARIES}" ) - if (${PYTHON_VERSION_MAJOR} EQUAL 3) - ecbuild_error("Need cmake version >= 3.12.0 to build ecflow python3 extension, current cmake version is ${CMAKE_VERSION}") - endif() + # We only support python2 extension for cmake less 3.12.0 + # cmake 3.12.0 or greater allows multiple boost python libs & hence multiple extensions to be built + # Using -DPYTHON_EXECUTABLE=/usr/local/apps/python3/3.6.5-01/bin/python3 is not suffcient as the wrong(python2) libs are found + ecbuild_find_python( VERSION 2.6 REQUIRED ) + message( STATUS " PYTHON_FOUND : ${PYTHON_FOUND}" ) + message( STATUS " PYTHONINTERP_FOUND : ${PYTHONINTERP_FOUND}" ) + message( STATUS " PYTHONLIBS_FOUND : ${PYTHONLIBS_FOUND}" ) + message( STATUS " PYTHON_VERSION_STRING : ${PYTHON_VERSION_STRING}" ) + message( STATUS " PYTHON_VERSION_MAJOR : ${PYTHON_VERSION_MAJOR}" ) + message( STATUS " PYTHON_VERSION_MINOR : ${PYTHON_VERSION_MINOR}" ) + message( STATUS " PYTHON_VERSION_PATCH : ${PYTHON_VERSION_PATCH}" ) + message( STATUS " PYTHON_CONFIG_EXECUTABLE : ${PYTHON_CONFIG_EXECUTABLE}" ) + message( STATUS " PYTHON_EXECUTABLE : ${PYTHON_EXECUTABLE}" ) + message( STATUS " PYTHON_INCLUDE_DIRS : ${PYTHON_INCLUDE_DIRS}" ) + message( STATUS " PYTHON_LIBRARIES : ${PYTHON_LIBRARIES}" ) + if (${PYTHON_VERSION_MAJOR} EQUAL 3) + ecbuild_error("Need cmake version >= 3.12.0 to build ecflow python3 extension, current cmake version is ${CMAKE_VERSION}") + endif() - find_package( Boost ${ECFLOW_BOOST_VERSION} REQUIRED COMPONENTS python ) - add_subdirectory( python2 ) + find_package( Boost ${ECFLOW_BOOST_VERSION} REQUIRED COMPONENTS python ) + add_subdirectory( python2 ) else() - # ====================================================================================== - # Attempt to build both python2 *AND/OR* python3 ecflow extension, depending on what is found - # this assumes cmake 3.12.0 min, which added support for boost python2 and python3 - # * NOTICE* that we do *NOT* use REQUIRED when searching for boost python libs - # ====================================================================================== - find_package(Python2 COMPONENTS Interpreter Development) - if (Python2_FOUND) - message( STATUS " Python2_Interpreter_FOUND : ${Python2_Interpreter_FOUND}" ) - message( STATUS " Python2_EXECUTABLE : ${Python2_EXECUTABLE}" ) - message( STATUS " Python2_STDLIB : ${Python2_STDLIB} Standard platform independent installation directory" ) - message( STATUS " Python2_STDARCH : ${Python2_STDARCH} Standard platform dependent installation directory." ) - message( STATUS " Python2_Development_FOUND : ${Python2_Development_FOUND}" ) - message( STATUS " Python2_INCLUDE_DIRS : ${Python2_INCLUDE_DIRS}" ) - message( STATUS " Python2_LIBRARIES : ${Python2_LIBRARIES}" ) - message( STATUS " Python2_LIBRARY_DIRS : ${Python2_LIBRARY_DIRS}" ) - message( STATUS " Python2_VERSION : ${Python2_VERSION}" ) - message( STATUS " Python2_VERSION_MAJOR : ${Python2_VERSION_MAJOR}" ) - message( STATUS " Python2_VERSION_MINOR : ${Python2_VERSION_MINOR}" ) - message( STATUS " Python2_VERSION_PATCH : ${Python2_VERSION_PATCH}" ) - # ***************************************************************************************** - # Although we have found python2 it could be that *ONLY* python3 was module loaded - # Otherwise will build for python2 and test with python3 interpreter - # ***************************************************************************************** - if ( Python2_LIBRARIES ) - ecbuild_find_python( VERSION 2.6 REQUIRED ) # if not included iterpreter not found ? - if ( ${PYTHON_VERSION_MAJOR} EQUAL 2) - message( STATUS " PYTHON_FOUND : ${PYTHON_FOUND}" ) - message( STATUS " PYTHONINTERP_FOUND : ${PYTHONINTERP_FOUND}" ) - message( STATUS " PYTHONLIBS_FOUND : ${PYTHONLIBS_FOUND}" ) - message( STATUS " PYTHON_VERSION_STRING : ${PYTHON_VERSION_STRING}" ) - message( STATUS " PYTHON_VERSION_MAJOR : ${PYTHON_VERSION_MAJOR}" ) - message( STATUS " PYTHON_VERSION_MINOR : ${PYTHON_VERSION_MINOR}" ) - message( STATUS " PYTHON_VERSION_PATCH : ${PYTHON_VERSION_PATCH}" ) - message( STATUS " PYTHON_CONFIG_EXECUTABLE : ${PYTHON_CONFIG_EXECUTABLE}" ) - message( STATUS " PYTHON_EXECUTABLE : ${PYTHON_EXECUTABLE}" ) - message( STATUS " PYTHON_INCLUDE_DIRS : ${PYTHON_INCLUDE_DIRS}" ) - message( STATUS " PYTHON_LIBRARIES : ${PYTHON_LIBRARIES}" ) + # ====================================================================================== + # Attempt to build both python2 *AND/OR* python3 ecflow extension, depending on what is found + # this assumes cmake 3.12.0 min, which added support for boost python2 and python3 + # * NOTICE* that we do *NOT* use REQUIRED when searching for boost python libs + # ====================================================================================== + find_package(Python2 COMPONENTS Interpreter Development) + if (Python2_FOUND) + message( STATUS " Python2_Interpreter_FOUND : ${Python2_Interpreter_FOUND}" ) + message( STATUS " Python2_EXECUTABLE : ${Python2_EXECUTABLE}" ) + message( STATUS " Python2_STDLIB : ${Python2_STDLIB} Standard platform independent installation directory" ) + message( STATUS " Python2_STDARCH : ${Python2_STDARCH} Standard platform dependent installation directory." ) + message( STATUS " Python2_Development_FOUND : ${Python2_Development_FOUND}" ) + message( STATUS " Python2_INCLUDE_DIRS : ${Python2_INCLUDE_DIRS}" ) + message( STATUS " Python2_LIBRARIES : ${Python2_LIBRARIES}" ) + message( STATUS " Python2_LIBRARY_DIRS : ${Python2_LIBRARY_DIRS}" ) + message( STATUS " Python2_VERSION : ${Python2_VERSION}" ) + message( STATUS " Python2_VERSION_MAJOR : ${Python2_VERSION_MAJOR}" ) + message( STATUS " Python2_VERSION_MINOR : ${Python2_VERSION_MINOR}" ) + message( STATUS " Python2_VERSION_PATCH : ${Python2_VERSION_PATCH}" ) + # ***************************************************************************************** + # Although we have found python2 it could be that *ONLY* python3 was module loaded + # Otherwise will build for python2 and test with python3 interpreter + # ***************************************************************************************** + if ( Python2_LIBRARIES ) + ecbuild_find_python( VERSION 2.6 REQUIRED ) # if not included iterpreter not found ? + if ( ${PYTHON_VERSION_MAJOR} EQUAL 2) + message( STATUS " PYTHON_FOUND : ${PYTHON_FOUND}" ) + message( STATUS " PYTHONINTERP_FOUND : ${PYTHONINTERP_FOUND}" ) + message( STATUS " PYTHONLIBS_FOUND : ${PYTHONLIBS_FOUND}" ) + message( STATUS " PYTHON_VERSION_STRING : ${PYTHON_VERSION_STRING}" ) + message( STATUS " PYTHON_VERSION_MAJOR : ${PYTHON_VERSION_MAJOR}" ) + message( STATUS " PYTHON_VERSION_MINOR : ${PYTHON_VERSION_MINOR}" ) + message( STATUS " PYTHON_VERSION_PATCH : ${PYTHON_VERSION_PATCH}" ) + message( STATUS " PYTHON_CONFIG_EXECUTABLE : ${PYTHON_CONFIG_EXECUTABLE}" ) + message( STATUS " PYTHON_EXECUTABLE : ${PYTHON_EXECUTABLE}" ) + message( STATUS " PYTHON_INCLUDE_DIRS : ${PYTHON_INCLUDE_DIRS}" ) + message( STATUS " PYTHON_LIBRARIES : ${PYTHON_LIBRARIES}" ) - if ( Boost_MINOR_VERSION GREATER 66 ) - # cmake 3.15 - # see: https://gitlab.kitware.com/cmake/cmake/issues/19656 - # INTERFACE_LIBRARY targets may only have whitelisted properties." - find_package( Boost ${ECFLOW_BOOST_VERSION} COMPONENTS python${Python2_VERSION_MAJOR}${Python2_VERSION_MINOR} ) - else() - find_package( Boost ${ECFLOW_BOOST_VERSION} COMPONENTS python ) - endif() + if ( Boost_MINOR_VERSION GREATER 66 ) + # cmake 3.15 + # see: https://gitlab.kitware.com/cmake/cmake/issues/19656 + # INTERFACE_LIBRARY targets may only have whitelisted properties." + find_package( Boost ${ECFLOW_BOOST_VERSION} COMPONENTS python${Python2_VERSION_MAJOR}${Python2_VERSION_MINOR} ) + else() + find_package( Boost ${ECFLOW_BOOST_VERSION} COMPONENTS python ) + endif() - if (Boost_PYTHON_FOUND OR Boost_PYTHON${Python2_VERSION_MAJOR}${Python2_VERSION_MINOR}_FOUND) - set(ECF_PYTHON_FOUND "ECF_PYTHON_FOUND") - add_subdirectory( python2 ) - else() - message( STATUS " Boost python2 libraries *NOT* found" ) - endif() - endif() - else() - message( STATUS " Python2 libraries *NOT* found" ) - endif() - endif() + if (Boost_PYTHON_FOUND OR Boost_PYTHON${Python2_VERSION_MAJOR}${Python2_VERSION_MINOR}_FOUND) + set(ECF_PYTHON_FOUND "ECF_PYTHON_FOUND") + add_subdirectory( python2 ) + else() + message( STATUS " Boost python2 libraries *NOT* found" ) + endif() + endif() + else() + message( STATUS " Python2 libraries *NOT* found" ) + endif() + endif() - message( STATUS "====================================================================================================================" ) - message( STATUS "PYTHON3" ) - message( STATUS "====================================================================================================================" ) - # The python must include the Development packages. As the headers in these packages is used by boost python. - find_package(Python3 COMPONENTS Interpreter Development) - if (Python3_FOUND) - message( STATUS " Python3_Interpreter_FOUND : ${Python3_Interpreter_FOUND}" ) - message( STATUS " Python3_EXECUTABLE : ${Python3_EXECUTABLE}" ) - message( STATUS " Python3_STDLIB : ${Python3_STDLIB} Standard platform independent installation directory" ) - message( STATUS " Python3_STDARCH : ${Python3_STDARCH} Standard platform dependent installation directory." ) - message( STATUS " Python3_Development_FOUND : ${Python3_Development_FOUND}" ) - message( STATUS " Python3_INCLUDE_DIRS : ${Python3_INCLUDE_DIRS}" ) - message( STATUS " Python3_LIBRARIES : ${Python3_LIBRARIES}" ) - message( STATUS " Python3_LIBRARY_DIRS : ${Python3_LIBRARY_DIRS}" ) - message( STATUS " Python3_VERSION : ${Python3_VERSION}" ) - message( STATUS " Python3_VERSION_MAJOR : ${Python3_VERSION_MAJOR}" ) - message( STATUS " Python3_VERSION_MINOR : ${Python3_VERSION_MINOR}" ) - message( STATUS " Python3_VERSION_PATCH : ${Python3_VERSION_PATCH}" ) + message( STATUS "====================================================================================================================" ) + message( STATUS "PYTHON3" ) + message( STATUS "====================================================================================================================" ) + # The python must include the Development packages. As the headers in these packages is used by boost python. + find_package(Python3 COMPONENTS Interpreter Development) + if (Python3_FOUND) + message( STATUS " Python3_Interpreter_FOUND : ${Python3_Interpreter_FOUND}" ) + message( STATUS " Python3_EXECUTABLE : ${Python3_EXECUTABLE}" ) + message( STATUS " Python3_STDLIB : ${Python3_STDLIB} Standard platform independent installation directory" ) + message( STATUS " Python3_STDARCH : ${Python3_STDARCH} Standard platform dependent installation directory." ) + message( STATUS " Python3_Development_FOUND : ${Python3_Development_FOUND}" ) + message( STATUS " Python3_INCLUDE_DIRS : ${Python3_INCLUDE_DIRS}" ) + message( STATUS " Python3_LIBRARIES : ${Python3_LIBRARIES}" ) + message( STATUS " Python3_LIBRARY_DIRS : ${Python3_LIBRARY_DIRS}" ) + message( STATUS " Python3_VERSION : ${Python3_VERSION}" ) + message( STATUS " Python3_VERSION_MAJOR : ${Python3_VERSION_MAJOR}" ) + message( STATUS " Python3_VERSION_MINOR : ${Python3_VERSION_MINOR}" ) + message( STATUS " Python3_VERSION_PATCH : ${Python3_VERSION_PATCH}" ) - if ( Boost_MINOR_VERSION GREATER 66 ) - # cmake 3.15 - # see: https://gitlab.kitware.com/cmake/cmake/issues/19656 - # INTERFACE_LIBRARY targets may only have whitelisted properties. - find_package( Boost ${ECFLOW_BOOST_VERSION} COMPONENTS python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR} ) - else() - find_package( Boost ${ECFLOW_BOOST_VERSION} COMPONENTS python3 ) - endif() - - if (Boost_PYTHON3_FOUND OR Boost_PYTHON${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}_FOUND) - if ( Python3_LIBRARIES ) - ecbuild_find_python( VERSION ${Python3_VERSION} REQUIRED ) - set(ECF_PYTHON_FOUND "ECF_PYTHON_FOUND") - add_subdirectory( python3 ) - else() - message( STATUS " python3 libraries *NOT* found" ) - endif() - else() - message( STATUS " Boost python3 libraries *NOT* found" ) - endif() - endif() - - if (NOT ECF_PYTHON_FOUND) - ecbuild_error("ecflow python extension is enabled, but python2/python3 libraries or python boost libraries not found") - endif() + if ( Boost_MINOR_VERSION GREATER 66 ) + # cmake 3.15 + # see: https://gitlab.kitware.com/cmake/cmake/issues/19656 + # INTERFACE_LIBRARY targets may only have whitelisted properties. + find_package( Boost ${ECFLOW_BOOST_VERSION} COMPONENTS python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR} ) + else() + find_package( Boost ${ECFLOW_BOOST_VERSION} COMPONENTS python3 ) + endif() + + if (Boost_PYTHON3_FOUND OR Boost_PYTHON${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}_FOUND) + if ( Python3_LIBRARIES ) + ecbuild_find_python( VERSION ${Python3_VERSION} REQUIRED ) + set(ECF_PYTHON_FOUND "ECF_PYTHON_FOUND") + add_subdirectory( python3 ) + else() + message( STATUS " python3 libraries *NOT* found" ) + endif() + else() + message( STATUS " Boost python3 libraries *NOT* found" ) + endif() + endif() + + if (NOT ECF_PYTHON_FOUND) + ecbuild_error("ecflow python extension is enabled, but python2/python3 libraries or python boost libraries not found") + endif() endif() message( STATUS "====================================================================================================================" ) message( STATUS "END PYTHON" ) diff --git a/Server/CMakeLists.txt b/Server/CMakeLists.txt index dc5c5eb22..5153cceeb 100644 --- a/Server/CMakeLists.txt +++ b/Server/CMakeLists.txt @@ -1,80 +1,79 @@ - # ======================================================= - # LIB - # to list all sources to build use: - # cd $WK/Server - # find src -name \*.cpp -print | sort - # ======================================================= -list( APPEND srcs - # HEADERS - src/BaseServer.hpp - src/CheckPtSaver.hpp - src/NodeTreeTraverser.hpp - src/Server.hpp - src/ServerEnvironment.hpp - src/ServerOptions.hpp - src/SslServer.hpp - src/SslTcpServer.hpp - src/TcpBaseServer.hpp - src/TcpServer.hpp - # SOURCES - src/BaseServer.cpp - src/CheckPtSaver.cpp - src/NodeTreeTraverser.cpp - src/Server.cpp - src/ServerEnvironment.cpp - src/ServerOptions.cpp - src/TcpBaseServer.cpp - src/TcpServer.cpp -) - -if (OPENSSL_FOUND) - list( APPEND srcs - # HEADERS - src/SslServer.hpp - src/SslTcpServer.hpp - # SOURCES - src/SslServer.cpp - src/SslTcpServer.cpp - ) -endif() - +# +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# -ecbuild_add_library( TARGET libserver - NOINSTALL - TYPE STATIC - SOURCES ${srcs} - ) -target_link_libraries(libserver base node nodeattr core pthread ) -target_include_directories(libserver PRIVATE src - ../ACore/src - ../ANattr/src - ../ANode/src - ../Base/src - ../Base/src/cts - ../Base/src/stc +set(srcs + # Headers + src/BaseServer.hpp + src/CheckPtSaver.hpp + src/NodeTreeTraverser.hpp + src/Server.hpp + src/ServerEnvironment.hpp + src/ServerOptions.hpp + src/SslServer.hpp + src/SslTcpServer.hpp + src/TcpBaseServer.hpp + src/TcpServer.hpp + $<$:src/SslServer.hpp> + $<$:src/SslTcpServer.hpp> + # Sources + src/BaseServer.cpp + src/CheckPtSaver.cpp + src/NodeTreeTraverser.cpp + src/Server.cpp + src/ServerEnvironment.cpp + src/ServerOptions.cpp + src/TcpBaseServer.cpp + src/TcpServer.cpp + $<$:src/SslServer.cpp> + $<$:src/SslTcpServer.cpp> ) +ecbuild_add_library( + TARGET + libserver + NOINSTALL + TYPE STATIC + SOURCES + ${srcs} + PUBLIC_INCLUDES + src + PUBLIC_LIBS + base + Boost::boost # Boost header-only libraries must be available (namely asio) +) target_clangformat(libserver) # ======================================================= # EXE ecflow_server, if OpenSSL not enabled ${OPENSSL_LIBRARIES}, is empty -ecbuild_add_executable( TARGET ecflow_server - SOURCES src/ServerMain.cpp - LIBS libserver ${OPENSSL_LIBRARIES} - INCLUDES ${Boost_INCLUDE_DIRS} - ) +ecbuild_add_executable( + TARGET + ecflow_server + SOURCES + src/ServerMain.cpp + LIBS + libserver + $<$:OpenSSL::SSL> + Threads::Threads +) +target_clangformat(ecflow_server) # Override default behaviour that add RPATHS during install # The only thing that seem to work is set INSTALL_RPATH to "" # Using SKIP_BUILD_RPATH,BUILD_WITH_INSTALL_RPATH,INSTALL_RPATH_USE_LINK_PATH # had no effect # -SET_TARGET_PROPERTIES(ecflow_server PROPERTIES - INSTALL_RPATH "" - ) - -target_clangformat(ecflow_server) +SET_TARGET_PROPERTIES(ecflow_server + PROPERTIES + INSTALL_RPATH "" +) # use, i.e. don't skip the full RPATH for the build tree #SET(CMAKE_SKIP_BUILD_RPATH FALSE) @@ -93,7 +92,6 @@ target_clangformat(ecflow_server) # ================================================================================ # TEST -# libboost_unit_test_framework undefined reference to `clock_gettime', ${LIBRT} needed for boost 1.71 ecbuild_add_test( TARGET u_server @@ -101,10 +99,13 @@ ecbuild_add_test( src SOURCES test/TestServerEnvironment.cpp + test/TestServer_main.cpp # test entry point test/TestServer1.cpp LIBS libserver + Boost::boost # Boost header-only libraries must be available (namely unit_test_framework) $<$:OpenSSL::SSL> + Threads::Threads TEST_DEPENDS u_base ) diff --git a/Server/test/TestServerEnvironment.cpp b/Server/test/TestServerEnvironment.cpp index e31c3e4c7..2deb06cbd 100644 --- a/Server/test/TestServerEnvironment.cpp +++ b/Server/test/TestServerEnvironment.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE Server //============================================================================ // Name : // Author : Avi @@ -20,7 +19,7 @@ #include #include -#include +#include #include "CheckPt.hpp" #include "Ecf.hpp" diff --git a/Server/test/TestServer_main.cpp b/Server/test/TestServer_main.cpp new file mode 100644 index 000000000..98ce3ed3d --- /dev/null +++ b/Server/test/TestServer_main.cpp @@ -0,0 +1,12 @@ +/* + * Copyright 2023- ECMWF. + * + * This software is licensed under the terms of the Apache Licence version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation + * nor does it submit to any jurisdiction. + */ + +#define BOOST_TEST_MODULE TestServer +#include diff --git a/Test/CMakeLists.txt b/Test/CMakeLists.txt index acea6a017..fabe4e919 100644 --- a/Test/CMakeLists.txt +++ b/Test/CMakeLists.txt @@ -1,31 +1,43 @@ -# ======================================================= -# to list all sources to build use: -# cd $WK/Test -# find src -name \*.cpp -print | sort -# ======================================================= +# +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# + file( GLOB srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp" "src/*.hpp" ) - -# This library is used for the syste, level testing, hence can include test directories -ecbuild_add_library( TARGET libharness - NOINSTALL - TYPE STATIC - SOURCES ${srcs} - ) -target_link_libraries(libharness libclient base node nodeattr core ) -target_include_directories(libharness PUBLIC src - ../ACore/src - ../ANattr/src - ../ANode/src - ../ANode/test - ../Base/src - ../Base/src/cts - ../Base/src/stc - ../Base/test - ../Client/src - ../Client/test +set(srcs + # Headers + src/ServerTestHarness.hpp + src/TestFixture.hpp + src/ZombieUtil.hpp + # Sources + src/ServerTestHarness.cpp + src/TestFixture.cpp + src/ZombieUtill.cpp ) +ecbuild_add_library( + TARGET + libharness + NOINSTALL + TYPE STATIC + SOURCES + ${srcs} + PUBLIC_INCLUDES + src + ../Base/test + PUBLIC_LIBS + libclient + base + node + nodeattr + core +) target_clangformat(libharness) # ================================================================= @@ -33,64 +45,72 @@ target_clangformat(libharness) if (ENABLE_ALL_TESTS) - list( APPEND test_srcs - ./TestAbortCmd.cpp - ./TestAlias.cpp - ./TestClkSync.cpp - ./TestComplete.cpp - ./TestCron.cpp - ./TestCtsWaitCmd.cpp - ./TestDayDate.cpp - ./TestEvents.cpp - ./TestFileCmd.cpp - ./TestHandle.cpp - ./TestInitAddVariable.cpp - ./TestKillCmd.cpp - ./TestLate.cpp - ./TestLimit.cpp - ./TestOrderCmd.cpp - ./TestQueueCmd.cpp - ./TestRepeat.cpp - ./TestRequeueNode.cpp - ./TestRunner.cpp - ./TestServer.cpp - ./TestSuspend.cpp - ./TestToday.cpp - ./TestTrigger.cpp - ./TestWhyCmd.cpp - ./Test_Time.cpp - ) - - # if OpenSSL not enabled ${OPENSSL_LIBRARIES}, is empty - # libboost_unit_test_framework undefined reference to `clock_gettime', ${LIBRT} needed for boost 1.71 - ecbuild_add_test( TARGET s_test - SOURCES ${test_srcs} - INCLUDES ${Boost_INCLUDE_DIRS} - LIBS libharness ${OPENSSL_LIBRARIES} - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS s_client - ) - target_clangformat(s_test CONDITION ENABLE_TESTS) - - ecbuild_add_test( TARGET s_test_zombies - SOURCES ./TestZombies.cpp - INCLUDES ${Boost_INCLUDE_DIRS} - LIBS libharness ${OPENSSL_LIBRARIES} - ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} - DEFINITIONS ${BOOST_TEST_DYN_LINK} - TEST_DEPENDS s_test - ) - target_clangformat(s_test_zombies CONDITION ENABLE_TESTS) - + set(test_srcs + TestAbortCmd.cpp + TestAlias.cpp + TestClkSync.cpp + TestComplete.cpp + TestCron.cpp + TestCtsWaitCmd.cpp + TestDayDate.cpp + TestEvents.cpp + TestFileCmd.cpp + TestHandle.cpp + TestInitAddVariable.cpp + TestKillCmd.cpp + TestLate.cpp + TestLimit.cpp + TestOrderCmd.cpp + TestQueueCmd.cpp + TestRepeat.cpp + TestRequeueNode.cpp + TestRunner.cpp + TestServer.cpp + TestSuspend.cpp + TestToday.cpp + TestTrigger.cpp + TestWhyCmd.cpp + Test_Time.cpp + ) + + ecbuild_add_test( + TARGET + s_test + SOURCES + ${test_srcs} + LIBS + libharness + $<$:OpenSSL::SSL> + TEST_DEPENDS + s_client + ) + target_clangformat(s_test CONDITION ENABLE_TESTS) - # This test runs forever, hence not suitable for unit test. - #ecbuild_add_test( TARGET singletest - # SOURCES ./TestSingle.cpp - # INCLUDES ${Boost_INCLUDE_DIRS} - # LIBS libharness - # ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} - # DEFINITIONS ${BOOST_TEST_DYN_LINK} - # TEST_DEPENDS s_client - # ) + ecbuild_add_test( + TARGET + s_test_zombies + SOURCES + TestZombies.cpp + LIBS + libharness + $<$:OpenSSL::SSL> + TEST_DEPENDS + s_test + ) + target_clangformat(s_test_zombies CONDITION ENABLE_TESTS) + + # This test runs forever, hence not suitable as unit test. + ecbuild_add_test( + TARGET + s_singletest + SOURCES + TestSingle.cpp + LIBS + libharness + $<$:OpenSSL::SSL> + TEST_DEPENDS + s_client + ) + target_clangformat(s_singletest CONDITION ENABLE_TESTS) + endif() diff --git a/Test/TestRunner.cpp b/Test/TestRunner.cpp index c84d27cd6..674289057 100644 --- a/Test/TestRunner.cpp +++ b/Test/TestRunner.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE Test //============================================================================ // Name : // Author : Avi @@ -13,7 +12,9 @@ // // Description : //============================================================================ -#include + +#define BOOST_TEST_MODULE Test +#include #include "TestFixture.hpp" diff --git a/Test/TestSingle.cpp b/Test/TestSingle.cpp index 20280a8f3..791ab2ffc 100644 --- a/Test/TestSingle.cpp +++ b/Test/TestSingle.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE TEST_SINGLE //============================================================================ // Name : // Author : Avi @@ -20,7 +19,8 @@ #include #include #include -#include +#define BOOST_TEST_MODULE TEST_SINGLE +#include #include #include "TestFixture.hpp" diff --git a/Test/TestZombies.cpp b/Test/TestZombies.cpp index d8a57f60a..9315b0ab8 100644 --- a/Test/TestZombies.cpp +++ b/Test/TestZombies.cpp @@ -1,4 +1,3 @@ -#define BOOST_TEST_MODULE TEST_ZOMBIES //============================================================================ // Name : // Author : Avi @@ -21,7 +20,8 @@ #include #include #include -#include +#define BOOST_TEST_MODULE TEST_ZOMBIES +#include #include "AssertTimer.hpp" #include "Child.hpp" diff --git a/Udp/CMakeLists.txt b/Udp/CMakeLists.txt index d31bda9a6..8f644605e 100644 --- a/Udp/CMakeLists.txt +++ b/Udp/CMakeLists.txt @@ -1,3 +1,12 @@ +# +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# # ============================================================================== # ECFLOW UDP library @@ -5,14 +14,14 @@ set(LIB_TARGET libecflow_udp) set(${LIB_TARGET}_srcs - # HEADERS + # Headers src/ClientAPI.hpp src/RequestHandler.hpp src/Trace.hpp src/UDPServer.hpp src/UDPServerEnvironment.hpp src/UDPServerOptions.hpp - # SOURCES + # Sources src/ClientAPI.cpp src/RequestHandler.cpp src/Trace.cpp @@ -21,19 +30,20 @@ set(${LIB_TARGET}_srcs ) ecbuild_add_library( - TARGET ${LIB_TARGET} + TARGET + ${LIB_TARGET} TYPE STATIC NOINSTALL - SOURCES ${${LIB_TARGET}_srcs} + SOURCES + ${${LIB_TARGET}_srcs} PRIVATE_INCLUDES src - ../Client/src ../json PUBLIC_LIBS libclient - pthread - $<$:OpenSSL::SSL> + Threads::Threads Boost::boost + $<$:OpenSSL::SSL> ) target_clangformat(${LIB_TARGET}) @@ -43,7 +53,7 @@ target_clangformat(${LIB_TARGET}) set(SERVER_TARGET ecflow_udp) set(${SERVER_TARGET}_srcs - # SOURCES + # Sources src/UDPServerMain.cpp ) @@ -52,9 +62,9 @@ ecbuild_add_executable( SOURCES ${${SERVER_TARGET}_srcs} INCLUDES src - ../ACore/src # Needed only to #include "ecflow_version.h" LIBS ${LIB_TARGET} + core # Needed only to #include "ecflow_version.h" ) set_target_properties(${SERVER_TARGET} PROPERTIES INSTALL_RPATH "" diff --git a/Viewer/CMakeLists.txt b/Viewer/CMakeLists.txt index 0b23b3498..611720fd9 100644 --- a/Viewer/CMakeLists.txt +++ b/Viewer/CMakeLists.txt @@ -1,4 +1,14 @@ -# avoid warning about dependency targets that don't exit +# +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# + +# avoid warning about dependency targets that don't exist # # CMake Warning (dev) at Viewer/src/CMakeLists.txt:261 (ADD_DEPENDENCIES): # Policy CMP0046 is not set: Error on non-existent dependency in diff --git a/Viewer/ecflowUI/CMakeLists.txt b/Viewer/ecflowUI/CMakeLists.txt index 40d1c465a..a9b89ec53 100644 --- a/Viewer/ecflowUI/CMakeLists.txt +++ b/Viewer/ecflowUI/CMakeLists.txt @@ -1,17 +1,12 @@ -# avoid warning about dependency targets that don't exit # -# CMake Warning (dev) at Viewer/src/CMakeLists.txt:261 (ADD_DEPENDENCIES): -# Policy CMP0046 is not set: Error on non-existent dependency in -# add_dependencies. Run "cmake --help-policy CMP0046" for policy details. -# Use the cmake_policy command to set the policy and suppress this warning. +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # -# The dependency target -# "/tmp/ma0/workspace/ecflow/Viewer/src/../images/zombie_dock.svg" of target -# "Qt_resource_cpp" does not exist. - -if (POLICY CMP0046) - cmake_policy(SET CMP0046 OLD) -endif() add_subdirectory( src ) add_subdirectory( scripts ) diff --git a/Viewer/ecflowUI/scripts/CMakeLists.txt b/Viewer/ecflowUI/scripts/CMakeLists.txt index 05217bb90..f1b90c055 100644 --- a/Viewer/ecflowUI/scripts/CMakeLists.txt +++ b/Viewer/ecflowUI/scripts/CMakeLists.txt @@ -1,51 +1,83 @@ +# +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# # the list of files we want to install bin -set (files ecflow_ui) +set(files + ecflow_ui +) # the list of files we want to install to share/ecflow/etc -set (files_share ecflow_ui_create_jira_issue.sh - ecflow_ui_node_state_diag.sh ecflow_ui_transfer_file.sh ecflow_test_ui.sh) +set(files_share + ecflow_ui_create_jira_issue.sh + ecflow_ui_node_state_diag.sh + ecflow_ui_transfer_file.sh + ecflow_test_ui.sh +) # set variables which will be expanded in the startup script if(ENABLE_UI_BACKTRACE) - set(UI_BACKTRACE yes) + set(UI_BACKTRACE yes) else() - set(UI_BACKTRACE no) + set(UI_BACKTRACE no) endif() if(NOT UI_BACKTRACE_EMAIL_ADDRESS_FILE) - set(UI_BACKTRACE_EMAIL_ADDRESS_FILE "x") + set(UI_BACKTRACE_EMAIL_ADDRESS_FILE "x") endif() if(NOT UI_LOG_FILE) - set(UI_LOG_FILE "x") + set(UI_LOG_FILE "x") endif() if(NOT UI_LOG_SITE_TAG) - set(UI_LOG_SITE_TAG "x") + set(UI_LOG_SITE_TAG "x") endif() # for each file, copy it into the build directory at build time # and install it into the installation directory at install time (!) foreach( f ${files} ) - configure_file(${f}.in ${CMAKE_BINARY_DIR}/bin/${f} @ONLY) - - - # ensure file is installed at install time - install( FILES ${CMAKE_BINARY_DIR}/bin/${f} - DESTINATION bin - PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE) + configure_file(${f}.in ${CMAKE_BINARY_DIR}/bin/${f} @ONLY) + # ensure file is installed at install time + install( + FILES + ${CMAKE_BINARY_DIR}/bin/${f} + DESTINATION + bin + PERMISSIONS + OWNER_WRITE + OWNER_READ + GROUP_READ + WORLD_READ + OWNER_EXECUTE + GROUP_EXECUTE + WORLD_EXECUTE) endforeach() # for each file, copy it into the build directory at build time # and install it into the installation directory at install time (!) foreach( f ${files_share} ) - configure_file(${f}.in ${CMAKE_BINARY_DIR}/share/ecflow/etc/${f} @ONLY) - + configure_file(${f}.in ${CMAKE_BINARY_DIR}/share/ecflow/etc/${f} @ONLY) - install( FILES ${CMAKE_BINARY_DIR}/share/ecflow/etc/${f} - DESTINATION share/ecflow/etc - PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE) + install( + FILES + ${CMAKE_BINARY_DIR}/share/ecflow/etc/${f} + DESTINATION + share/ecflow/etc + PERMISSIONS + OWNER_WRITE + OWNER_READ + GROUP_READ + WORLD_READ + OWNER_EXECUTE + GROUP_EXECUTE + WORLD_EXECUTE) endforeach() diff --git a/Viewer/ecflowUI/src/CMakeLists.txt b/Viewer/ecflowUI/src/CMakeLists.txt index 613cd2342..1a879a2e0 100644 --- a/Viewer/ecflowUI/src/CMakeLists.txt +++ b/Viewer/ecflowUI/src/CMakeLists.txt @@ -1,845 +1,849 @@ +# +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# set(viewer_srcs - # HEADERS - AboutDialog.hpp - AbstractNodeModel.hpp - AbstractNodeView.hpp - AbstractSearchLine.hpp - AbstractTextEditSearchInterface.hpp - ActionHandler.hpp - AddLabelDialog.hpp - AddModelColumnDialog.hpp - Animation.hpp - AstCollateVNodesVisitor.hpp - AttributeEditor.hpp - AttributeEditorFactory.hpp - CaseSensitiveButton.hpp - ChangeNotify.hpp - ChangeNotifyDialog.hpp - ChangeNotifyEditor.hpp - ChangeNotifyModel.hpp - ChangeNotifyWidget.hpp - ClockWidget.hpp - CodeItemWidget.hpp - ComboMulti.hpp - CommandDesignerWidget.hpp - CommandHandler.hpp - CommandOutput.hpp - CommandOutputDialog.hpp - CommandOutputWidget.hpp - CompactView.hpp - ConfigListDelegate.hpp - ConnectState.hpp - CustomCommandDialog.hpp - CustomCommandHandler.hpp - CustomListWidget.hpp - CustomTabWidget.hpp - Dashboard.hpp - DashboardDialog.hpp - DashboardDock.hpp - DashboardTitle.hpp - DashboardWidget.hpp - DiagData.hpp - EditItemWidget.hpp - EditProvider.hpp - EditorInfoLabel.hpp - EventEditor.hpp - ExpandState.hpp - ExpandStateNode.hpp - FetchTask.hpp - FileFetchTask.hpp - FileInfoLabel.hpp - FileWatcher.hpp - FilterWidget.hpp - FlagSet.hpp - FontMetrics.hpp - GenFileProvider.hpp - GotoLineDialog.hpp - Highlighter.hpp - HistoryItemWidget.hpp - HtmlEdit.hpp - HtmlItemWidget.hpp - InfoPanel.hpp - InfoPanelHandler.hpp - InfoPanelItem.hpp - InfoPresenter.hpp - InfoProvider.hpp - InputEventLog.hpp - JobItemWidget.hpp - JobStatusItemWidget.hpp - LabelEditor.hpp - LimitEditor.hpp - LineEdit.hpp - LogProvider.hpp - LogViewerCom.hpp - MainWindow.hpp - ManualItemWidget.hpp - MenuConfigDialog.hpp - MenuHandler.hpp - MessageItemWidget.hpp - MeterEditor.hpp - ModelColumn.hpp - NodeExpression.hpp - NodeFilterDialog.hpp - NodeObserver.hpp - NodePanel.hpp - NodePathWidget.hpp - NodeQuery.hpp - NodeQueryCombo.hpp - NodeQueryEditor.hpp - NodeQueryEngine.hpp - NodeQueryHandler.hpp - NodeQueryOption.hpp - NodeQueryOptionEdit.hpp - NodeQueryResult.hpp - NodeQueryResultModel.hpp - NodeQueryResultTmp.hpp - NodeQueryResultView.hpp - NodeQueryViewDelegate.hpp - NodeSearchWidget.hpp - NodeSearchWindow.hpp - NodeViewBase.hpp - NodeViewDelegate.hpp - NodeWidget.hpp - OneLineTextEdit.hpp - OutputBrowser.hpp - OutputCache.hpp - OutputClient.hpp - OutputDirClient.hpp - OutputDirProvider.hpp - OutputDirWidget.hpp - OutputFetchInfo.hpp - OutputFileClient.hpp - OutputFileProvider.hpp - OutputItemWidget.hpp - OutputModel.hpp - OverviewItemWidget.hpp - OverviewProvider.hpp - PlainTextEdit.hpp - PlainTextSearchInterface.hpp - PlainTextSearchLine.hpp - PlainTextWidget.hpp - PropertyDialog.hpp - PropertyEditor.hpp - PropertyLine.hpp - PropertyMapper.hpp - RectMetrics.hpp - RepeatEditor.hpp - RichTextEdit.hpp - RichTextSearchInterface.hpp - RichTextSearchLine.hpp - SaveSessionAsDialog.hpp - ScriptItemWidget.hpp - ServerComInfoWidget.hpp - ServerComObserver.hpp - ServerComQueue.hpp - ServerComThread.hpp - ServerDefsAccess.hpp - ServerFilter.hpp - ServerHandler.hpp - ServerItem.hpp - ServerList.hpp - ServerListDialog.hpp - ServerListSyncWidget.hpp - ServerLoadItemWidget.hpp - ServerObserver.hpp - ServerSettingsItemWidget.hpp - SessionDialog.hpp - SessionHandler.hpp - SessionRenameDialog.hpp - ShellCommand.hpp - ShortcutHelpDialog.hpp - Sound.hpp - Spline.hpp - StandardView.hpp - StringMatchCombo.hpp - StringMatchMode.hpp - SuiteFilter.hpp - SuiteFilterObserver.hpp - SuiteItemWidget.hpp - SuiteModel.hpp - TabWidget.hpp - TableFilterWidget.hpp - TableNodeModel.hpp - TableNodeSortModel.hpp - TableNodeView.hpp - TableNodeViewDelegate.hpp - TableNodeWidget.hpp - TextEditSearchLine.hpp - TextFilterHandler.hpp - TextFilterHandlerDialog.hpp - TextFilterWidget.hpp - TimelineData.hpp - TimelineFileList.hpp - TimelineHeaderView.hpp - TimelineInfoDailyView.hpp - TimelineInfoDailyWidget.hpp - TimelineInfoDelegate.hpp - TimelineInfoWidget.hpp - TimelineItemWidget.hpp - TimelineModel.hpp - TimelinePreLoadDialog.hpp - TimelineView.hpp - TimelineWidget.hpp - TreeNodeModel.hpp - TreeNodeView.hpp - TreeNodeViewDelegate.hpp - TreeNodeWidget.hpp - TreeView.hpp - TriggerCollector.hpp - TriggerEditor.hpp - TriggerGraphLayoutBuilder.hpp - TriggerGraphModel.hpp - TriggerGraphView.hpp - TriggerGraphWidget.hpp - TriggerItemWidget.hpp - TriggerTableModel.hpp - TriggerTableView.hpp - TriggerTableWidget.hpp - TriggerTextWidget.hpp - TriggerViewDelegate.hpp - TriggeredScanner.hpp - UiLogS.hpp - UpdateTimer.hpp - VAttribute.hpp - VAttributeType.hpp - VAutoArchiveAttr.hpp - VAutoCancelAttr.hpp - VAutoRestoreAttr.hpp - VConfig.hpp - VConfigLoader.hpp - VDateAttr.hpp - VDir.hpp - VEventAttr.hpp - VFile.hpp - VFileInfo.hpp - VFileTransfer.hpp - VFileUncompress.hpp - VFilter.hpp - VGenVarAttr.hpp - VIcon.hpp - VInfo.hpp - VItem.hpp - VItemPathParser.hpp - VLabelAttr.hpp - VLateAttr.hpp - VLimitAttr.hpp - VLimiterAttr.hpp - VMeterAttr.hpp - VModelData.hpp - VNState.hpp - VNode.hpp - VNodeList.hpp - VNodeMover.hpp - VNodeStateDiag.hpp - VParam.hpp - VProperty.hpp - VQueueAttr.hpp - VRepeatAttr.hpp - VReply.hpp - VReportMaker.hpp - VSState.hpp - VServerSettings.hpp - VSettings.hpp - VSettingsLoader.hpp - VTask.hpp - VTaskNode.hpp - VTaskObserver.hpp - VTimeAttr.hpp - VTree.hpp - VTriggerAttr.hpp - VUserVarAttr.hpp - VariableEditor.hpp - VariableItemWidget.hpp - VariableModel.hpp - VariableModelData.hpp - VariableModelDataObserver.hpp - VariableSearchLine.hpp - VariableView.hpp - Viewer.hpp - ViewerUtil.hpp - WhyItemWidget.hpp - WidgetNameProvider.hpp - WmWorkspaceHandler.hpp - ZombieItemWidget.hpp - ZombieModel.hpp - TextPager/TextCodecWrapper.hpp - TextPager/TextPagerCursor.hpp - TextPager/TextPagerCursor_p.hpp - TextPager/TextPagerDocument.hpp - TextPager/TextPagerDocument_p.hpp - TextPager/TextPagerEdit.hpp - TextPager/TextPagerEdit_p.hpp - TextPager/TextPagerLayout_p.hpp - TextPager/TextPagerSearchHighlighter.hpp - TextPager/TextPagerSearchInterface.hpp - TextPager/TextPagerSection.hpp - TextPager/TextPagerSection_p.hpp - TextPager/TextPagerWidget.hpp - TextPager/WeakPointer.hpp - TextPager/syntaxhighlighter.hpp - # SOURCES - ViewerMain.cpp - AboutDialog.cpp - AbstractNodeModel.cpp - AbstractNodeView.cpp - AbstractSearchLine.cpp - AbstractTextEditSearchInterface.cpp - ActionHandler.cpp - AddLabelDialog.cpp - AddModelColumnDialog.cpp - Animation.cpp - AstCollateVNodesVisitor.cpp - AttributeEditor.cpp - AttributeEditorFactory.cpp - CaseSensitiveButton.cpp - ChangeNotify.cpp - ChangeNotifyDialog.cpp - ChangeNotifyEditor.cpp - ChangeNotifyModel.cpp - ChangeNotifyWidget.cpp - ClockWidget.cpp - CodeItemWidget.cpp - ComboMulti.cpp - CommandDesignerWidget.cpp - CommandHandler.cpp - CommandOutput.cpp - CommandOutputDialog.cpp - CommandOutputWidget.cpp - CompactView.cpp - ConfigListDelegate.cpp - ConnectState.cpp - CustomCommandDialog.cpp - CustomCommandHandler.cpp - CustomListWidget.cpp - CustomTabWidget.cpp - Dashboard.cpp - DashboardDialog.cpp - DashboardDock.cpp - DashboardTitle.cpp - DashboardWidget.cpp - DiagData.cpp - EditItemWidget.cpp - EditProvider.cpp - EditorInfoLabel.cpp - EventEditor.cpp - ExpandState.cpp - ExpandStateNode.cpp - FetchTask.cpp - FlagSet.hpp - FileFetchTask.cpp - FileInfoLabel.cpp - FileWatcher.cpp - FilterWidget.cpp - FontMetrics.cpp - GenFileProvider.cpp - GotoLineDialog.cpp - Highlighter.cpp - HistoryItemWidget.cpp - HtmlEdit.cpp - HtmlItemWidget.cpp - InfoPanel.cpp - InfoPanelItem.cpp - InfoPanelHandler.cpp - InfoProvider.cpp - InputEventLog.cpp - JobItemWidget.cpp - JobStatusItemWidget.cpp - LabelEditor.cpp - LimitEditor.cpp - LineEdit.cpp - LogProvider.cpp - LogViewerCom.cpp - MainWindow.cpp - ManualItemWidget.cpp - MenuConfigDialog.cpp - MenuHandler.cpp - MessageItemWidget.cpp - MeterEditor.cpp - ModelColumn.cpp - NodeExpression.cpp - NodeFilterDialog.cpp - NodePanel.cpp - NodePathWidget.cpp - NodeQuery.cpp - NodeQueryCombo.cpp - NodeQueryEditor.cpp - NodeQueryEngine.cpp - NodeQueryHandler.cpp - NodeQueryOption.cpp - NodeQueryOptionEdit.cpp - NodeQueryResult.cpp - NodeQueryResultModel.cpp - NodeQueryResultView.cpp - NodeQueryViewDelegate.cpp - NodeSearchWindow.cpp - NodeSearchWidget.cpp - NodeViewBase.cpp - NodeViewDelegate.cpp - NodeWidget.cpp - OneLineTextEdit.cpp - OutputBrowser.cpp - OutputCache.cpp - OutputClient.cpp - OutputFetchInfo.cpp - OutputFileClient.cpp - OutputDirClient.cpp - OutputModel.cpp - OutputItemWidget.cpp - OutputFileProvider.cpp - OutputDirProvider.cpp - OutputDirWidget.cpp - OverviewItemWidget.cpp - OverviewProvider.cpp - PlainTextEdit.cpp - PlainTextSearchLine.cpp - PlainTextSearchInterface.cpp - PlainTextWidget.cpp - PropertyDialog.cpp - PropertyEditor.cpp - PropertyLine.cpp - PropertyMapper.cpp - RectMetrics.cpp - RepeatEditor.cpp - RichTextEdit.cpp - RichTextSearchInterface.cpp - RichTextSearchLine.cpp - SaveSessionAsDialog.cpp - ScriptItemWidget.cpp - ServerComInfoWidget.cpp - ServerComQueue.cpp - ServerComThread.cpp - ServerDefsAccess.cpp - ServerHandler.cpp - ServerFilter.cpp - ServerItem.cpp - ServerList.cpp - ServerListDialog.cpp - ServerListSyncWidget.cpp - ServerLoadItemWidget.cpp - ServerSettingsItemWidget.cpp - SessionDialog.cpp - SessionRenameDialog.cpp - SessionHandler.cpp - ShellCommand.cpp - ShortcutHelpDialog.cpp - Sound.cpp - Spline.cpp - StandardView.cpp - StringMatchCombo.cpp - StringMatchMode.cpp - SuiteItemWidget.cpp - SuiteFilter.cpp - SuiteFilterObserver.hpp - SuiteModel.cpp - TabWidget.cpp - TableFilterWidget.cpp - TableNodeModel.cpp - TableNodeSortModel.cpp - TableNodeView.cpp - TableNodeViewDelegate.cpp - TableNodeWidget.cpp - TextEditSearchLine.cpp - TextFilterHandler.cpp - TextFilterHandlerDialog.cpp - TextFilterWidget.cpp - TimelineHeaderView.cpp - TimelineInfoDailyView.cpp - TimelineInfoDailyWidget.cpp - TimelineInfoDelegate.cpp - TimelineInfoWidget.cpp - TimelineItemWidget.cpp - TimelineData.cpp - TimelineFileList.cpp - TimelineModel.cpp - TimelinePreLoadDialog.cpp - TimelineView.cpp - TimelineWidget.cpp - TreeNodeModel.cpp - TreeNodeView.cpp - TreeNodeViewDelegate.cpp - TreeNodeWidget.cpp - TreeView.cpp - TriggerEditor.cpp - TriggerItemWidget.cpp - TriggerTextWidget.cpp - TriggerCollector.cpp - TriggerGraphLayoutBuilder.cpp - TriggerGraphModel.cpp - TriggerGraphWidget.cpp - TriggerGraphView.cpp - TriggerTableModel.cpp - TriggerTableView.cpp - TriggerTableWidget.cpp - TriggerViewDelegate.cpp - TriggeredScanner.cpp - UiLogS.cpp - UpdateTimer.cpp - VAttribute.cpp - VAttributeType.cpp - VAutoArchiveAttr.cpp - VAutoCancelAttr.cpp - VAutoRestoreAttr.cpp - VConfig.cpp - VConfigLoader.cpp - VDateAttr.cpp - VDir.cpp - VEventAttr.cpp - VFilter.cpp - VIcon.cpp - VInfo.cpp - VFile.cpp - VFileInfo.cpp - VFileTransfer.cpp - VFileUncompress.cpp - VItem.cpp - VItemPathParser.cpp - VLabelAttr.cpp - VLateAttr.cpp - VLimitAttr.cpp - VLimiterAttr.cpp - VMeterAttr.cpp - VModelData.cpp - VNode.cpp - VNodeList.cpp - VNodeMover.cpp - VNodeStateDiag.cpp - VNState.cpp - VParam.cpp - VProperty.cpp - VQueueAttr.cpp - VRepeatAttr.cpp - VReply.cpp - VReportMaker.cpp - VServerSettings.cpp - VSettings.cpp - VSettingsLoader.cpp - VSState.cpp - VTask.cpp - VTaskNode.cpp - VTimeAttr.cpp - VTree.cpp - VTriggerAttr.cpp - VGenVarAttr.cpp - VUserVarAttr.cpp - VariableEditor.cpp - VariableModel.cpp - VariableModelData.cpp - VariableItemWidget.cpp - VariableSearchLine.cpp - VariableView.cpp - ViewerUtil.cpp - WhyItemWidget.cpp - WidgetNameProvider.cpp - WmWorkspaceHandler.cpp - ZombieItemWidget.cpp - ZombieModel.cpp - TextPager/TextPagerCursor.cpp - TextPager/TextPagerDocument.cpp - TextPager/TextPagerEdit.cpp - TextPager/TextPagerLayout_p.cpp - TextPager/TextPagerSearchHighlighter.cpp - TextPager/TextPagerSearchInterface.cpp - TextPager/TextPagerSection.cpp - TextPager/TextPagerWidget.cpp - TextPager/syntaxhighlighter.cpp) - -if(ECFLOW_QT) - include_directories(${ECFLOW_QT_INCLUDE_DIR}) -#else() -# include(${QT_USE_FILE}) -# set(ECFLOW_QT_LIBRARIES ${QT_LIBRARIES}) -endif() - + # Headers + AboutDialog.hpp + AbstractNodeModel.hpp + AbstractNodeView.hpp + AbstractSearchLine.hpp + AbstractTextEditSearchInterface.hpp + ActionHandler.hpp + AddLabelDialog.hpp + AddModelColumnDialog.hpp + Animation.hpp + AstCollateVNodesVisitor.hpp + AttributeEditor.hpp + AttributeEditorFactory.hpp + CaseSensitiveButton.hpp + ChangeNotify.hpp + ChangeNotifyDialog.hpp + ChangeNotifyEditor.hpp + ChangeNotifyModel.hpp + ChangeNotifyWidget.hpp + ClockWidget.hpp + CodeItemWidget.hpp + ComboMulti.hpp + CommandDesignerWidget.hpp + CommandHandler.hpp + CommandOutput.hpp + CommandOutputDialog.hpp + CommandOutputWidget.hpp + CompactView.hpp + ConfigListDelegate.hpp + ConnectState.hpp + CustomCommandDialog.hpp + CustomCommandHandler.hpp + CustomListWidget.hpp + CustomTabWidget.hpp + Dashboard.hpp + DashboardDialog.hpp + DashboardDock.hpp + DashboardTitle.hpp + DashboardWidget.hpp + DiagData.hpp + EditItemWidget.hpp + EditProvider.hpp + EditorInfoLabel.hpp + EventEditor.hpp + ExpandState.hpp + ExpandStateNode.hpp + FetchTask.hpp + FileFetchTask.hpp + FileInfoLabel.hpp + FileWatcher.hpp + FilterWidget.hpp + FlagSet.hpp + FontMetrics.hpp + GenFileProvider.hpp + GotoLineDialog.hpp + Highlighter.hpp + HistoryItemWidget.hpp + HtmlEdit.hpp + HtmlItemWidget.hpp + InfoPanel.hpp + InfoPanelHandler.hpp + InfoPanelItem.hpp + InfoPresenter.hpp + InfoProvider.hpp + InputEventLog.hpp + JobItemWidget.hpp + JobStatusItemWidget.hpp + LabelEditor.hpp + LimitEditor.hpp + LineEdit.hpp + LogProvider.hpp + LogViewerCom.hpp + MainWindow.hpp + ManualItemWidget.hpp + MenuConfigDialog.hpp + MenuHandler.hpp + MessageItemWidget.hpp + MeterEditor.hpp + ModelColumn.hpp + NodeExpression.hpp + NodeFilterDialog.hpp + NodeObserver.hpp + NodePanel.hpp + NodePathWidget.hpp + NodeQuery.hpp + NodeQueryCombo.hpp + NodeQueryEditor.hpp + NodeQueryEngine.hpp + NodeQueryHandler.hpp + NodeQueryOption.hpp + NodeQueryOptionEdit.hpp + NodeQueryResult.hpp + NodeQueryResultModel.hpp + NodeQueryResultTmp.hpp + NodeQueryResultView.hpp + NodeQueryViewDelegate.hpp + NodeSearchWidget.hpp + NodeSearchWindow.hpp + NodeViewBase.hpp + NodeViewDelegate.hpp + NodeWidget.hpp + OneLineTextEdit.hpp + OutputBrowser.hpp + OutputCache.hpp + OutputClient.hpp + OutputDirClient.hpp + OutputDirProvider.hpp + OutputDirWidget.hpp + OutputFetchInfo.hpp + OutputFileClient.hpp + OutputFileProvider.hpp + OutputItemWidget.hpp + OutputModel.hpp + OverviewItemWidget.hpp + OverviewProvider.hpp + PlainTextEdit.hpp + PlainTextSearchInterface.hpp + PlainTextSearchLine.hpp + PlainTextWidget.hpp + PropertyDialog.hpp + PropertyEditor.hpp + PropertyLine.hpp + PropertyMapper.hpp + RectMetrics.hpp + RepeatEditor.hpp + RichTextEdit.hpp + RichTextSearchInterface.hpp + RichTextSearchLine.hpp + SaveSessionAsDialog.hpp + ScriptItemWidget.hpp + ServerComInfoWidget.hpp + ServerComObserver.hpp + ServerComQueue.hpp + ServerComThread.hpp + ServerDefsAccess.hpp + ServerFilter.hpp + ServerHandler.hpp + ServerItem.hpp + ServerList.hpp + ServerListDialog.hpp + ServerListSyncWidget.hpp + ServerLoadItemWidget.hpp + ServerObserver.hpp + ServerSettingsItemWidget.hpp + SessionDialog.hpp + SessionHandler.hpp + SessionRenameDialog.hpp + ShellCommand.hpp + ShortcutHelpDialog.hpp + Sound.hpp + Spline.hpp + StandardView.hpp + StringMatchCombo.hpp + StringMatchMode.hpp + SuiteFilter.hpp + SuiteFilterObserver.hpp + SuiteItemWidget.hpp + SuiteModel.hpp + TabWidget.hpp + TableFilterWidget.hpp + TableNodeModel.hpp + TableNodeSortModel.hpp + TableNodeView.hpp + TableNodeViewDelegate.hpp + TableNodeWidget.hpp + TextEditSearchLine.hpp + TextFilterHandler.hpp + TextFilterHandlerDialog.hpp + TextFilterWidget.hpp + TimelineData.hpp + TimelineFileList.hpp + TimelineHeaderView.hpp + TimelineInfoDailyView.hpp + TimelineInfoDailyWidget.hpp + TimelineInfoDelegate.hpp + TimelineInfoWidget.hpp + TimelineItemWidget.hpp + TimelineModel.hpp + TimelinePreLoadDialog.hpp + TimelineView.hpp + TimelineWidget.hpp + TreeNodeModel.hpp + TreeNodeView.hpp + TreeNodeViewDelegate.hpp + TreeNodeWidget.hpp + TreeView.hpp + TriggerCollector.hpp + TriggerEditor.hpp + TriggerGraphLayoutBuilder.hpp + TriggerGraphModel.hpp + TriggerGraphView.hpp + TriggerGraphWidget.hpp + TriggerItemWidget.hpp + TriggerTableModel.hpp + TriggerTableView.hpp + TriggerTableWidget.hpp + TriggerTextWidget.hpp + TriggerViewDelegate.hpp + TriggeredScanner.hpp + UiLogS.hpp + UpdateTimer.hpp + VAttribute.hpp + VAttributeType.hpp + VAutoArchiveAttr.hpp + VAutoCancelAttr.hpp + VAutoRestoreAttr.hpp + VConfig.hpp + VConfigLoader.hpp + VDateAttr.hpp + VDir.hpp + VEventAttr.hpp + VFile.hpp + VFileInfo.hpp + VFileTransfer.hpp + VFileUncompress.hpp + VFilter.hpp + VGenVarAttr.hpp + VIcon.hpp + VInfo.hpp + VItem.hpp + VItemPathParser.hpp + VLabelAttr.hpp + VLateAttr.hpp + VLimitAttr.hpp + VLimiterAttr.hpp + VMeterAttr.hpp + VModelData.hpp + VNState.hpp + VNode.hpp + VNodeList.hpp + VNodeMover.hpp + VNodeStateDiag.hpp + VParam.hpp + VProperty.hpp + VQueueAttr.hpp + VRepeatAttr.hpp + VReply.hpp + VReportMaker.hpp + VSState.hpp + VServerSettings.hpp + VSettings.hpp + VSettingsLoader.hpp + VTask.hpp + VTaskNode.hpp + VTaskObserver.hpp + VTimeAttr.hpp + VTree.hpp + VTriggerAttr.hpp + VUserVarAttr.hpp + VariableEditor.hpp + VariableItemWidget.hpp + VariableModel.hpp + VariableModelData.hpp + VariableModelDataObserver.hpp + VariableSearchLine.hpp + VariableView.hpp + Viewer.hpp + ViewerUtil.hpp + WhyItemWidget.hpp + WidgetNameProvider.hpp + WmWorkspaceHandler.hpp + ZombieItemWidget.hpp + ZombieModel.hpp + TextPager/TextCodecWrapper.hpp + TextPager/TextPagerCursor.hpp + TextPager/TextPagerCursor_p.hpp + TextPager/TextPagerDocument.hpp + TextPager/TextPagerDocument_p.hpp + TextPager/TextPagerEdit.hpp + TextPager/TextPagerEdit_p.hpp + TextPager/TextPagerLayout_p.hpp + TextPager/TextPagerSearchHighlighter.hpp + TextPager/TextPagerSearchInterface.hpp + TextPager/TextPagerSection.hpp + TextPager/TextPagerSection_p.hpp + TextPager/TextPagerWidget.hpp + TextPager/WeakPointer.hpp + TextPager/syntaxhighlighter.hpp + $<$:LogLoadWidget.hpp> + $<$:LogLoadView.hpp> + # Sources + ViewerMain.cpp + AboutDialog.cpp + AbstractNodeModel.cpp + AbstractNodeView.cpp + AbstractSearchLine.cpp + AbstractTextEditSearchInterface.cpp + ActionHandler.cpp + AddLabelDialog.cpp + AddModelColumnDialog.cpp + Animation.cpp + AstCollateVNodesVisitor.cpp + AttributeEditor.cpp + AttributeEditorFactory.cpp + CaseSensitiveButton.cpp + ChangeNotify.cpp + ChangeNotifyDialog.cpp + ChangeNotifyEditor.cpp + ChangeNotifyModel.cpp + ChangeNotifyWidget.cpp + ClockWidget.cpp + CodeItemWidget.cpp + ComboMulti.cpp + CommandDesignerWidget.cpp + CommandHandler.cpp + CommandOutput.cpp + CommandOutputDialog.cpp + CommandOutputWidget.cpp + CompactView.cpp + ConfigListDelegate.cpp + ConnectState.cpp + CustomCommandDialog.cpp + CustomCommandHandler.cpp + CustomListWidget.cpp + CustomTabWidget.cpp + Dashboard.cpp + DashboardDialog.cpp + DashboardDock.cpp + DashboardTitle.cpp + DashboardWidget.cpp + DiagData.cpp + EditItemWidget.cpp + EditProvider.cpp + EditorInfoLabel.cpp + EventEditor.cpp + ExpandState.cpp + ExpandStateNode.cpp + FetchTask.cpp + FlagSet.hpp + FileFetchTask.cpp + FileInfoLabel.cpp + FileWatcher.cpp + FilterWidget.cpp + FontMetrics.cpp + GenFileProvider.cpp + GotoLineDialog.cpp + Highlighter.cpp + HistoryItemWidget.cpp + HtmlEdit.cpp + HtmlItemWidget.cpp + InfoPanel.cpp + InfoPanelItem.cpp + InfoPanelHandler.cpp + InfoProvider.cpp + InputEventLog.cpp + JobItemWidget.cpp + JobStatusItemWidget.cpp + LabelEditor.cpp + LimitEditor.cpp + LineEdit.cpp + LogProvider.cpp + LogViewerCom.cpp + MainWindow.cpp + ManualItemWidget.cpp + MenuConfigDialog.cpp + MenuHandler.cpp + MessageItemWidget.cpp + MeterEditor.cpp + ModelColumn.cpp + NodeExpression.cpp + NodeFilterDialog.cpp + NodePanel.cpp + NodePathWidget.cpp + NodeQuery.cpp + NodeQueryCombo.cpp + NodeQueryEditor.cpp + NodeQueryEngine.cpp + NodeQueryHandler.cpp + NodeQueryOption.cpp + NodeQueryOptionEdit.cpp + NodeQueryResult.cpp + NodeQueryResultModel.cpp + NodeQueryResultView.cpp + NodeQueryViewDelegate.cpp + NodeSearchWindow.cpp + NodeSearchWidget.cpp + NodeViewBase.cpp + NodeViewDelegate.cpp + NodeWidget.cpp + OneLineTextEdit.cpp + OutputBrowser.cpp + OutputCache.cpp + OutputClient.cpp + OutputFetchInfo.cpp + OutputFileClient.cpp + OutputDirClient.cpp + OutputModel.cpp + OutputItemWidget.cpp + OutputFileProvider.cpp + OutputDirProvider.cpp + OutputDirWidget.cpp + OverviewItemWidget.cpp + OverviewProvider.cpp + PlainTextEdit.cpp + PlainTextSearchLine.cpp + PlainTextSearchInterface.cpp + PlainTextWidget.cpp + PropertyDialog.cpp + PropertyEditor.cpp + PropertyLine.cpp + PropertyMapper.cpp + RectMetrics.cpp + RepeatEditor.cpp + RichTextEdit.cpp + RichTextSearchInterface.cpp + RichTextSearchLine.cpp + SaveSessionAsDialog.cpp + ScriptItemWidget.cpp + ServerComInfoWidget.cpp + ServerComQueue.cpp + ServerComThread.cpp + ServerDefsAccess.cpp + ServerHandler.cpp + ServerFilter.cpp + ServerItem.cpp + ServerList.cpp + ServerListDialog.cpp + ServerListSyncWidget.cpp + ServerLoadItemWidget.cpp + ServerSettingsItemWidget.cpp + SessionDialog.cpp + SessionRenameDialog.cpp + SessionHandler.cpp + ShellCommand.cpp + ShortcutHelpDialog.cpp + Sound.cpp + Spline.cpp + StandardView.cpp + StringMatchCombo.cpp + StringMatchMode.cpp + SuiteItemWidget.cpp + SuiteFilter.cpp + SuiteFilterObserver.hpp + SuiteModel.cpp + TabWidget.cpp + TableFilterWidget.cpp + TableNodeModel.cpp + TableNodeSortModel.cpp + TableNodeView.cpp + TableNodeViewDelegate.cpp + TableNodeWidget.cpp + TextEditSearchLine.cpp + TextFilterHandler.cpp + TextFilterHandlerDialog.cpp + TextFilterWidget.cpp + TimelineHeaderView.cpp + TimelineInfoDailyView.cpp + TimelineInfoDailyWidget.cpp + TimelineInfoDelegate.cpp + TimelineInfoWidget.cpp + TimelineItemWidget.cpp + TimelineData.cpp + TimelineFileList.cpp + TimelineModel.cpp + TimelinePreLoadDialog.cpp + TimelineView.cpp + TimelineWidget.cpp + TreeNodeModel.cpp + TreeNodeView.cpp + TreeNodeViewDelegate.cpp + TreeNodeWidget.cpp + TreeView.cpp + TriggerEditor.cpp + TriggerItemWidget.cpp + TriggerTextWidget.cpp + TriggerCollector.cpp + TriggerGraphLayoutBuilder.cpp + TriggerGraphModel.cpp + TriggerGraphWidget.cpp + TriggerGraphView.cpp + TriggerTableModel.cpp + TriggerTableView.cpp + TriggerTableWidget.cpp + TriggerViewDelegate.cpp + TriggeredScanner.cpp + UiLogS.cpp + UpdateTimer.cpp + VAttribute.cpp + VAttributeType.cpp + VAutoArchiveAttr.cpp + VAutoCancelAttr.cpp + VAutoRestoreAttr.cpp + VConfig.cpp + VConfigLoader.cpp + VDateAttr.cpp + VDir.cpp + VEventAttr.cpp + VFilter.cpp + VIcon.cpp + VInfo.cpp + VFile.cpp + VFileInfo.cpp + VFileTransfer.cpp + VFileUncompress.cpp + VItem.cpp + VItemPathParser.cpp + VLabelAttr.cpp + VLateAttr.cpp + VLimitAttr.cpp + VLimiterAttr.cpp + VMeterAttr.cpp + VModelData.cpp + VNode.cpp + VNodeList.cpp + VNodeMover.cpp + VNodeStateDiag.cpp + VNState.cpp + VParam.cpp + VProperty.cpp + VQueueAttr.cpp + VRepeatAttr.cpp + VReply.cpp + VReportMaker.cpp + VServerSettings.cpp + VSettings.cpp + VSettingsLoader.cpp + VSState.cpp + VTask.cpp + VTaskNode.cpp + VTimeAttr.cpp + VTree.cpp + VTriggerAttr.cpp + VGenVarAttr.cpp + VUserVarAttr.cpp + VariableEditor.cpp + VariableModel.cpp + VariableModelData.cpp + VariableItemWidget.cpp + VariableSearchLine.cpp + VariableView.cpp + ViewerUtil.cpp + WhyItemWidget.cpp + WidgetNameProvider.cpp + WmWorkspaceHandler.cpp + ZombieItemWidget.cpp + ZombieModel.cpp + TextPager/TextPagerCursor.cpp + TextPager/TextPagerDocument.cpp + TextPager/TextPagerEdit.cpp + TextPager/TextPagerLayout_p.cpp + TextPager/TextPagerSearchHighlighter.cpp + TextPager/TextPagerSearchInterface.cpp + TextPager/TextPagerSection.cpp + TextPager/TextPagerWidget.cpp + TextPager/syntaxhighlighter.cpp + $<$:LogLoadWidget.cpp> + $<$:LogLoadView.cpp> +) -set(viewer_moc_files AbstractNodeModel.hpp - AbstractNodeView.hpp - AbstractSearchLine.hpp - ActionHandler.hpp - AddLabelDialog.hpp - AddModelColumnDialog.hpp - Animation.hpp - AttributeEditor.hpp - CaseSensitiveButton.hpp - ChangeNotifyDialog.hpp - ChangeNotifyEditor.hpp - ChangeNotifyModel.hpp - ChangeNotifyWidget.hpp - ClockWidget.hpp - CodeItemWidget.hpp - ComboMulti.hpp - CommandDesignerWidget.hpp - CommandOutput.hpp - CommandOutputDialog.hpp - CommandOutputWidget.hpp - CustomCommandDialog.hpp - CustomListWidget.hpp - Dashboard.hpp - DashboardDialog.hpp - DashboardDock.hpp - DashboardTitle.hpp - DashboardWidget.hpp - EditItemWidget.hpp - EventEditor.hpp - FileFetchTask.hpp - FileWatcher.hpp - FilterWidget.hpp - GotoLineDialog.hpp - HistoryItemWidget.hpp - HtmlItemWidget.hpp - InfoPanel.hpp - InputEventLog.hpp - JobStatusItemWidget.hpp - LabelEditor.hpp - LimitEditor.hpp - LineEdit.hpp - LogProvider.hpp - MainWindow.hpp - MenuConfigDialog.hpp - MessageItemWidget.hpp - MeterEditor.hpp - ModelColumn.hpp - NodeFilterDialog.hpp - NodePanel.hpp - NodePathWidget.hpp - NodeQueryCombo.hpp - NodeQueryEditor.hpp - NodeQueryOptionEdit.hpp - NodeQueryEngine.hpp - NodeQueryResult.hpp - NodeQueryResultModel.hpp - NodeQueryResultView.hpp - NodeSearchWindow.hpp - NodeSearchWidget.hpp - NodeWidget.hpp - OneLineTextEdit.hpp - OutputBrowser.hpp - OutputCache.hpp - OutputClient.hpp - OutputFetchInfo.hpp - OutputFileClient.hpp - OutputDirClient.hpp - OutputItemWidget.hpp - OutputDirProvider.hpp - OutputDirWidget.hpp - PlainTextEdit.hpp - PlainTextWidget.hpp - PropertyDialog.hpp - PropertyEditor.hpp - PropertyLine.hpp - SaveSessionAsDialog.hpp - ShortcutHelpDialog.hpp - RepeatEditor.hpp - RichTextEdit.hpp - ServerComInfoWidget.hpp - ServerComQueue.hpp - ServerComThread.hpp - ServerHandler.hpp - ServerListDialog.hpp - ServerListSyncWidget.hpp - ServerSettingsItemWidget.hpp - SessionDialog.hpp - SessionRenameDialog.hpp - ShellCommand.hpp - StringMatchCombo.hpp - SuiteItemWidget.hpp - SuiteModel.hpp - TabWidget.hpp - TableFilterWidget.hpp - TableNodeModel.hpp - TableNodeSortModel.hpp - TableNodeView.hpp - TableNodeViewDelegate.hpp - TableNodeWidget.hpp - TextEditSearchLine.hpp - TextFilterHandlerDialog.hpp - TextFilterWidget.hpp - TimelineData.hpp - TimelineHeaderView.hpp - TimelineInfoDailyView.hpp - TimelineInfoDailyWidget.hpp - TimelineInfoWidget.hpp - TimelineModel.hpp - TimelineView.hpp - TimelineWidget.hpp - TreeNodeModel.hpp - TreeNodeView.hpp - TreeNodeViewDelegate.hpp - TreeNodeWidget.hpp - TriggerEditor.hpp - TriggerGraphWidget.hpp - TriggerGraphView.hpp - TriggerItemWidget.hpp - TriggerTableView.hpp - TriggerTableWidget.hpp - TriggeredScanner.hpp - VariableEditor.hpp - VariableItemWidget.hpp - VariableModel.hpp - VariableModelData.hpp - VariableSearchLine.hpp - VFileTransfer.hpp - VFilter.hpp - VModelData.hpp - VNodeList.hpp - WhyItemWidget.hpp - ZombieItemWidget.hpp - TextPager/TextCodecWrapper.hpp - TextPager/TextPagerCursor_p.hpp - TextPager/TextPagerDocument.hpp - TextPager/TextPagerDocument_p.hpp - TextPager/TextPagerEdit.hpp - TextPager/TextPagerEdit_p.hpp - TextPager/TextPagerSection_p.hpp - TextPager/TextPagerWidget.hpp - TextPager/syntaxhighlighter.hpp +set(viewer_moc_files + AbstractNodeModel.hpp + AbstractNodeView.hpp + AbstractSearchLine.hpp + ActionHandler.hpp + AddLabelDialog.hpp + AddModelColumnDialog.hpp + Animation.hpp + AttributeEditor.hpp + CaseSensitiveButton.hpp + ChangeNotifyDialog.hpp + ChangeNotifyEditor.hpp + ChangeNotifyModel.hpp + ChangeNotifyWidget.hpp + ClockWidget.hpp + CodeItemWidget.hpp + ComboMulti.hpp + CommandDesignerWidget.hpp + CommandOutput.hpp + CommandOutputDialog.hpp + CommandOutputWidget.hpp + CustomCommandDialog.hpp + CustomListWidget.hpp + Dashboard.hpp + DashboardDialog.hpp + DashboardDock.hpp + DashboardTitle.hpp + DashboardWidget.hpp + EditItemWidget.hpp + EventEditor.hpp + FileFetchTask.hpp + FileWatcher.hpp + FilterWidget.hpp + GotoLineDialog.hpp + HistoryItemWidget.hpp + HtmlItemWidget.hpp + InfoPanel.hpp + InputEventLog.hpp + JobStatusItemWidget.hpp + LabelEditor.hpp + LimitEditor.hpp + LineEdit.hpp + LogProvider.hpp + MainWindow.hpp + MenuConfigDialog.hpp + MessageItemWidget.hpp + MeterEditor.hpp + ModelColumn.hpp + NodeFilterDialog.hpp + NodePanel.hpp + NodePathWidget.hpp + NodeQueryCombo.hpp + NodeQueryEditor.hpp + NodeQueryOptionEdit.hpp + NodeQueryEngine.hpp + NodeQueryResult.hpp + NodeQueryResultModel.hpp + NodeQueryResultView.hpp + NodeSearchWindow.hpp + NodeSearchWidget.hpp + NodeWidget.hpp + OneLineTextEdit.hpp + OutputBrowser.hpp + OutputCache.hpp + OutputClient.hpp + OutputFetchInfo.hpp + OutputFileClient.hpp + OutputDirClient.hpp + OutputItemWidget.hpp + OutputDirProvider.hpp + OutputDirWidget.hpp + PlainTextEdit.hpp + PlainTextWidget.hpp + PropertyDialog.hpp + PropertyEditor.hpp + PropertyLine.hpp + SaveSessionAsDialog.hpp + ShortcutHelpDialog.hpp + RepeatEditor.hpp + RichTextEdit.hpp + ServerComInfoWidget.hpp + ServerComQueue.hpp + ServerComThread.hpp + ServerHandler.hpp + ServerListDialog.hpp + ServerListSyncWidget.hpp + ServerSettingsItemWidget.hpp + SessionDialog.hpp + SessionRenameDialog.hpp + ShellCommand.hpp + StringMatchCombo.hpp + SuiteItemWidget.hpp + SuiteModel.hpp + TabWidget.hpp + TableFilterWidget.hpp + TableNodeModel.hpp + TableNodeSortModel.hpp + TableNodeView.hpp + TableNodeViewDelegate.hpp + TableNodeWidget.hpp + TextEditSearchLine.hpp + TextFilterHandlerDialog.hpp + TextFilterWidget.hpp + TimelineData.hpp + TimelineHeaderView.hpp + TimelineInfoDailyView.hpp + TimelineInfoDailyWidget.hpp + TimelineInfoWidget.hpp + TimelineModel.hpp + TimelineView.hpp + TimelineWidget.hpp + TreeNodeModel.hpp + TreeNodeView.hpp + TreeNodeViewDelegate.hpp + TreeNodeWidget.hpp + TriggerEditor.hpp + TriggerGraphWidget.hpp + TriggerGraphView.hpp + TriggerItemWidget.hpp + TriggerTableView.hpp + TriggerTableWidget.hpp + TriggeredScanner.hpp + VariableEditor.hpp + VariableItemWidget.hpp + VariableModel.hpp + VariableModelData.hpp + VariableSearchLine.hpp + VFileTransfer.hpp + VFilter.hpp + VModelData.hpp + VNodeList.hpp + WhyItemWidget.hpp + ZombieItemWidget.hpp + TextPager/TextCodecWrapper.hpp + TextPager/TextPagerCursor_p.hpp + TextPager/TextPagerDocument.hpp + TextPager/TextPagerDocument_p.hpp + TextPager/TextPagerEdit.hpp + TextPager/TextPagerEdit_p.hpp + TextPager/TextPagerSection_p.hpp + TextPager/TextPagerWidget.hpp + TextPager/syntaxhighlighter.hpp ) set(viewer_wrap_ui_files - AboutDialog.ui - AddLabelDialog.ui - AddModelColumnDialog.ui - AttributeEditorDialog.ui - ChangeNotifyDialog.ui - ChangeNotifyDialogWidget.ui - ChangeNotifyEditor.ui - CommandDesignerWidget.ui - CommandOutputDialog.ui - CommandOutputWidget.ui - CustomCommandDialog.ui - CodeItemWidget.ui - DashboardDialog.ui - DashboardDockTitleWidget.ui - EditItemWidget.ui - EventEditorWidget.ui - GotoLineDialog.ui - HistoryItemWidget.ui - HtmlItemWidget.ui - InfoPanel.ui - LabelEditorWidget.ui - LimitEditorWidget.ui - #LogLoadWidget.ui - MainWindow.ui - MessageItemWidget.ui - MenuConfigDialog.ui - MeterEditorWidget.ui - NodeFilterDialog.ui - NodeQueryEditor.ui - NodeQuerySaveDialog.ui - NodeSearchWindow.ui - NodeSearchWidget.ui - OutputFetchInfo.ui - OutputItemWidget.ui - OutputDirWidget.ui - PlainTextWidget.ui - PropertyDialog.ui - PropertyEditor.ui - RepeatEditorWidget.ui - SaveSessionAsDialog.ui - SearchLineWidget.ui - ServerAddDialog.ui - ServerEditDialog.ui - ServerListDialog.ui - ServerListSyncWidget.ui - ServerLoadItemWidget.ui - ServerSettingsItemWidget.ui - SessionDialog.ui - SessionRenameDialog.ui - ShortcutHelpDialog.ui - SuiteItemWidget.ui - TableFilterWidget.ui - TableNodeWidget.ui - TextFilterAddDialog.ui - TextFilterHandlerDialog.ui - TextFilterWidget.ui - TimelineInfoDailyWidget.ui - TimelineInfoWidget.ui - TimelinePreLoadDialog.ui - TimelineWidget.ui - TreeNodeWidget.ui - TriggerEditorWidget.ui - TriggerGraphWidget.ui - TriggerItemWidget.ui - TriggerTableWidget.ui - VariableAddDialog.ui - VariableEditorWidget.ui - VariablePropDialog.ui - VariableItemWidget.ui - ZombieItemWidget.ui + AboutDialog.ui + AddLabelDialog.ui + AddModelColumnDialog.ui + AttributeEditorDialog.ui + ChangeNotifyDialog.ui + ChangeNotifyDialogWidget.ui + ChangeNotifyEditor.ui + CommandDesignerWidget.ui + CommandOutputDialog.ui + CommandOutputWidget.ui + CustomCommandDialog.ui + CodeItemWidget.ui + DashboardDialog.ui + DashboardDockTitleWidget.ui + EditItemWidget.ui + EventEditorWidget.ui + GotoLineDialog.ui + HistoryItemWidget.ui + HtmlItemWidget.ui + InfoPanel.ui + LabelEditorWidget.ui + LimitEditorWidget.ui + MainWindow.ui + MessageItemWidget.ui + MenuConfigDialog.ui + MeterEditorWidget.ui + NodeFilterDialog.ui + NodeQueryEditor.ui + NodeQuerySaveDialog.ui + NodeSearchWindow.ui + NodeSearchWidget.ui + OutputFetchInfo.ui + OutputItemWidget.ui + OutputDirWidget.ui + PlainTextWidget.ui + PropertyDialog.ui + PropertyEditor.ui + RepeatEditorWidget.ui + SaveSessionAsDialog.ui + SearchLineWidget.ui + ServerAddDialog.ui + ServerEditDialog.ui + ServerListDialog.ui + ServerListSyncWidget.ui + ServerLoadItemWidget.ui + ServerSettingsItemWidget.ui + SessionDialog.ui + SessionRenameDialog.ui + ShortcutHelpDialog.ui + SuiteItemWidget.ui + TableFilterWidget.ui + TableNodeWidget.ui + TextFilterAddDialog.ui + TextFilterHandlerDialog.ui + TextFilterWidget.ui + TimelineInfoDailyWidget.ui + TimelineInfoWidget.ui + TimelinePreLoadDialog.ui + TimelineWidget.ui + TreeNodeWidget.ui + TriggerEditorWidget.ui + TriggerGraphWidget.ui + TriggerItemWidget.ui + TriggerTableWidget.ui + VariableAddDialog.ui + VariableEditorWidget.ui + VariablePropDialog.ui + VariableItemWidget.ui + ZombieItemWidget.ui ) if(ECFLOW_LOGVIEW) - list(APPEND viewer_srcs - # HEADERS - LogLoadWidget.hpp - LogLoadView.hpp - # SOURCES - LogLoadWidget.cpp - LogLoadView.cpp) - list(APPEND viewer_moc_files - LogLoadWidget.hpp - LogLoadView.hpp) + list(APPEND viewer_moc_files + LogLoadWidget.hpp + LogLoadView.hpp) + list(APPEND viewer_wrap_ui_files + LogLoadWidget.ui) endif() -#set(wrap_ui_files -# LogLoadWidget.ui -# ) - -if(ECFLOW_LOGVIEW) - list(APPEND viewer_wrap_ui_files - LogLoadWidget.ui - ) -endif() - - if(ECFLOW_QT6) - QT6_WRAP_CPP(VIEWER_MOC ${viewer_moc_files} ) - QT6_ADD_RESOURCES (VIEWER_RES viewer.qrc) - QT6_WRAP_UI (VIEWER_FORMS_HEADERS ${viewer_wrap_ui_files}) + qt6_wrap_cpp(VIEWER_MOC ${viewer_moc_files} TARGET ecflow_ui.x) + qt6_add_resources(VIEWER_RES viewer.qrc) + qt6_wrap_ui(VIEWER_FORMS_HEADERS ${viewer_wrap_ui_files}) elseif(ECFLOW_QT5) - QT5_WRAP_CPP(VIEWER_MOC ${viewer_moc_files} ) - QT5_ADD_RESOURCES (VIEWER_RES viewer.qrc) - QT5_WRAP_UI (VIEWER_FORMS_HEADERS ${viewer_wrap_ui_files}) + qt5_wrap_cpp(VIEWER_MOC ${viewer_moc_files} TARGET ecflow_ui.x) + qt5_add_resources(VIEWER_RES viewer.qrc) + qt5_wrap_ui(VIEWER_FORMS_HEADERS ${viewer_wrap_ui_files}) endif() - # add all the images as dependencies of the resource file so that it is # automatically recompiled when an image changes -file( GLOB image_files "${CMAKE_CURRENT_SOURCE_DIR}/../images/*.*" ) -ADD_CUSTOM_TARGET(Qt_resource_cpp DEPENDS ${VIEWER_RES}) -ADD_DEPENDENCIES(Qt_resource_cpp ${image_files}) - - +file(GLOB image_files "${CMAKE_CURRENT_SOURCE_DIR}/../images/*.*") +add_custom_target(Qt_resource_cpp DEPENDS ${VIEWER_RES}) +add_dependencies(Qt_resource_cpp ${image_files}) -add_definitions( -DECFLOW_SHARED_DIR="${CMAKE_INSTALL_PREFIX}/share/ecflow" ) - - -ecbuild_add_executable( TARGET ecflow_ui.x - SOURCES ${viewer_srcs} ${VIEWER_MOC} ${VIEWER_RES} ${VIEWER_FORMS_HEADERS} - INCLUDES . - ../../libViewer/src - ../../../ACore/src - ../../../ANattr/src - ../../../ANode/src - ../../../ANode/test - ../../../Base/src - ../../../Base/src/cts - ../../../Base/src/stc - ../../../Client/src - TextPager - ${Boost_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - LIBS viewer core nodeattr node base libclient - pthread - m dl - ${ECFLOW_QT_LIBRARIES} - ${OPENSSL_LIBRARIES} +ecbuild_add_executable( + TARGET + ecflow_ui.x + SOURCES + ${viewer_srcs} + ${VIEWER_MOC} + ${VIEWER_RES} + ${VIEWER_FORMS_HEADERS} + INCLUDES + . + TextPager + ${CMAKE_CURRENT_BINARY_DIR} + LIBS + viewer + libclient + base + node + Threads::Threads + m + dl + $<$:OpenSSL::SSL> + # Qt5 + $<$:Qt5::Core> + $<$:Qt5::Gui> + $<$:Qt5::Svg> + $<$:Qt5::Widgets> + $<$:Qt5::Network> + $<$:Qt5::Charts> + # Qt6 + $<$:Qt6::Core> + $<$:Qt6::Gui> + $<$:Qt6::Svg> + $<$:Qt6::Widgets> + $<$:Qt6::Network> + $<$:Qt6::Charts> + $<$:Qt6::Core5Compat> ) - target_clangformat(ecflow_ui.x) -if(0) -set(logviewer_srcs +set(ENABLE_ECFLOW_UI_LOG "OFF") +# The following target, ecflow_ui_log, is inconsistent +# in the sense that no main() is defined. + +if(${ENABLE_ECFLOW_UI_LOG}) + + set(logviewer_srcs AboutDialog.cpp ClockWidget.cpp DirectoryHandler.cpp @@ -861,33 +865,50 @@ set(logviewer_srcs UserMessage.cpp VConfig.cpp VConfigLoader.cpp - ) -endif() + ) -set(build_ecflow_ui_log 0) + list(REMOVE_ITEM viewer_srcs ViewerMain.cpp) -if(${build_ecflow_ui_log}) - list(REMOVE_ITEM viewer_srcs ViewerMain.cpp) - ecbuild_add_executable( TARGET ecflow_ui_log - SOURCES LogEvent.cpp - ${viewer_srcs} ${VIEWER_MOC} ${VIEWER_RES} ${VIEWER_FORMS_HEADERS} - INCLUDES . - ../../ACore/src - ../../ANattr/src - ../../ANode/src - ../../ANode/test - ../../Base/src - ../../Base/src/cts - ../../Base/src/stc - ../../Client/src - ${Boost_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - LIBS core nodeattr node base libclient - pthread - m - ${ECFLOW_QT_LIBRARIES} - DEFINITIONS MAIN_LOG - ) + ecbuild_add_executable( + TARGET + ecflow_ui_log + SOURCES + #LogEvent.cpp + ${viewer_srcs} + ${VIEWER_MOC} + ${VIEWER_RES} + ${VIEWER_FORMS_HEADERS} + INCLUDES + . + TextPager + ${CMAKE_CURRENT_BINARY_DIR} + DEFINITIONS + MAIN_LOG + LIBS + viewer + libclient + base + node + Threads::Threads + m + dl + $<$:OpenSSL::SSL> + # Qt5 + $<$:Qt5::Core> + $<$:Qt5::Gui> + $<$:Qt5::Svg> + $<$:Qt5::Widgets> + $<$:Qt5::Network> + $<$:Qt5::Charts> + # Qt6 + $<$:Qt6::Core> + $<$:Qt6::Gui> + $<$:Qt6::Svg> + $<$:Qt6::Widgets> + $<$:Qt6::Network> + $<$:Qt6::Charts> + $<$:Qt6::Core5Compat> + ) + target_clangformat(ecflow_ui_log) - target_clangformat(ecflow_ui_log) endif() diff --git a/Viewer/libViewer/CMakeLists.txt b/Viewer/libViewer/CMakeLists.txt index 179ef40bc..21e450997 100644 --- a/Viewer/libViewer/CMakeLists.txt +++ b/Viewer/libViewer/CMakeLists.txt @@ -1,16 +1,11 @@ -# avoid warning about dependency targets that don't exit # -# CMake Warning (dev) at Viewer/src/CMakeLists.txt:261 (ADD_DEPENDENCIES): -# Policy CMP0046 is not set: Error on non-existent dependency in -# add_dependencies. Run "cmake --help-policy CMP0046" for policy details. -# Use the cmake_policy command to set the policy and suppress this warning. +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # -# The dependency target -# "/tmp/ma0/workspace/ecflow/Viewer/src/../images/zombie_dock.svg" of target -# "Qt_resource_cpp" does not exist. - -if (POLICY CMP0046) - cmake_policy(SET CMP0046 OLD) -endif() add_subdirectory( src ) diff --git a/Viewer/libViewer/src/CMakeLists.txt b/Viewer/libViewer/src/CMakeLists.txt index 20c701fa2..5acd22e06 100644 --- a/Viewer/libViewer/src/CMakeLists.txt +++ b/Viewer/libViewer/src/CMakeLists.txt @@ -1,104 +1,102 @@ +# +# Copyright 2023- ECMWF. +# +# This software is licensed under the terms of the Apache Licence version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. +# + set(srcs - # HEADERS - DirectoryHandler.hpp - IconProvider.hpp - LocalSocketServer.hpp - LogConsumer.hpp - LogData.hpp - LogModel.hpp - LogTruncator.hpp - LogView.hpp - MessageLabel.hpp - Palette.hpp - TextFormat.hpp - UIDebug.hpp - UiLog.hpp - UserMessage.hpp - # SOURCES - DirectoryHandler.cpp - IconProvider.cpp - LocalSocketServer.cpp - LogConsumer.hpp - LogData.cpp - LogModel.cpp - LogTruncator.cpp - LogView.cpp - MessageLabel.cpp - Palette.cpp - TextFormat.cpp - UIDebug.cpp - UiLog.cpp - UserMessage.cpp + # Headers + DirectoryHandler.hpp + IconProvider.hpp + LocalSocketServer.hpp + LogConsumer.hpp + LogData.hpp + LogModel.hpp + LogTruncator.hpp + LogView.hpp + MessageLabel.hpp + Palette.hpp + TextFormat.hpp + UIDebug.hpp + UiLog.hpp + UserMessage.hpp + $<$:LogLoadData.hpp> + # Sources + DirectoryHandler.cpp + IconProvider.cpp + LocalSocketServer.cpp + LogConsumer.hpp + LogData.cpp + LogModel.cpp + LogTruncator.cpp + LogView.cpp + MessageLabel.cpp + Palette.cpp + TextFormat.cpp + UIDebug.cpp + UiLog.cpp + UserMessage.cpp + $<$:LogLoadData.cpp> ) -if(ECFLOW_LOGVIEW) - list(APPEND srcs - # HEADERS - LogLoadData.hpp - # SOURCES - LogLoadData.cpp) -endif() - -if(ECFLOW_QT) - include_directories(${ECFLOW_QT_INCLUDE_DIR}) -#else() -# include(${QT_USE_FILE}) -# set(ECFLOW_QT_LIBRARIES ${QT_LIBRARIES}) -endif() - - set(moc_files - LocalSocketServer.hpp - LogModel.hpp - LogTruncator.hpp - LogView.hpp - MessageLabel.hpp + LocalSocketServer.hpp + LogModel.hpp + LogTruncator.hpp + LogView.hpp + MessageLabel.hpp ) if(ECFLOW_LOGVIEW) - list(APPEND moc_files LogLoadData.hpp) + list(APPEND moc_files LogLoadData.hpp) endif() - -#if(ECFLOW_LOGVIEW) -# list(APPEND moc_files LogLoadWidget.hpp) -#endif() - -#set(wrap_ui_files -# LogLoadWidget.ui -# ) - -#if(ECFLOW_LOGVIEW) -# set(wrap_ui_files -# LogLoadWidget.ui -# ) -#endif() - if(ECFLOW_QT6) - QT6_WRAP_CPP(LIBVIEWER_MOC ${moc_files} ) - QT6_WRAP_UI (LIBVIEWER_FORMS_HEADERS ${wrap_ui_files}) + qt6_wrap_cpp(LIBVIEWER_MOC ${moc_files} TARGET viewer) + qt6_wrap_ui(LIBVIEWER_FORMS_HEADERS ${wrap_ui_files}) elseif(ECFLOW_QT5) - QT5_WRAP_CPP(LIBVIEWER_MOC ${moc_files} ) - QT5_WRAP_UI (LIBVIEWER_FORMS_HEADERS ${wrap_ui_files}) + qt5_wrap_cpp(LIBVIEWER_MOC ${moc_files} TARGET viewer) + qt5_wrap_ui(LIBVIEWER_FORMS_HEADERS ${wrap_ui_files}) endif() -# add all the images as dependencies of the resource file so that it is -# automatically recompiled when an image changes -#file( GLOB image_files "${CMAKE_CURRENT_SOURCE_DIR}/../images/*.*" ) -#ADD_CUSTOM_TARGET(Qt_resource_cpp DEPENDS ${VIEWER_RES}) -#ADD_DEPENDENCIES(Qt_resource_cpp ${image_files}) - -add_definitions( -DECFLOW_SHARED_DIR="${CMAKE_INSTALL_PREFIX}/share/ecflow" ) - -ecbuild_add_library( TARGET viewer - NOINSTALL - TYPE STATIC - SOURCES ${srcs} ${LIBVIEWER_MOC} ${LIBVIEWER_RES} ${LIBVIEWER_FORMS_HEADERS} - ) -target_include_directories( viewer PRIVATE . - ../../../ACore/src - ${Boost_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} -) - +ecbuild_add_library( + TARGET + viewer + NOINSTALL + TYPE STATIC + SOURCES + ${srcs} + ${LIBVIEWER_MOC} + ${LIBVIEWER_RES} + ${LIBVIEWER_FORMS_HEADERS} + PUBLIC_INCLUDES + . + PRIVATE_INCLUDES + ${CMAKE_CURRENT_BINARY_DIR} + PRIVATE_DEFINITIONS + ECFLOW_SHARED_DIR="${CMAKE_INSTALL_PREFIX}/share/ecflow" + PRIVATE_LIBS + core + Boost::boost + $<$:OpenSSL::SSL> + # Qt5 + $<$:Qt5::Core> + $<$:Qt5::Gui> + $<$:Qt5::Svg> + $<$:Qt5::Widgets> + $<$:Qt5::Network> + $<$:Qt5::Charts> + # Qt6 + $<$:Qt6::Core> + $<$:Qt6::Gui> + $<$:Qt6::Svg> + $<$:Qt6::Widgets> + $<$:Qt6::Network> + $<$:Qt6::Charts> + $<$:Qt6::Core5Compat> +) target_clangformat( viewer )