Skip to content
Snippets Groups Projects

Remove PkgConfig dependence on Windows

Merged Ammar Nejati requested to merge removePkgConfigDep_Win into develop
1 file
+ 9
9
Compare changes
  • Side-by-side
  • Inline
@@ -38,6 +38,7 @@ function(find_pkg_version libname conffile paths output_var)
string(STRIP "${paths}" _paths)
string(STRIP "${conffile}" _pkgconffile)
set(_msghdr "find_pkg_version::") # message header
# find the configuration file in the given paths
if(NOT _pkgconffile)
@@ -45,10 +46,9 @@ function(find_pkg_version libname conffile paths output_var)
endif()
# initialize the output variable
if(NOT output_var)
set(_outvar ${output_var})
if(NOT _outvar)
set(_outvar ${libname}_VERSION)
else()
set(_outvar ${output_var})
endif()
set(${_outvar} "${_outvar}-NOTFOUND" PARENT_SCOPE)
@@ -59,13 +59,10 @@ function(find_pkg_version libname conffile paths output_var)
PATHS "${_paths}" PATH_SUFFIXES "${_path_sfx}"
DOC "Package configuration for ${_pkgconffile}")
# NOTE:
# A CMake value is False if the constant is 0, OFF, NO, FALSE,
# N, IGNORE, "", or ends in the suffix '-NOTFOUND'.
if(${libname}_PATH)
message(STATUS "'${_pkgconffile}' found in '${${libname}_PATH}'")
message(STATUS "${_msghdr} '${_pkgconffile}' found in '${${libname}_PATH}'")
else()
message(WARNING "'${_pkgconffile}' not found in paths {${_paths}}")
message(WARNING "${_msghdr} '${_pkgconffile}' not found in paths {${_paths}}")
return()
endif()
@@ -74,8 +71,11 @@ function(find_pkg_version libname conffile paths output_var)
string(TOLOWER "${_conf}" _conf_lc)
string(REGEX MATCH "version[: \t]*([1-9.]+)" _rxmatch ${_conf_lc})
if(${CMAKE_MATCH_1})
if(CMAKE_MATCH_1)
set(${_outvar} "${CMAKE_MATCH_1}" PARENT_SCOPE)
message(STATUS "${_msghdr} ${_outvar} => ${CMAKE_MATCH_1}")
else()
message(WARNING "${_msghdr} ${_outvar} not found")
endif ()
endfunction()
Loading