diff --git a/src/cmake/CasADiConfig.cmake.in b/src/cmake/CasADiConfig.cmake.in index b05489802d..533867b50a 100644 --- a/src/cmake/CasADiConfig.cmake.in +++ b/src/cmake/CasADiConfig.cmake.in @@ -2,7 +2,9 @@ include(CMakeFindDependencyMacro) find_dependency(alpaqaCore CONFIG) -find_dependency(casadi) +if (@ALPAQA_WITH_EXTERNAL_CASADI@) + find_dependency(casadi) +endif() include("${CMAKE_CURRENT_LIST_DIR}/alpaqaCasADiTargets.cmake")