Skip to content

Commit 34be6c7

Browse files
authored
Merge pull request #48 from nim65s/devel
update packaging & tooling
2 parents 49e6e1b + 3d3b39d commit 34be6c7

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repos:
66
hooks:
77
- id: cmake-format
88
- repo: https://github.com/pre-commit/mirrors-clang-format
9-
rev: v17.0.5
9+
rev: v18.1.1
1010
hooks:
1111
- id: clang-format
1212
args:

CMakeLists.txt

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2019-2020 CNRS
2+
# Copyright (c) 2019-2024 CNRS
33
#
44
# This file is part of eiquadprog.
55
#
@@ -37,11 +37,23 @@ set(PROJECT_CUSTOM_HEADER_EXTENSION "hpp")
3737

3838
# Check if the submodule cmake have been initialized
3939
set(JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake")
40-
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/cmake/base.cmake")
41-
if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
40+
if(EXISTS "${JRL_CMAKE_MODULES}/base.cmake")
41+
message(STATUS "JRL cmakemodules found in 'cmake/' git submodule")
42+
else()
43+
find_package(jrl-cmakemodules QUIET CONFIG)
44+
if(jrl-cmakemodules_FOUND)
45+
get_property(
46+
JRL_CMAKE_MODULES
47+
TARGET jrl-cmakemodules::jrl-cmakemodules
48+
PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
49+
message(STATUS "JRL cmakemodules found on system at ${JRL_CMAKE_MODULES}")
50+
elseif(${CMAKE_VERSION} VERSION_LESS "3.14.0")
4251
message(
4352
FATAL_ERROR
44-
"\nPlease run the following command first:\ngit submodule update --init\n"
53+
"\nCan't find jrl-cmakemodules. Please either:\n"
54+
" - use git submodule: 'git submodule update --init'\n"
55+
" - or install https://github.com/jrl-umi3218/jrl-cmakemodules\n"
56+
" - or upgrade your CMake version to >= 3.14 to allow automatic fetching\n"
4557
)
4658
else()
4759
message(STATUS "JRL cmakemodules not found. Let's fetch it.")
@@ -92,8 +104,8 @@ modernize_target_link_libraries(
92104
Eigen3::Eigen
93105
INCLUDE_DIRS
94106
${EIGEN3_INCLUDE_DIR})
95-
target_include_directories(${PROJECT_NAME}
96-
INTERFACE $<INSTALL_INTERFACE:include>)
107+
target_include_directories(
108+
${PROJECT_NAME} INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
97109
install(
98110
TARGETS ${PROJECT_NAME}
99111
EXPORT ${TARGETS_EXPORT_NAME}

0 commit comments

Comments
 (0)