From add6dd867df270ed0139ca838659ab0184214647 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Mon, 4 Oct 2021 01:33:25 -0700 Subject: [PATCH 01/10] Move flatbuffers --- .gitmodules | 2 +- flatbuffers => third_party/flatbuffers | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename flatbuffers => third_party/flatbuffers (100%) diff --git a/.gitmodules b/.gitmodules index e8ed3fe1..c1428977 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "flatbuffers"] - path = flatbuffers + path = third_party/flatbuffers url = https://github.com/google/flatbuffers.git [submodule "spdlog"] path = spdlog diff --git a/flatbuffers b/third_party/flatbuffers similarity index 100% rename from flatbuffers rename to third_party/flatbuffers From 1b9135808dbb95e45b0dc8f9e06182dc626b26eb Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Mon, 4 Oct 2021 01:34:18 -0700 Subject: [PATCH 02/10] Move spdlog --- .gitmodules | 2 +- spdlog => third_party/spdlog | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename spdlog => third_party/spdlog (100%) diff --git a/.gitmodules b/.gitmodules index c1428977..e576e7ea 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,7 +2,7 @@ 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 diff --git a/spdlog b/third_party/spdlog similarity index 100% rename from spdlog rename to third_party/spdlog From cdad683508a33ebe1eea631a4b0532f33d242f59 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Mon, 4 Oct 2021 01:35:06 -0700 Subject: [PATCH 03/10] Move cpputest --- .gitmodules | 2 +- cpputest => third_party/cpputest | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename cpputest => third_party/cpputest (100%) diff --git a/.gitmodules b/.gitmodules index e576e7ea..3b227ff1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,7 +5,7 @@ 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 diff --git a/cpputest b/third_party/cpputest similarity index 100% rename from cpputest rename to third_party/cpputest From 93f02692c7be4735cafd9513aee0d1ae9ded9204 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Mon, 4 Oct 2021 01:35:23 -0700 Subject: [PATCH 04/10] Move fmt --- .gitmodules | 2 +- fmt => third_party/fmt | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename fmt => third_party/fmt (100%) diff --git a/.gitmodules b/.gitmodules index 3b227ff1..5520f695 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,7 +8,7 @@ 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 diff --git a/fmt b/third_party/fmt similarity index 100% rename from fmt rename to third_party/fmt From 1699e5bd95f21789bb86ad60b6767a1cb821bad9 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Mon, 4 Oct 2021 01:35:45 -0700 Subject: [PATCH 05/10] Move CLI11 --- .gitmodules | 2 +- CLI11 => third_party/CLI11 | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename CLI11 => third_party/CLI11 (100%) diff --git a/.gitmodules b/.gitmodules index 5520f695..f6c86349 100644 --- a/.gitmodules +++ b/.gitmodules @@ -11,7 +11,7 @@ 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 diff --git a/CLI11 b/third_party/CLI11 similarity index 100% rename from CLI11 rename to third_party/CLI11 From ac7e0dfe1f678462e40a5d183e0f6240913fba8c Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Mon, 4 Oct 2021 01:36:07 -0700 Subject: [PATCH 06/10] Move taskflow --- .gitmodules | 2 +- taskflow => third_party/taskflow | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename taskflow => third_party/taskflow (100%) diff --git a/.gitmodules b/.gitmodules index f6c86349..0600c21d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,7 +14,7 @@ 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 diff --git a/taskflow b/third_party/taskflow similarity index 100% rename from taskflow rename to third_party/taskflow From 650d9b3ef5b402c36246391523a70632a130eeba Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Mon, 4 Oct 2021 01:36:37 -0700 Subject: [PATCH 07/10] Move tiny-process-library --- .gitmodules | 2 +- tiny-process-library => third_party/tiny-process-library | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tiny-process-library => third_party/tiny-process-library (100%) diff --git a/.gitmodules b/.gitmodules index 0600c21d..7deee242 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,5 +17,5 @@ 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/tiny-process-library b/third_party/tiny-process-library similarity index 100% rename from tiny-process-library rename to third_party/tiny-process-library From fbdb4d3b0f8bc09484d94061483b2de022cfa40d Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Mon, 4 Oct 2021 01:57:56 -0700 Subject: [PATCH 08/10] Cleaned root CMakeLists.txt - Added libraries to cmake/target/*.cmake files --- CMakeLists.txt | 41 ++++------------------------------ cmake/target/cli11.cmake | 2 +- cmake/target/cpputest.cmake | 8 +++++++ cmake/target/flatbuffers.cmake | 18 +++++++++++++-- cmake/target/fmt.cmake | 4 ++++ cmake/target/spdlog.cmake | 8 +++++++ cmake/target/taskflow.cmake | 3 +++ cmake/target/tpl.cmake | 2 ++ 8 files changed, 46 insertions(+), 40 deletions(-) create mode 100644 cmake/target/cpputest.cmake create mode 100644 cmake/target/fmt.cmake create mode 100644 cmake/target/spdlog.cmake create mode 100644 cmake/target/taskflow.cmake 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..af9d0ee3 100644 --- a/cmake/target/flatbuffers.cmake +++ b/cmake/target/flatbuffers.cmake @@ -1,4 +1,18 @@ -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") file(GLOB FLATBUFFERS_INCLUDE_HEADERS "${FBS_DIR}/*.h") if(${BUILDCC_PRECOMPILE_HEADERS}) list(APPEND FLATBUFFERS_INCLUDE_HEADERS ${FBS_DIR}/pch/pch.h) @@ -8,7 +22,7 @@ add_library(flatbuffers_header_only INTERFACE ${FLATBUFFERS_INCLUDE_HEADERS} ) target_include_directories(flatbuffers_header_only INTERFACE - $ + $ $ ) 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..eae4be6a 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 From 611cad3f2436ec5287eb052664185ed586b55467 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Mon, 4 Oct 2021 02:11:27 -0700 Subject: [PATCH 09/10] Update flatbuffers.cmake --- cmake/target/flatbuffers.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/target/flatbuffers.cmake b/cmake/target/flatbuffers.cmake index af9d0ee3..0c59684b 100644 --- a/cmake/target/flatbuffers.cmake +++ b/cmake/target/flatbuffers.cmake @@ -13,6 +13,7 @@ set(FLATBUFFERS_ENABLE_PCH ${BUILDCC_PRECOMPILE_HEADERS} CACHE BOOL "Flatbuffers 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) @@ -22,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() From 19c02c23e69157bcebd7d45fa2485dba5b710a03 Mon Sep 17 00:00:00 2001 From: Niket Naidu Date: Mon, 4 Oct 2021 02:22:12 -0700 Subject: [PATCH 10/10] Update tpl.cmake --- cmake/target/tpl.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/target/tpl.cmake b/cmake/target/tpl.cmake index eae4be6a..8d0b7782 100644 --- a/cmake/target/tpl.cmake +++ b/cmake/target/tpl.cmake @@ -13,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()