From 61b70bdb337674691c01c6dd2d72132a95c0dee8 Mon Sep 17 00:00:00 2001 From: Chris Kulla Date: Mon, 29 Apr 2024 22:59:39 -0700 Subject: [PATCH] Use FetchContent for robin-map Signed-off-by: Chris Kulla --- src/cmake/externalpackages.cmake | 10 ++++++++-- src/liboslexec/CMakeLists.txt | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake index 4bec07bf3..9a85e8f84 100644 --- a/src/cmake/externalpackages.cmake +++ b/src/cmake/externalpackages.cmake @@ -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 diff --git a/src/liboslexec/CMakeLists.txt b/src/liboslexec/CMakeLists.txt index ee59d9d1b..86402c034 100644 --- a/src/liboslexec/CMakeLists.txt +++ b/src/liboslexec/CMakeLists.txt @@ -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 @@ -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} @@ -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}