1- cmake_minimum_required (VERSION 3.19 )
1+ cmake_minimum_required (VERSION 3.24 )
22
33project (
44 rcs_fr3
@@ -17,6 +17,7 @@ set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
1717cmake_policy (SET CMP0072 NEW ) # Use GLVND instead of legacy libGL.so
1818cmake_policy (SET CMP0135 NEW ) # Use timestamp of file extraction not download
1919cmake_policy (SET CMP0140 NEW ) # Check return arguments
20+ # set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
2021
2122set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /lib)
2223set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /lib)
@@ -66,9 +67,60 @@ FetchContent_Declare(Eigen3
6667 GIT_TAG 3.4.1
6768 GIT_PROGRESS TRUE
6869 EXCLUDE_FROM_ALL
70+ OVERRIDE_FIND_PACKAGE # <- This is the magic bullet!
6971)
72+ # --- tinyxml2 ---
73+ FetchContent_Declare (
74+ tinyxml2
75+ GIT_REPOSITORY https://github.com/leethomason/tinyxml2.git
76+ GIT_TAG 10.0.0 # Or the specific version you need
77+ GIT_PROGRESS TRUE
78+ EXCLUDE_FROM_ALL
79+ OVERRIDE_FIND_PACKAGE # <- This is the magic bullet!
80+ )
81+
82+ # --- console_bridge ---
83+ FetchContent_Declare (
84+ console_bridge
85+ GIT_REPOSITORY https://github.com/ros/console_bridge.git
86+ GIT_TAG 1.0.2 # Standard version used in ROS 2 Humble
87+ GIT_PROGRESS TRUE
88+ EXCLUDE_FROM_ALL
89+ OVERRIDE_FIND_PACKAGE # <- This is the magic bullet!
90+ )
91+
92+ # --- POCO C++ Libraries ---
93+ # POCO is a massive framework. Building the whole thing takes a long time.
94+ # We disable tests, examples, and heavy components you likely don't need for a robot control stack.
95+ set (ENABLE_TESTS OFF CACHE BOOL "Disable POCO tests" FORCE )
96+ set (ENABLE_DATA_MYSQL OFF CACHE BOOL "Disable POCO MySQL" FORCE )
97+ set (ENABLE_DATA_ODBC OFF CACHE BOOL "Disable POCO ODBC" FORCE )
98+ set (ENABLE_PAGECOMPILER OFF CACHE BOOL "Disable POCO PageCompiler" FORCE )
99+ set (ENABLE_PAGECOMPILER_FILE2PAGE OFF CACHE BOOL "" FORCE )
100+
101+ FetchContent_Declare (
102+ Poco
103+ GIT_REPOSITORY https://github.com/pocoproject/poco.git
104+ GIT_TAG poco-1.13.3-release
105+ GIT_PROGRESS TRUE
106+ EXCLUDE_FROM_ALL
107+ OVERRIDE_FIND_PACKAGE # <- This is the magic bullet!
108+ )
109+
110+ FetchContent_MakeAvailable (pybind11 Eigen3 tinyxml2 console_bridge Poco)
111+ if (NOT TARGET Eigen3::Eigen3)
112+ add_library (Eigen3::Eigen3 ALIAS eigen )
113+ endif ()
114+
115+ # Bridge tinyxml2 (Just in case)
116+ if (NOT TARGET TinyXML2::TinyXML2)
117+ add_library (TinyXML2::TinyXML2 ALIAS tinyxml2 )
118+ endif ()
70119
71- FetchContent_MakeAvailable (Eigen3)
72- FetchContent_MakeAvailable (libfranka pybind11)
120+ # Bridge console_bridge (Just in case)
121+ if (NOT TARGET console_bridge::console_bridge)
122+ add_library (console_bridge::console_bridge ALIAS console_bridge )
123+ endif ()
124+ FetchContent_MakeAvailable (libfranka)
73125
74126add_subdirectory (src )
0 commit comments