void-packages/srcpkgs/calligra/patches/macro-optional-find-package.patch

32 lines
1.4 KiB
Diff
Raw Normal View History

Index: calligra-3.2.1/cmake/modules/MacroOptionalFindPackage.cmake
===================================================================
--- calligra-3.2.1.orig/cmake/modules/MacroOptionalFindPackage.cmake
+++ calligra-3.2.1/cmake/modules/MacroOptionalFindPackage.cmake
@@ -25,11 +25,26 @@ macro(_MOFP_SET_EMPTY_IF_DEFINED _name _
endif(DEFINED ${_nameUpper}_${_var})
endmacro(_MOFP_SET_EMPTY_IF_DEFINED _package _var)
+macro(_MOFP_DEFINE_BOTH_IF_DEFINED _name _var)
+ if (DEFINED ${_name}_${_var})
+ string(TOUPPER ${_name} _nameUpper)
+ set(${_nameUpper}_${_var} "${${_name}_${_var}}")
+ endif()
+endmacro()
macro (MACRO_OPTIONAL_FIND_PACKAGE _name )
option(WITH_${_name} "Search for ${_name} package" ON)
if (WITH_${_name})
find_package(${_name} ${ARGN})
+ _mofp_define_both_if_defined(${_name} FOUND)
+ _mofp_define_both_if_defined(${_name} INCLUDE_DIRS)
+ _mofp_define_both_if_defined(${_name} INCLUDE_DIR)
+ _mofp_define_both_if_defined(${_name} INCLUDES)
+ _mofp_define_both_if_defined(${_name} LIBRARY)
+ _mofp_define_both_if_defined(${_name} LIBRARIES)
+ _mofp_define_both_if_defined(${_name} LIBS)
+ _mofp_define_both_if_defined(${_name} FLAGS)
+ _mofp_define_both_if_defined(${_name} DEFINITIONS)
else (WITH_${_name})
string(TOUPPER ${_name} _nameUpper)
set(${_name}_FOUND FALSE)