From 4471dbd32b3d91e28de3206fce2b906ccb205a0f Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 1 Aug 2023 14:31:18 +0200 Subject: [PATCH] Do not run try_compile if OSQP_IS_V1 is already defined (#145) --- cmake/OsqpEigenDependencies.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/OsqpEigenDependencies.cmake b/cmake/OsqpEigenDependencies.cmake index e2aa456..75727ed 100644 --- a/cmake/OsqpEigenDependencies.cmake +++ b/cmake/OsqpEigenDependencies.cmake @@ -11,7 +11,9 @@ include(OsqpEigenFindOptionalDependencies) ## Required Dependencies find_package(Eigen3 3.2.92 REQUIRED) find_package(osqp REQUIRED) -try_compile(OSQP_IS_V1 ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/try-osqp.cpp LINK_LIBRARIES osqp::osqp) +if(NOT DEFINED OSQP_IS_V1) + try_compile(OSQP_IS_V1 ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/try-osqp.cpp LINK_LIBRARIES osqp::osqp) +endif() #--------------------------------------------- ## Optional Dependencies