Skip to content

Commit

Permalink
Merge pull request #267 from jcortial-safran/cmake-config
Browse files Browse the repository at this point in the history
Only find dependency when required
  • Loading branch information
Algiane committed May 3, 2024
2 parents fe5ce20 + 61633ea commit 69e1504
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake/config/mmgConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ include(CMakeFindDependencyMacro)
# required for `find_dependency({SCOTCH,VTK}) to work.
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}")

find_dependency(SCOTCH)
find_dependency(VTK)
if("@SCOTCH_FOUND@" AND NOT "@USE_SCOTCH@" MATCHES OFF)
find_dependency(SCOTCH)
endif()

if("@VTK_FOUND@" AND NOT "@USE_VTK@" MATCHES OFF)
find_dependency(VTK)
endif()

if (NOT TARGET Mmg::mmg )
include(${CMAKE_CURRENT_LIST_DIR}/MmgTargets.cmake)
Expand Down

0 comments on commit 69e1504

Please sign in to comment.