Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for units to be sourced from outside. #2396

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -296,21 +296,23 @@ else()
endif()
endif()

add_subdirectory(ext)
install(TARGETS ext-hwloc EXPORT arbor-targets)
install(TARGETS ext-random123 EXPORT arbor-targets)
target_link_libraries(arbor-public-deps INTERFACE ext-units)
install(TARGETS compile_flags_target EXPORT arbor-targets)

add_library(ext-units INTERFACE)
if(ARB_USE_BUNDLED_UNITS)
target_link_libraries(ext-units INTERFACE units::units)
install(TARGETS ext-units units EXPORT arbor-targets)
else()
message(FATAL, "TODO: At the time of Arbor 0.10.0 there is no Spack package")
find_package(units REQUIRED)
target_link_directories(ext-units INTERFACE ${units_LIBRARY_DIRS})
target_link_libraries(ext-units INTERFACE ${units_LIBRARY})
target_include_directories(ext-units INTERFACE ${units_INCLUDE_DIR})
endif()


add_subdirectory(ext)
install(TARGETS ext-hwloc EXPORT arbor-targets)
install(TARGETS ext-random123 EXPORT arbor-targets)
target_link_libraries(arbor-public-deps INTERFACE ext-units)
install(TARGETS ext-units EXPORT arbor-targets)
install(TARGETS units compile_flags_target EXPORT arbor-targets)

# Keep track of packages we need to add to the generated CMake config
# file for arbor.

Expand Down
2 changes: 1 addition & 1 deletion ext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ if (ARB_USE_BUNDLED_UNITS)
set(UNITS_BUILD_CONVERTER_APP OFF CACHE INTERNAL "")
set(UNITS_BUILD_WEBSERVER OFF CACHE INTERNAL "")
set(UNITS_INSTALL ON CACHE INTERNAL "")
# set(UNITS_NAMESPACE "llnl::units" CACHE INTERNAL "")
set(UNITS_BINARY_ONLY_INSTALL ON CACHE INTERNAL "")

add_subdirectory("${PROJECT_SOURCE_DIR}/ext/units" "${PROJECT_BINARY_DIR}/ext/units")

Expand Down