From 12bf62f51e18776586ef1406dc092cfbadd0aa64 Mon Sep 17 00:00:00 2001 From: suhrke Date: Sat, 25 Mar 2023 19:23:15 -0700 Subject: [PATCH] Support git eigen3 and nonstandard install locations --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63e2385..cc89ddd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ project(reflex2q3 CXX) set(OBJ_SRC "src/planes.cpp" "src/brushdef.cpp" "src/oopless-parser.cpp" "src/EntityConverter.cpp") add_library(objects OBJECT ${OBJ_SRC}) + add_executable(reflex2q3 src/main.cpp) add_executable(runtests test/catch.cpp) target_link_libraries(reflex2q3 objects) @@ -14,10 +15,15 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED True) find_package(PkgConfig) -pkg_check_modules(EIGEN REQUIRED eigen3) +pkg_check_modules(EIGEN eigen3) +if ( NOT EIGEN_FOUND) #use local + message ( WARNING "Install eigen3 using your package manager. If using git eigen3 or a non-standard install location, ensure environment variable EIGEN3_INCLUDE_DIR is set." ) + include_directories ( "$ENV{EIGEN3_INCLUDE_DIR}" ) + find_package(Eigen3 REQUIRED NO_MODULE) +endif ( NOT EIGEN_FOUND) include_directories( - ${EIGEN_INCLUDE_DIRS} + ${EIGEN_INCLUDE_DIRS} #set by pkg_check_modules "lib/Catch/single_include/catch2" "lib/cxxopts/include" "include"