mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Move Eigen headers out of main include folder (#1854)
This allows using Eigen as a separate cmake package, e.g. for vcpkg.
This commit is contained in:
committed by
Peter Johnson
parent
0f532a1174
commit
8993ce5bf1
@@ -52,6 +52,7 @@ option(WITH_TESTS "build unit tests (requires internet connection)" OFF)
|
||||
option(USE_EXTERNAL_HAL "Use a separately built HAL" OFF)
|
||||
set(EXTERNAL_HAL_FILE "" CACHE FILEPATH "Location to look for an external HAL CMake File")
|
||||
option(USE_VCPKG_LIBUV "Use vcpkg libuv" OFF)
|
||||
option(USE_VCPKG_EIGEN "Use vcpkg eigen" OFF)
|
||||
option(FLAT_INSTALL_WPILIB "Use a flat install directory" OFF)
|
||||
|
||||
if (NOT WITHOUT_JAVA AND NOT BUILD_SHARED_LIBS)
|
||||
@@ -78,6 +79,10 @@ if (USE_VCPKG_LIBUV)
|
||||
set (LIBUV_VCPKG_REPLACE "find_package(unofficial-libuv CONFIG)")
|
||||
endif()
|
||||
|
||||
if (USE_VCPKG_EIGEN)
|
||||
set (EIGEN_VCPKG_REPLACE "find_package(eigen3 CONFIG)")
|
||||
endif()
|
||||
|
||||
if (MSVC OR FLAT_INSTALL_WPILIB)
|
||||
set(WPIUTIL_DEP_REPLACE "include($\{SELF_DIR\}/wpiutil-config.cmake)")
|
||||
set(NTCORE_DEP_REPLACE "include($\{SELF_DIR\}/ntcore-config.cmake)")
|
||||
|
||||
@@ -37,8 +37,7 @@ Feather Icons wpiutil/src/main/native/resources/feather-*
|
||||
jQuery wpiutil/src/main/native/resources/jquery-*
|
||||
popper.js wpiutil/src/main/native/resources/popper-*
|
||||
units wpiutil/src/main/native/include/units/units.h
|
||||
Eigen wpiutil/src/main/native/include/Eigen/
|
||||
wpiutil/src/main/native/include/unsupported/
|
||||
Eigen wpiutil/src/main/native/eigeninclude/
|
||||
StackWalker wpiutil/src/main/native/windows/StackWalker.*
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ include(CMakeFindDependencyMacro)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_dependency(Threads)
|
||||
@LIBUV_VCPKG_REPLACE@
|
||||
@EIGEN_VCPKG_REPLACE@
|
||||
@WPIUTIL_DEP_REPLACE@
|
||||
@NTCORE_DEP_REPLACE@
|
||||
@CSCORE_DEP_REPLACE@
|
||||
|
||||
@@ -10,7 +10,7 @@ cppSrcFileInclude {
|
||||
generatedFileExclude {
|
||||
src/main/native/cpp/http_parser\.cpp$
|
||||
src/main/native/cpp/llvm/
|
||||
src/main/native/include/Eigen/
|
||||
src/main/native/eigeninclude/
|
||||
src/main/native/include/llvm/
|
||||
src/main/native/include/units/units\.h$
|
||||
src/main/native/include/unsupported/
|
||||
|
||||
@@ -123,6 +123,16 @@ endif()
|
||||
wpilib_target_warnings(wpiutil)
|
||||
target_link_libraries(wpiutil Threads::Threads ${CMAKE_DL_LIBS} ${ATOMIC})
|
||||
|
||||
if (NOT USE_VCPKG_EIGEN)
|
||||
install(DIRECTORY src/main/native/eigen/ DESTINATION "${include_dest}/wpiutil")
|
||||
target_include_directories(wpiutil PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/eigen>
|
||||
$<INSTALL_INTERFACE:${include_dest}/wpiutil>)
|
||||
else()
|
||||
find_package(eigen3 CONFIG REQUIRED)
|
||||
target_include_directories (wpiutil PUBLIC ${EIGEN3_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if (NOT USE_VCPKG_LIBUV)
|
||||
target_sources(wpiutil PRIVATE ${uv_native_src})
|
||||
install(DIRECTORY src/main/native/libuv/include/ DESTINATION "${include_dest}/wpiutil")
|
||||
|
||||
@@ -171,6 +171,9 @@ cppHeadersZip {
|
||||
from('src/main/native/libuv/include') {
|
||||
into '/'
|
||||
}
|
||||
from('src/main/native/eigeninclude') {
|
||||
into '/'
|
||||
}
|
||||
}
|
||||
|
||||
model {
|
||||
@@ -178,7 +181,7 @@ model {
|
||||
all {
|
||||
it.sources.each {
|
||||
it.exportedHeaders {
|
||||
srcDirs 'src/main/native/include', 'src/main/native/libuv/include', 'src/main/native/libuv/src'
|
||||
srcDirs 'src/main/native/include', 'src/main/native/libuv/include', 'src/main/native/libuv/src', 'src/main/native/eigeninclude'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user