@@ -13,8 +13,18 @@ SET(PROJECT_USE_KEYWORD_LINK_LIBRARIES TRUE)
1313SET (PROJECT_CUSTOM_HEADER_EXTENSION "hpp" )
1414
1515# Check if the submodule cmake have been initialized
16+ set (JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR} /cmake" )
1617IF (NOT EXISTS "${CMAKE_SOURCE_DIR} /cmake/base.cmake" )
17- MESSAGE (FATAL_ERROR "\n Please run the following command first:\n git submodule update --init\n " )
18+ IF (${CMAKE_VERSION} VERSION_LESS "3.14.0" )
19+ MESSAGE (FATAL_ERROR "\n Please run the following command first:\n git submodule update --init\n " )
20+ ELSE ()
21+ message (STATUS "JRL cmakemodules not found. Let's fetch it." )
22+ include (FetchContent)
23+ FetchContent_Declare("jrl-cmakemodules"
24+ GIT_REPOSITORY "https://github.com/jrl-umi3218/jrl-cmakemodules.git" )
25+ FetchContent_MakeAvailable("jrl-cmakemodules" )
26+ FetchContent_GetProperties("jrl-cmakemodules" SOURCE_DIR JRL_CMAKE_MODULES)
27+ ENDIF ()
1828ENDIF ()
1929
2030# Disable -Werror on Unix for now.
@@ -35,14 +45,14 @@ IF(DEFINED BUILD_UNIT_TESTS)
3545 SET (BUILD_TESTING ${BUILD_UNIT_TESTS} )
3646ENDIF (DEFINED BUILD_UNIT_TESTS)
3747
38- INCLUDE (cmake /base.cmake)
48+ INCLUDE (" ${JRL_CMAKE_MODULES} /base.cmake" )
3949COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
4050PROJECT (${PROJECT_NAME} ${PROJECT_ARGS} )
4151
42- INCLUDE (cmake /boost.cmake)
43- INCLUDE (cmake /python.cmake)
44- INCLUDE (cmake /ide.cmake)
45- INCLUDE (cmake /apple .cmake)
52+ INCLUDE (" ${JRL_CMAKE_MODULES} /boost.cmake" )
53+ INCLUDE (" ${JRL_CMAKE_MODULES} /python.cmake" )
54+ INCLUDE (" ${JRL_CMAKE_MODULES} /ide.cmake" )
55+ INCLUDE (" ${JRL_CMAKE_MODULES} /apple.cmake" )
4656
4757OPTION (GENERATE_PYTHON_STUBS "Generate the Python stubs associated to the Python library" OFF )
4858
0 commit comments