Skip to content
Snippets Groups Projects
Commit 360fe6b8 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

CMake: allow use of installed jrl-cmakemodule

parent 49e6e1bb
No related branches found
No related tags found
No related merge requests found
# #
# Copyright (c) 2019-2020 CNRS # Copyright (c) 2019-2024 CNRS
# #
# This file is part of eiquadprog. # This file is part of eiquadprog.
# #
...@@ -37,11 +37,23 @@ set(PROJECT_CUSTOM_HEADER_EXTENSION "hpp") ...@@ -37,11 +37,23 @@ set(PROJECT_CUSTOM_HEADER_EXTENSION "hpp")
# Check if the submodule cmake have been initialized # Check if the submodule cmake have been initialized
set(JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake") set(JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake")
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/cmake/base.cmake") if(EXISTS "${JRL_CMAKE_MODULES}/base.cmake")
if(${CMAKE_VERSION} VERSION_LESS "3.14.0") 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( message(
FATAL_ERROR 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() else()
message(STATUS "JRL cmakemodules not found. Let's fetch it.") message(STATUS "JRL cmakemodules not found. Let's fetch it.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment