Browse Source

cmake: Don't build all utils unless required by modules

- Build always kamctl and kamcmd
- The rest of utils should be included from the module that requires them or a new add_subdirectory in src/CMakelists.txt
Xenofon Karamanos 8 months ago
parent
commit
001390d802
2 changed files with 6 additions and 1 deletions
  1. 3 1
      CMakeLists.txt
  2. 3 0
      src/modules/db_berkeley/CMakeLists.txt

+ 3 - 1
CMakeLists.txt

@@ -51,7 +51,9 @@ include(${CMAKE_SOURCE_DIR}/cmake/defs.cmake)
 add_subdirectory(src)
 
 # Add utils
-add_subdirectory(utils)
+# add_subdirectory(utils)
+add_subdirectory(utils/kamctl)
+add_subdirectory(utils/kamcmd)
 
 # TODO: Packaging stuuf. These should be on different file propably
 set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})

+ 3 - 0
src/modules/db_berkeley/CMakeLists.txt

@@ -8,4 +8,7 @@ find_package(BerkeleyDB REQUIRED)
 target_link_libraries(${module_name} PRIVATE BerkeleyDB::BerkeleyDB)
 
 # Build also the util function found in utils/db_berkeley/
+# This is needed to build the kamdb_recover utility
+add_subdirectory(${CMAKE_SOURCE_DIR}/utils/db_berkeley
+                 ${CMAKE_BINARY_DIR}/utils/db_berkeley)
 add_dependencies(${module_name} kamdb_recover)