Skip to content
Snippets Groups Projects
Commit fe86c79d authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Feat: add custom find package

Some third-party libraries depend on further third-party libraries and sometimes even share them.
With this custom find package command it is possible to overwrite the thrid-parties attempts of finding these libraries in order to use a downloaded version form our source tree.
parent f8464cb5
No related branches found
No related tags found
No related merge requests found
...@@ -23,5 +23,28 @@ include (${CPM_MODULE_LOCATION}) ...@@ -23,5 +23,28 @@ include (${CPM_MODULE_LOCATION})
include (${CMAKE_CURRENT_LIST_DIR}/GetCommonLibraries.cmake) include (${CMAKE_CURRENT_LIST_DIR}/GetCommonLibraries.cmake)
include (${CMAKE_CURRENT_LIST_DIR}/BuildDoc.cmake) include (${CMAKE_CURRENT_LIST_DIR}/BuildDoc.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/IhtaAddTest.cmake) include (${CMAKE_CURRENT_LIST_DIR}/IhtaAddTest.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/IhtaAddLibrary.cmake) include (${CMAKE_CURRENT_LIST_DIR}/IhtaAddLibrary.cmake)
macro (find_package)
if (AVAILABLE_SUB_PROJECTS)
string (TOLOWER "${ARGV0}" _pkg_low)
string (TOLOWER "${AVAILABLE_SUB_PROJECTS}" _sub_low)
if (${_pkg_low} STREQUAL ${_sub_low})
message (WARNING "Package ${ARGV0} available as a sub project; skip find_package")
else ()
_find_package (${ARGV})
endif ()
else ()
_find_package (${ARGV})
endif ()
# if (NOT "${ARGV0}" IN_LIST AVAILABLE_SUB_PROJECTS)
# message (FATAL_ERROR "Package ${ARGV0} not found as a Target; using find_package")
# # _find_package (${ARGV})
# else ()
# message (FATAL_ERROR "Package ${ARGV0} found as a Target; skip find_package")
# endif ()
endmacro ()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment