summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cmake/opentrack-pkg-config.cmake14
1 files changed, 13 insertions, 1 deletions
diff --git a/cmake/opentrack-pkg-config.cmake b/cmake/opentrack-pkg-config.cmake
index 5b84cf40..0f13defc 100644
--- a/cmake/opentrack-pkg-config.cmake
+++ b/cmake/opentrack-pkg-config.cmake
@@ -1,7 +1,8 @@
include_guard(GLOBAL)
include(FindPkgConfig)
-function(otr_pkgconfig target)
+function(otr_pkgconfig_ ret target)
+ set(${ret} 1 PARENT_SCOPE)
foreach(i ${ARGN})
set(k pkg-config_${i})
pkg_check_modules(${k} QUIET ${i})
@@ -11,6 +12,17 @@ function(otr_pkgconfig target)
target_include_directories(${target} SYSTEM PRIVATE ${${k}_INCLUDE_DIRS} ${${k}_INCLUDEDIR})
target_link_libraries(${target} ${${k}_LIBRARIES})
else()
+ set(${ret} 0 PARENT_SCOPE)
+ endif()
+ endforeach()
+endfunction()
+
+function(otr_pkgconfig target)
+ set(ret "")
+ otr_pkgconfig_(ret "${target}" ${ARGN})
+ foreach(i ${ARGN})
+ set(k pkg-config_${i})
+ if(NOT ${${k}_FOUND})
message(FATAL_ERROR "Can't find '${i}'. Please install development files for this package.")
endif()
endforeach()