Skip to content
Snippets Groups Projects
Commit 9cb8f61e authored by Ammar Nejati's avatar Ammar Nejati Committed by AlQuemist
Browse files

CMake: Rename 'FindPkgVersion' -> 'FindPkgVersionWin'

The module is used only under Windows.
parent c55c6b01
No related branches found
No related tags found
1 merge request!411Remove PkgConfig dependence on Windows
Pipeline #47612 passed
# FindPkgVersion.cmake
# FindPkgVersionWin.cmake
# --------------------
# description:
# Defines the function `find_pkg_version`, which obtains the version of a
# Defines the function `find_pkg_version_win`, which obtains the version of a
# library from the `pkgconfig` (*.pc) files in a given path.
# This is currently used only under Windows, as a simple replacement for
# `PkgConfig` from MSYS2 platform.
#
# usage:
# find_pkg_version(<library-name> <config-filename> <search-paths> <output-var-name>)
# find_pkg_version_win(<library-name> <config-filename> <search-paths> <output-var-name>)
#
# parameters:
# * library-name: name of the library (eg. "cerf")
......@@ -30,13 +30,13 @@
#
# example:
# * Find the version of the 'cerf' package in the `CMAKE_LIBRARY_PATH` folders:
# find_pkg_version("cerf" "" "${CMAKE_LIBRARY_PATH}" Cerf_VERSION)
# find_pkg_version_win("cerf" "" "${CMAKE_LIBRARY_PATH}" Cerf_VERSION)
function(find_pkg_version libname conffile paths output_var)
function(find_pkg_version_win libname conffile paths output_var)
string(STRIP "${paths}" _paths)
string(STRIP "${conffile}" _pkgconffile)
set(_msghdr "find_pkg_version::") # message header
set(_msghdr "find_pkg_version_win::") # message header
# find the configuration file in the given paths
if(NOT _pkgconffile)
......
......@@ -26,8 +26,8 @@ if(NOT WIN32)
endif()
endif()
else()
include(commons/FindPkgVersion)
find_pkg_version("cerf" "" "${CMAKE_LIBRARY_PATH}" Cerf_VERSION)
include(commons/FindPkgVersionWin)
find_pkg_version_win("cerf" "" "${CMAKE_LIBRARY_PATH}" Cerf_VERSION)
endif()
find_path(Cerf_INCLUDE_DIR cerf.h)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment