Skip to content

Commit

Permalink
handle external deps in apps too
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Jul 27, 2024
1 parent 16e4900 commit 1e171e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions 3rdparty/wxThings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ target_include_directories(
"${MRPT_SOURCE_DIR}/3rdparty/wxThings/"
)
target_link_libraries(mrptwxthings PRIVATE imp_wxwidgets)

11 changes: 9 additions & 2 deletions cmakemodules/DeclareAppDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ macro(DeclareAppDependencies name)
foreach (_DEP ${ALL_DEPS})
# Check if all dependencies are to be build:
string(REGEX REPLACE "mrpt::(.*)" "\\1" DEP_MRPT_NAME ${_DEP})

if ("${BUILD_mrpt-${DEP_MRPT_NAME}}" STREQUAL "OFF")
set(AUX_ALL_DEPS_BUILD 0)
message(STATUS "*Warning*: App ${name} cannot be built because dependency mrpt-${DEP_MRPT_NAME} has been disabled!")
# Attempt at using system version?
find_package(mrpt-${DEP_MRPT_NAME})
if (NOT TARGET mrpt::${DEP_MRPT_NAME})
set(AUX_ALL_DEPS_BUILD 0)
message(STATUS "*Warning*: App ${name} cannot be built because dependency mrpt-${DEP_MRPT_NAME} has been disabled!")
else()
message(STATUS "*Warning*: App ${name} is using system depency: mrpt-${DEP_MRPT_NAME}")
endif()
endif()
endforeach()

Expand Down

0 comments on commit 1e171e5

Please sign in to comment.