Skip to content

Instantly share code, notes, and snippets.

@alecjacobson
Created June 26, 2023 13:58
Show Gist options
  • Save alecjacobson/d265aa4b140a5aa80fa234adbcb3238f to your computer and use it in GitHub Desktop.
Save alecjacobson/d265aa4b140a5aa80fa234adbcb3238f to your computer and use it in GitHub Desktop.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8801572..a4ab77b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,9 +21,11 @@ include(FeatureSummary) # More verbose Output for libraries using set_package_pr
# Look for supporting libraries
# -----------------------------
-find_package(Eigen3 NO_MODULE REQUIRED)
-set_package_properties(Eigen3 PROPERTIES TYPE REQUIRED PURPOSE "C++ vector data structures")
-message(STATUS "Found Eigen3 Version: ${Eigen3_VERSION} Path: ${Eigen3_DIR}")
+if(NOT TARGET Eigen3::Eigen)
+ findjpackage(Eigen3 NO_MODULE REQUIRED)
+ set_package_properties(Eigen3 PROPERTIES TYPE REQUIRED PURPOSE "C++ vector data structures")
+ message(STATUS "Found Eigen3 Version: ${Eigen3_VERSION} Path: ${Eigen3_DIR}")
+endif()
# Setup library
# -------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment