Skip to content

Commit

Permalink
remove THORIN_INSTALL_DEPENDENCIES in favor of thorin_all target
Browse files Browse the repository at this point in the history
  • Loading branch information
leissa committed Jan 15, 2024
1 parent c2f8958 commit e5813b1
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 14 deletions.
19 changes: 6 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
option(BUILD_SHARED_LIBS "Build shared libraries." ON)
option(THORIN_BUILD_DOCS "If ON, Thorin will build the documentation (requires Doxygen)." OFF)
option(THORIN_BUILD_EXAMPLES "If ON, Thorin will build examples." OFF)
option(THORIN_INSTALL_DEPENDENCIES "If ON, Thorin's dependencies will be installed alongside Thorin (use when not installing globally)." OFF)

message(STATUS "Build type: ${CMAKE_BUILD_TYPE}; shared libs: ${BUILD_SHARED_LIBS}")

Expand All @@ -42,6 +41,8 @@ else()
add_compile_options(-Wall -Wextra)
endif()

add_custom_target(thorin_all)

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
find_program(MEMORYCHECK_COMMAND valgrind)
set(VALGRIND_COMMAND_OPTIONS "--leak-check=full --error-exitcode=1")
Expand All @@ -61,19 +62,11 @@ set(ABSL_PROPAGATE_CXX_STD ON)
set(ABSL_USE_EXTERNAL_GOOGLETEST ON)
set(ABSL_ENABLE_INSTALL ON)
set(FE_ABSL ON)
set(FE_INSTALL_DEPENDENCIES ${THORIN_INSTALL_DEPENDENCIES})
if(NOT THORIN_INSTALL_DEPENDENCIES)
add_subdirectory(external/abseil-cpp EXCLUDE_FROM_ALL)
add_subdirectory(external/fe EXCLUDE_FROM_ALL)
add_subdirectory(external/lyra EXCLUDE_FROM_ALL)
add_subdirectory(external/rang EXCLUDE_FROM_ALL)
else()
add_subdirectory(external/abseil-cpp)
add_subdirectory(external/fe)
add_subdirectory(external/lyra)
add_subdirectory(external/rang)
endif()

add_subdirectory(external/abseil-cpp)
add_subdirectory(external/fe)
add_subdirectory(external/lyra)
add_subdirectory(external/rang)
add_subdirectory(src)

if(THORIN_BUILD_EXAMPLES)
Expand Down
2 changes: 2 additions & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ add_custom_target(docs
${DOXY_INDEX_HTML}
${INTERNAL_LIST}
)

add_dependencies(thorin_all docs)
2 changes: 2 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ target_link_libraries(hello PRIVATE libthorin)
add_dependencies(hello thorin_all_plugins)
set_target_properties(hello PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/examples")
install(TARGETS hello EXPORT thorin-targets)

add_dependencies(thorin_all hello)
2 changes: 1 addition & 1 deletion external/fe
Submodule fe updated 2 files
+1 −5 CMakeLists.txt
+1 −1 docs/README.md
5 changes: 5 additions & 0 deletions gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ gtest_discover_tests(thorin-regex-gtest
TEST_PREFIX "thorin-regex-gtest."
DISCOVERY_TIMEOUT 60
)

add_dependencies(thorin_all
thorin-gtest
thorin-regex-gtest
)
2 changes: 2 additions & 0 deletions src/thorin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,5 @@ install(

add_subdirectory(cli)
add_subdirectory(plug)

add_dependencies(thorin_all libthorin)
2 changes: 2 additions & 0 deletions src/thorin/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ add_executable(thorin main.cpp)
target_link_libraries(thorin libthorin lyra)
set_target_properties(thorin PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
install(TARGETS thorin EXPORT thorin-targets)

add_dependencies(thorin_all libthorin)
2 changes: 2 additions & 0 deletions src/thorin/plug/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ foreach(PLUGIN ${THORIN_PLUGINS})
add_dependencies(thorin_all_plugins thorin_${PLUGIN})
add_dependencies(thorin_${PLUGIN} ${THORIN_INTERNAL_PLUGINS})
endforeach()

add_dependencies(thorin_all thorin_all_plugins)

0 comments on commit e5813b1

Please sign in to comment.