Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 558f721

Browse files
committed
CMake workaround
1 parent 0f5a4db commit 558f721

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

CMakeLists.txt

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,33 @@ set(CUSTOM_HEADER_DIR "sot/torque_control")
2727
set(CXX_DISABLE_WERROR TRUE)
2828
set(DOXYGEN_USE_MATHJAX YES)
2929

30+
# Check if the submodule cmake have been initialized
31+
set(JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake")
32+
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/cmake/base.cmake")
33+
if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
34+
message(
35+
FATAL_ERROR
36+
"\nPlease run the following command first:\ngit submodule update --init\n"
37+
)
38+
else()
39+
message(STATUS "JRL cmakemodules not found. Let's fetch it.")
40+
include(FetchContent)
41+
FetchContent_Declare(
42+
"jrl-cmakemodules"
43+
GIT_REPOSITORY "https://github.com/jrl-umi3218/jrl-cmakemodules.git")
44+
FetchContent_MakeAvailable("jrl-cmakemodules")
45+
FetchContent_GetProperties("jrl-cmakemodules" SOURCE_DIR JRL_CMAKE_MODULES)
46+
endif()
47+
endif()
48+
3049
# JRL-cmakemodule setup
31-
include(cmake/base.cmake)
32-
include(cmake/boost.cmake)
50+
include("${JRL_CMAKE_MODULES}/base.cmake")
51+
include("${JRL_CMAKE_MODULES}/boost.cmake")
3352

3453
# Project definition
3554
compute_project_args(PROJECT_ARGS LANGUAGES CXX)
3655
project(${PROJECT_NAME} ${PROJECT_ARGS})
56+
check_minimal_cxx_standard(14 ENFORCE)
3757

3858
if(INITIALIZE_WITH_NAN)
3959
message(STATUS "Initialize with NaN all the Eigen entries.")
@@ -63,6 +83,8 @@ if(Boost_VERSION GREATER 107299)
6383
add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)
6484
endif()
6585

86+
include("${JRL_CMAKE_MODULES}/python.cmake")
87+
6688
# Main Library
6789
set(${PROJECT_NAME}_HEADERS
6890
include/${CUSTOM_HEADER_DIR}/joint-torque-controller.hh

0 commit comments

Comments
 (0)