Skip to content

Commit

Permalink
Reverting back the fetchcontent logic and added policy (#537)
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Jomier <[email protected]>
  • Loading branch information
jjomier authored Oct 15, 2024
1 parent ff33107 commit a85b94d
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions operators/volume_renderer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,21 @@ FetchContent_Declare(
# enable CMP0077 to allow overwriting option() statements in FetchContent sub-projects
cmake_policy(SET CMP0077 NEW)

FetchContent_MakeAvailable(ClaraViz)
set(CLARA_VIZ_PUBLIC_CMAKE_TOOLS_DIR "${claraviz_SOURCE_DIR}/cmake")
add_subdirectory(${claraviz_SOURCE_DIR}/src ${claraviz_BINARY_DIR}/src)
# Allowing FetchContent_Populate() for now
# This should be updated when ClaraViz supports new version of CMake
if(POLICY CMP0169)
cmake_policy(SET CMP0169 OLD)
endif()

FetchContent_GetProperties(ClaraViz)
if(NOT claraviz_POPULATED)
FetchContent_Populate(ClaraViz)
set(CLARA_VIZ_PUBLIC_CMAKE_TOOLS_DIR "${claraviz_SOURCE_DIR}/cmake")
add_subdirectory(${claraviz_SOURCE_DIR}/thirdparty ${claraviz_BINARY_DIR}/thirdparty)
add_subdirectory(${claraviz_SOURCE_DIR}/src ${claraviz_BINARY_DIR}/src)
endif()

set(CLARA_VIZ_PUBLIC_CMAKE_TOOLS_DIR "${claraviz_SOURCE_DIR}/cmake")
set(FETCHCONTENT_QUIET ON)

find_package(clara_viz_renderer REQUIRED HINTS ${claraviz_SOURCE_DIR}/cmake)
Expand Down

0 comments on commit a85b94d

Please sign in to comment.