Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions cmake/catkin_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
# :param DEPENDS: a list of CMake projects which this project depends
# on. Since they might not be *find_packagable* or lack a pkg-config
# file their ``INCLUDE_DIRS`` and ``LIBRARIES`` are passed directly.
# This requires that it has been ``find_package``\ -ed before.
# This requires that it has been ``find_package``\ -ed before and all
# variables (``<name>_FOUND``, ``<name>_INCLUDE_DIRS``, etc.) have the
# same case as this argument.
# :type DEPENDS: list of strings
# :param CFG_EXTRAS: a CMake file containing extra stuff that should
# be accessible to users of this package after
Expand Down Expand Up @@ -144,7 +146,7 @@ function(_catkin_package)
endif()
if("${second_item}" STREQUAL "COMPONENTS")
list(GET depend_list 0 depend_name)
if(NOT ${${depend_name}_FOUND})
if(NOT ${depend_name}_FOUND)
message(FATAL_ERROR "catkin_package() DEPENDS on '${depend}' which must be find_package()-ed before")
endif()
message(WARNING "catkin_package() DEPENDS on '${depend}' which is deprecated. find_package() it before and only DEPENDS on '${depend_name}' instead")
Expand All @@ -157,9 +159,12 @@ function(_catkin_package)
#message(WARNING "catkin_package() DEPENDS on catkin package '${depend_name}' which is deprecated. Use CATKIN_DEPENDS for catkin packages instead.")
list(APPEND _PROJECT_CATKIN_DEPENDS ${depend_name})
else()
if(NOT ${${depend_name}_FOUND})
if(NOT ${depend_name}_FOUND)
message(FATAL_ERROR "catkin_package() DEPENDS on '${depend_name}' which must be find_package()-ed before. If it is a catkin package it can be declared as CATKIN_DEPENDS instead without find_package()-ing it.")
endif()
if(NOT DEFINED ${depend_name}_INCLUDE_DIRS AND NOT DEFINED ${depend_name}_LIBRARIES)
message(WARNING "catkin_package() DEPENDS on '${depend_name}' but neither '${depend_name}_INCLUDE_DIRS' nor '${depend_name}_LIBRARIES' is defined.")
endif()
list(APPEND PROJECT_DEPENDENCIES_INCLUDE_DIRS ${${depend_name}_INCLUDE_DIRS})
list(APPEND PROJECT_DEPENDENCIES_LIBRARIES ${${depend_name}_LIBRARIES})
endif()
Expand Down