diff --git a/CHANGELOG.md b/CHANGELOG.md index d518fca477128b75405524c3aa2c8b601b6d75d9..8edbc9dba4dba95ceae16492d24dd727e5b8a674 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Added +- Allow use of installed JRL-cmakemodule ([#446](https://github.com/stack-of-tasks/eigenpy/pull/446) + ### Fixed - Fix unit test build in C++11 ([#442](https://github.com/stack-of-tasks/eigenpy/pull/442)) - Fix unit test function signature [#443](https://github.com/stack-of-tasks/eigenpy/pull/443)) +- Fix CMake export ([#446](https://github.com/stack-of-tasks/eigenpy/pull/446) ## [3.4.0] - 2024-02-26 diff --git a/CMakeLists.txt b/CMakeLists.txt index be43048c9ce48555b86ff861c7abc23baaa7df8b..1fc16e5d51a7719bd1bdd0e55ccc3c26537efaff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,11 +14,23 @@ set(PROJECT_COMPATIBILITY_VERSION AnyNewerVersion) # Check if the submodule cmake have been initialized set(JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake") -if(NOT EXISTS "${CMAKE_SOURCE_DIR}/cmake/base.cmake") - if(${CMAKE_VERSION} VERSION_LESS "3.14.0") +if(EXISTS "${JRL_CMAKE_MODULES}/base.cmake") + message(STATUS "JRL cmakemodules found in 'cmake/' git submodule") +else() + find_package(jrl-cmakemodules QUIET CONFIG) + if(jrl-cmakemodules_FOUND) + get_property( + JRL_CMAKE_MODULES + TARGET jrl-cmakemodules::jrl-cmakemodules + PROPERTY INTERFACE_INCLUDE_DIRECTORIES) + message(STATUS "JRL cmakemodules found on system at ${JRL_CMAKE_MODULES}") + elseif(${CMAKE_VERSION} VERSION_LESS "3.14.0") message( FATAL_ERROR - "\nPlease run the following command first:\ngit submodule update --init\n" + "\nCan't find jrl-cmakemodules. Please either:\n" + " - use git submodule: 'git submodule update --init'\n" + " - or install https://github.com/jrl-umi3218/jrl-cmakemodules\n" + " - or upgrade your CMake version to >= 3.14 to allow automatic fetching\n" ) else() message(STATUS "JRL cmakemodules not found. Let's fetch it.") @@ -297,7 +309,7 @@ add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES} target_include_directories( ${PROJECT_NAME} SYSTEM PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> - $<INSTALL_INTERFACE:include>) + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) modernize_target_link_libraries( ${PROJECT_NAME}