Skip to content

Commit

Permalink
Use FetchContent for robin-map
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Kulla <ckulla@gmail.com>
  • Loading branch information
fpsunflower committed Apr 30, 2024
1 parent ed4a1a6 commit 61b70bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/cmake/externalpackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,20 @@ message (STATUS "CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")


include (ExternalProject)
include(FetchContent)

option (BUILD_MISSING_DEPS "Try to download and build any missing dependencies" OFF)

FetchContent_Declare(
tsl-robin-map
GIT_REPOSITORY https://github.com/Tessil/robin-map.git
GIT_TAG v1.3.0
FIND_PACKAGE_ARGS NAMES tsl-robin-map
)
FetchContent_MakeAvailable(tsl-robin-map)

checked_find_package (ZLIB REQUIRED) # Needed by several packages

checked_find_package(tsl-robin-map REQUIRED)

# IlmBase & OpenEXR
checked_find_package (OpenEXR REQUIRED
VERSION_MIN 2.4
Expand Down
4 changes: 4 additions & 0 deletions src/liboslexec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@ foreach(batched_target ${BATCHED_TARGET_LIST})
PUBLIC
${CMAKE_INSTALL_FULL_INCLUDEDIR}
${IMATH_INCLUDES}
PRIVATE
${tsl-robin-map_INCLUDE_DIRS}
)
target_link_libraries (${batched_target_lib}
PUBLIC
Expand All @@ -535,6 +537,7 @@ target_include_directories (${local_lib}
${CMAKE_INSTALL_FULL_INCLUDEDIR}
${IMATH_INCLUDES}
PRIVATE
${tsl-robin-map_INCLUDE_DIRS}
"${CMAKE_SOURCE_DIR}/src/liboslcomp"
)
target_compile_definitions (${local_lib}
Expand Down Expand Up @@ -580,6 +583,7 @@ target_link_libraries (${local_lib}
${ILMBASE_LIBRARIES}
PRIVATE
pugixml::pugixml
tsl::robin_map
${CMAKE_DL_LIBS}
${CLANG_LIBRARIES}
${LLVM_LIBRARIES} ${LLVM_LDFLAGS} ${LLVM_SYSTEM_LIBRARIES}
Expand Down

0 comments on commit 61b70bd

Please sign in to comment.