Skip to content
Snippets Groups Projects

Remove PkgConfig dependence on Windows

Merged Ammar Nejati requested to merge removePkgConfigDep_Win into develop
Files
2
+ 14
3
@@ -16,12 +16,23 @@ set(Cerf_ULTIMATELY_REQUIRED ${Cerf_FIND_REQUIRED})
set(Cerf_FIND_REQUIRED FALSE)
# set(Cerf_FIND_VERSION 1.13) incompatible with Debian package
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
# Do not rely on PkgConfig on Windows
if(NOT WIN32)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_Cerf QUIET libcerf)
if(PC_Cerf_FOUND)
set(Cerf_VERSION ${PC_Cerf_VERSION})
set(Cerf_VERSION ${PC_Cerf_VERSION})
endif()
endif()
else()
include(FindPkgVersion)
+1
findPkgVersion(
"cerf" # libname
"" # use default config file
"${CMAKE_LIBRARY_PATH}" # search paths
Cerf_VERSION # output variable
)
endif()
find_path(Cerf_INCLUDE_DIR cerf.h)
Loading