diff --git a/.gitmodules b/.gitmodules index e8ed3fe1..7deee242 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,21 +1,21 @@ [submodule "flatbuffers"] - path = flatbuffers + path = third_party/flatbuffers url = https://github.com/google/flatbuffers.git [submodule "spdlog"] - path = spdlog + path = third_party/spdlog url = https://github.com/gabime/spdlog.git [submodule "cpputest"] - path = cpputest + path = third_party/cpputest url = https://github.com/cpputest/cpputest.git [submodule "fmt"] - path = fmt + path = third_party/fmt url = https://github.com/fmtlib/fmt.git [submodule "CLI11"] - path = CLI11 + path = third_party/CLI11 url = https://github.com/CLIUtils/CLI11.git [submodule "taskflow"] - path = taskflow + path = third_party/taskflow url = https://github.com/taskflow/taskflow.git [submodule "tiny-process-library"] - path = tiny-process-library + path = third_party/tiny-process-library url = https://gitlab.com/eidheim/tiny-process-library.git diff --git a/CMakeLists.txt b/CMakeLists.txt index de3da2e3..fcd91505 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,53 +69,20 @@ include(cmake/tool/cppcheck.cmake) include(cmake/tool/doxygen.cmake) # Libraries - -# TODO, Update FLATBUFFERS option to conditionally compile FLATC - -# Set flatbuffer specific options here -set(FLATBUFFERS_BUILD_CPP17 ON CACHE BOOL "Flatbuffers C++17 support") -set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "Flatbuffers build tests") -set(FLATBUFFERS_BUILD_FLATC ${BUILDCC_FLATBUFFERS_FLATC} CACHE BOOL "Flatbuffers build flatc") -set(FLATBUFFERS_BUILD_FLATHASH OFF CACHE BOOL "Flatbuffers build flathash") -set(FLATBUFFERS_BUILD_FLATLIB OFF CACHE BOOL "Flatbuffers build flatlib") -set(FLATBUFFERS_LIBCXX_WITH_CLANG OFF CACHE BOOL "Flatbuffers LIBCXX") -set(FLATBUFFERS_INSTALL ON CACHE BOOL "Enable the installation of targets.") -set(FLATBUFFERS_ENABLE_PCH ${BUILDCC_PRECOMPILE_HEADERS} CACHE BOOL "Flatbuffers PCH") -add_subdirectory(flatbuffers) include(cmake/target/flatbuffers.cmake) -set(FMT_INSTALL ON CACHE BOOL "Fmt install") -add_subdirectory(fmt) -# TODO, Remove fmt library generation and install target -# set_target_properties(fmt PROPERTIES EXCLUDE_FROM_ALL ON) +include(cmake/target/fmt.cmake) -# set(SPDLOG_BUILD_SHARED ON CACHE BOOL "Spdlog built as dynamic library") -set(SPDLOG_INSTALL ON CACHE BOOL "Spdlog install") -set(SPDLOG_FMT_EXTERNAL OFF CACHE BOOL "Spdlog FMT external lib") -set(SPDLOG_FMT_EXTERNAL_HO ON CACHE BOOL "Spdlog FMT header only external lib") -set(SPDLOG_ENABLE_PCH ${BUILDCC_PRECOMPILE_HEADERS} CACHE BOOL "Spdlog PCH") -add_subdirectory(spdlog) -# TODO, Remove spdlog library generation and install target -# set_target_properties(spdlog PROPERTIES EXCLUDE_FROM_ALL ON) +include(cmake/target/spdlog.cmake) include(cmake/target/cli11.cmake) -set(TF_BUILD_TESTS OFF CACHE BOOL "TF Tests") -set(TF_BUILD_EXAMPLES OFF CACHE BOOL "TF Examples") -add_subdirectory(taskflow) +include(cmake/target/taskflow.cmake) -add_subdirectory(tiny-process-library) include(cmake/target/tpl.cmake) if (${TESTING}) - set(C++11 ON CACHE BOOL "CppUTests C++11 support") - set(CPPUTEST_FLAGS OFF CACHE BOOL "CppUTests Flags off") - set(WERROR ON CACHE BOOL "CppUTests all errors") - set(LONGLONG ON CACHE BOOL "CppUTests Long Long support") - set(TESTS OFF CACHE BOOL "CppUTests tests off") - set(TESTS_BUILD_DISCOVER OFF CACHE BOOL "CppUTests Tests discover") - set(VERBOSE_CONFIG OFF CACHE BOOL "Config print to screen") - add_subdirectory(cpputest) + include(cmake/target/cpputest.cmake) endif() # Coverage diff --git a/cmake/target/cli11.cmake b/cmake/target/cli11.cmake index 29a6379e..380052e1 100644 --- a/cmake/target/cli11.cmake +++ b/cmake/target/cli11.cmake @@ -1,4 +1,4 @@ -add_subdirectory(CLI11) +add_subdirectory(third_party/CLI11) file(GLOB CLI_INCLUDE_HEADERS "${CLI11_SOURCE_DIR}/include/CLI/*.hpp") if (${BUILDCC_INSTALL}) diff --git a/cmake/target/cpputest.cmake b/cmake/target/cpputest.cmake new file mode 100644 index 00000000..ffd19450 --- /dev/null +++ b/cmake/target/cpputest.cmake @@ -0,0 +1,8 @@ +set(C++11 ON CACHE BOOL "CppUTests C++11 support") +set(CPPUTEST_FLAGS OFF CACHE BOOL "CppUTests Flags off") +set(WERROR ON CACHE BOOL "CppUTests all errors") +set(LONGLONG ON CACHE BOOL "CppUTests Long Long support") +set(TESTS OFF CACHE BOOL "CppUTests tests off") +set(TESTS_BUILD_DISCOVER OFF CACHE BOOL "CppUTests Tests discover") +set(VERBOSE_CONFIG OFF CACHE BOOL "Config print to screen") +add_subdirectory(third_party/cpputest) diff --git a/cmake/target/flatbuffers.cmake b/cmake/target/flatbuffers.cmake index 3dccd740..0c59684b 100644 --- a/cmake/target/flatbuffers.cmake +++ b/cmake/target/flatbuffers.cmake @@ -1,4 +1,19 @@ -set(FBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flatbuffers/include/flatbuffers") + +# TODO, Update FLATBUFFERS option to conditionally compile FLATC + +# Set flatbuffer specific options here +set(FLATBUFFERS_BUILD_CPP17 ON CACHE BOOL "Flatbuffers C++17 support") +set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "Flatbuffers build tests") +set(FLATBUFFERS_BUILD_FLATC ${BUILDCC_FLATBUFFERS_FLATC} CACHE BOOL "Flatbuffers build flatc") +set(FLATBUFFERS_BUILD_FLATHASH OFF CACHE BOOL "Flatbuffers build flathash") +set(FLATBUFFERS_BUILD_FLATLIB OFF CACHE BOOL "Flatbuffers build flatlib") +set(FLATBUFFERS_LIBCXX_WITH_CLANG OFF CACHE BOOL "Flatbuffers LIBCXX") +set(FLATBUFFERS_INSTALL ON CACHE BOOL "Enable the installation of targets.") +set(FLATBUFFERS_ENABLE_PCH ${BUILDCC_PRECOMPILE_HEADERS} CACHE BOOL "Flatbuffers PCH") +add_subdirectory(third_party/flatbuffers) + +set(FBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/flatbuffers/include/flatbuffers") +set(FBS_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/flatbuffers/include") file(GLOB FLATBUFFERS_INCLUDE_HEADERS "${FBS_DIR}/*.h") if(${BUILDCC_PRECOMPILE_HEADERS}) list(APPEND FLATBUFFERS_INCLUDE_HEADERS ${FBS_DIR}/pch/pch.h) @@ -8,12 +23,12 @@ add_library(flatbuffers_header_only INTERFACE ${FLATBUFFERS_INCLUDE_HEADERS} ) target_include_directories(flatbuffers_header_only INTERFACE - $ + $ $ ) if (${BUILDCC_INSTALL}) install(TARGETS flatbuffers_header_only DESTINATION lib EXPORT flatbuffers_header_onlyConfig) - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/flatbuffers/include/ DESTINATION "include") + install(DIRECTORY ${FBS_INCLUDE_DIR} DESTINATION "include") install(EXPORT flatbuffers_header_onlyConfig DESTINATION "lib/cmake/flatbuffers_header_only") endif() diff --git a/cmake/target/fmt.cmake b/cmake/target/fmt.cmake new file mode 100644 index 00000000..53cafdcf --- /dev/null +++ b/cmake/target/fmt.cmake @@ -0,0 +1,4 @@ +set(FMT_INSTALL ON CACHE BOOL "Fmt install") +add_subdirectory(third_party/fmt) +# TODO, Remove fmt library generation and install target +# set_target_properties(fmt PROPERTIES EXCLUDE_FROM_ALL ON) diff --git a/cmake/target/spdlog.cmake b/cmake/target/spdlog.cmake new file mode 100644 index 00000000..26688c08 --- /dev/null +++ b/cmake/target/spdlog.cmake @@ -0,0 +1,8 @@ +# set(SPDLOG_BUILD_SHARED ON CACHE BOOL "Spdlog built as dynamic library") +set(SPDLOG_INSTALL ON CACHE BOOL "Spdlog install") +set(SPDLOG_FMT_EXTERNAL OFF CACHE BOOL "Spdlog FMT external lib") +set(SPDLOG_FMT_EXTERNAL_HO ON CACHE BOOL "Spdlog FMT header only external lib") +set(SPDLOG_ENABLE_PCH ${BUILDCC_PRECOMPILE_HEADERS} CACHE BOOL "Spdlog PCH") +add_subdirectory(third_party/spdlog) +# TODO, Remove spdlog library generation and install target +# set_target_properties(spdlog PROPERTIES EXCLUDE_FROM_ALL ON) diff --git a/cmake/target/taskflow.cmake b/cmake/target/taskflow.cmake new file mode 100644 index 00000000..5c2992ef --- /dev/null +++ b/cmake/target/taskflow.cmake @@ -0,0 +1,3 @@ +set(TF_BUILD_TESTS OFF CACHE BOOL "TF Tests") +set(TF_BUILD_EXAMPLES OFF CACHE BOOL "TF Examples") +add_subdirectory(third_party/taskflow) diff --git a/cmake/target/tpl.cmake b/cmake/target/tpl.cmake index db0078d7..8d0b7782 100644 --- a/cmake/target/tpl.cmake +++ b/cmake/target/tpl.cmake @@ -1,3 +1,5 @@ +add_subdirectory(third_party/tiny-process-library) + if (${BUILDCC_INSTALL}) install(TARGETS tiny-process-library EXPORT tiny-process-library-config @@ -11,5 +13,5 @@ if (${BUILDCC_INSTALL}) DESTINATION lib/cmake/tiny-process-library ) - install(FILES tiny-process-library/process.hpp DESTINATION include) + install(FILES third_party/tiny-process-library/process.hpp DESTINATION include) endif() diff --git a/CLI11 b/third_party/CLI11 similarity index 100% rename from CLI11 rename to third_party/CLI11 diff --git a/cpputest b/third_party/cpputest similarity index 100% rename from cpputest rename to third_party/cpputest diff --git a/flatbuffers b/third_party/flatbuffers similarity index 100% rename from flatbuffers rename to third_party/flatbuffers diff --git a/fmt b/third_party/fmt similarity index 100% rename from fmt rename to third_party/fmt diff --git a/spdlog b/third_party/spdlog similarity index 100% rename from spdlog rename to third_party/spdlog diff --git a/taskflow b/third_party/taskflow similarity index 100% rename from taskflow rename to third_party/taskflow diff --git a/tiny-process-library b/third_party/tiny-process-library similarity index 100% rename from tiny-process-library rename to third_party/tiny-process-library