Skip to content

Commit 37ad9a1

Browse files
authored
Merge pull request #446 from nim65s/cmake
CMake details
2 parents f07d325 + 1110b3e commit 37ad9a1

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
## [Unreleased]
88

9+
### Added
10+
- Allow use of installed JRL-cmakemodule ([#446](https://github.com/stack-of-tasks/eigenpy/pull/446)
11+
912
### Fixed
1013
- Fix unit test build in C++11 ([#442](https://github.com/stack-of-tasks/eigenpy/pull/442))
1114
- Fix unit test function signature [#443](https://github.com/stack-of-tasks/eigenpy/pull/443))
15+
- Fix CMake export ([#446](https://github.com/stack-of-tasks/eigenpy/pull/446)
1216

1317
## [3.4.0] - 2024-02-26
1418

CMakeLists.txt

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,23 @@ set(PROJECT_COMPATIBILITY_VERSION AnyNewerVersion)
1414

1515
# Check if the submodule cmake have been initialized
1616
set(JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake")
17-
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/cmake/base.cmake")
18-
if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
17+
if(EXISTS "${JRL_CMAKE_MODULES}/base.cmake")
18+
message(STATUS "JRL cmakemodules found in 'cmake/' git submodule")
19+
else()
20+
find_package(jrl-cmakemodules QUIET CONFIG)
21+
if(jrl-cmakemodules_FOUND)
22+
get_property(
23+
JRL_CMAKE_MODULES
24+
TARGET jrl-cmakemodules::jrl-cmakemodules
25+
PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
26+
message(STATUS "JRL cmakemodules found on system at ${JRL_CMAKE_MODULES}")
27+
elseif(${CMAKE_VERSION} VERSION_LESS "3.14.0")
1928
message(
2029
FATAL_ERROR
21-
"\nPlease run the following command first:\ngit submodule update --init\n"
30+
"\nCan't find jrl-cmakemodules. Please either:\n"
31+
" - use git submodule: 'git submodule update --init'\n"
32+
" - or install https://github.com/jrl-umi3218/jrl-cmakemodules\n"
33+
" - or upgrade your CMake version to >= 3.14 to allow automatic fetching\n"
2234
)
2335
else()
2436
message(STATUS "JRL cmakemodules not found. Let's fetch it.")
@@ -297,7 +309,7 @@ add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES}
297309
target_include_directories(
298310
${PROJECT_NAME} SYSTEM
299311
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
300-
$<INSTALL_INTERFACE:include>)
312+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
301313

302314
modernize_target_link_libraries(
303315
${PROJECT_NAME}

0 commit comments

Comments
 (0)