Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
1e74f791
Unverified
Commit
1e74f791
authored
Dec 05, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using eigen3
parent
d91f8d08
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
CMakeLists.txt
+20
-10
No files found.
CMakeLists.txt
View file @
1e74f791
...
@@ -214,20 +214,29 @@ endif()
...
@@ -214,20 +214,29 @@ endif()
find_package
(
ZLIB REQUIRED
)
find_package
(
ZLIB REQUIRED
)
find_package
(
Eigen3 QUIET
)
# Using Eigen3 is a bit of a thing. We don't want to build it completely since we
# only need a couple of header files. Nothing special. But often, eigen3 is already
# installed and then we prefer that.
find_package
(
Eigen3 3.4 QUIET
)
if
(
NOT Eigen3_FOUND
)
if
(
Eigen3_FOUND AND TARGET Eigen3::Eigen
)
get_target_property
(
EIGEN_INCLUDE_DIR Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES
)
else
()
# Create a private copy of eigen3 and populate it only, no need to build
FetchContent_Declare
(
FetchContent_Declare
(
E
igen3
my-e
igen3
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG 3.4.0
GIT_TAG 3.4.0
)
)
FetchContent_GetProperties
(
E
igen3
)
FetchContent_GetProperties
(
my-e
igen3
)
if
(
NOT Eigen3_POPULATED
)
FetchContent_Populate
(
Eigen3
)
if
(
NOT my-eigen3_POPULATED
)
add_subdirectory
(
${
Eigen3_SOURCE_DIR
}
${
Eigen3_BINARY_DIR
}
EXCLUDE_FROM_ALL
)
FetchContent_Populate
(
my-eigen3
)
endif
()
endif
()
set
(
EIGEN_INCLUDE_DIR
${
my-eigen3_SOURCE_DIR
}
)
endif
()
endif
()
include
(
FindFilesystem
)
include
(
FindFilesystem
)
...
@@ -339,11 +348,11 @@ target_include_directories(cifpp
...
@@ -339,11 +348,11 @@ target_include_directories(cifpp
"$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
>"
"$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
>"
PRIVATE
PRIVATE
"
${
BOOST_REGEX_INCLUDE_DIR
}
"
"
${
BOOST_REGEX_INCLUDE_DIR
}
"
"
${
EIGEN_INCLUDE_DIR
}
"
)
)
target_link_libraries
(
cifpp
target_link_libraries
(
cifpp
PUBLIC Threads::Threads ZLIB::ZLIB
${
CIFPP_REQUIRED_LIBRARIES
}
PUBLIC Threads::Threads ZLIB::ZLIB
${
CIFPP_REQUIRED_LIBRARIES
}
)
PRIVATE Eigen3::Eigen
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
)
target_link_options
(
cifpp PRIVATE -undefined dynamic_lookup
)
target_link_options
(
cifpp PRIVATE -undefined dynamic_lookup
)
...
@@ -539,7 +548,8 @@ if(BUILD_TESTING)
...
@@ -539,7 +548,8 @@ if(BUILD_TESTING)
add_executable
(
${
CIFPP_TEST
}
${
CIFPP_TEST_SOURCE
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/test-main.cpp"
)
add_executable
(
${
CIFPP_TEST
}
${
CIFPP_TEST_SOURCE
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/test-main.cpp"
)
target_link_libraries
(
${
CIFPP_TEST
}
PRIVATE Threads::Threads cifpp::cifpp Catch2::Catch2 Eigen3::Eigen
)
target_link_libraries
(
${
CIFPP_TEST
}
PRIVATE Threads::Threads cifpp::cifpp Catch2::Catch2
)
target_include_directories
(
${
CIFPP_TEST
}
PRIVATE
"
${
EIGEN_INCLUDE_DIR
}
"
)
if
(
MSVC
)
if
(
MSVC
)
# Specify unwind semantics so that MSVC knowns how to handle exceptions
# Specify unwind semantics so that MSVC knowns how to handle exceptions
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment