Skip to content

Commit

Permalink
Fix cmake for all build cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Jul 27, 2024
1 parent cf173a1 commit 1034e66
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ if(CMAKE_MRPT_HAS_ROBOPEAK_LIDAR AND MRPT_BUILD_rplidar_sdk)
)
set_target_properties(mrpt_rplidar PROPERTIES FOLDER "3rd party")

if(NOT TARGET mrpt::core)
if((DEFINED BUILD_mrpt-core) AND (NOT BUILD_mrpt-core))
find_package(mrpt-core REQUIRED)
endif()
target_link_libraries(mrpt_rplidar PRIVATE mrpt::core) # To enforce c++17
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,11 @@ add_custom_target(all_mrpt_libs ALL) # all_mrpt_libs: target to build all mrpt-*
add_subdirectory(3rdparty) # The third-party libraries
add_subdirectory(libs) # The MRPT C++ libraries

# Build pymrpt after defining the libs above
if(CMAKE_MRPT_HAS_PYTHON_BINDINGS)
add_subdirectory(python)
endif()

set(MRPT_BUILD_APPLICATIONS ON CACHE BOOL "If you only want the MRPT libraries, disable this.")
if(MRPT_BUILD_APPLICATIONS)
add_subdirectory(apps) # The applications:
Expand Down
1 change: 0 additions & 1 deletion cmakemodules/script_python_bindings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ if(UNIX AND NOT MRPT_DISABLE_PYTHON_BINDINGS)
if (pybind11_FOUND)
# build python bindings if we have all requirements
set(CMAKE_MRPT_HAS_PYTHON_BINDINGS 1)
add_subdirectory(python)
endif()
endif()
endif()
4 changes: 3 additions & 1 deletion doc/source/doxygen-docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

# Version 2.13.5: UNRELEASED
- Build system:
- ROS package.xml: Remove libfyaml-dev as required build dependency (will use embedded copy). This enables correct builds on non-Debian distributions.
- This main MRPT repository is no longer directly built as a ROS package. Please, use the wrappers for better modularity:
- https://github.com/MRPT/mrpt_ros
- https://github.com/MRPT/python_mrpt_ros

# Version 2.13.4: Released July 24th, 2024
- Fix docs typos.
Expand Down
8 changes: 4 additions & 4 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ else()
endif()

# enable separate build of pymrpt for ros packages:
if(NOT TARGET mrpt::apps)
if(NOT TARGET mrpt::apps AND NOT TARGET mrpt-apps)
find_package(mrpt-apps REQUIRED)
endif()
if(NOT TARGET mrpt::nav)
if(NOT TARGET mrpt::nav AND NOT TARGET mrpt-nav)
find_package(mrpt-nav REQUIRED)
endif()
if(NOT TARGET mrpt::slam)
if(NOT TARGET mrpt::slam AND NOT TARGET mrpt-slam)
find_package(mrpt-slam REQUIRED)
endif()
if(NOT TARGET mrpt::gui)
if(NOT TARGET mrpt::gui AND NOT TARGET mrpt-gui)
find_package(mrpt-gui REQUIRED)
endif()

Expand Down

0 comments on commit 1034e66

Please sign in to comment.