[CMake] Finding a pkg-config file

Florian Lindner mailinglists at xgm.de
Fri Sep 21 09:55:18 EDT 2018


Hello,

on a really weird configured system (but I can't change it), there is a pkg-config file which I want to find with cmake:

  set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:$ENV{PETSC_DIR}/lib/pkgconfig")
  set(CMAKE_PREFIX_PATH "$ENV{PETSC_DIR}/lib/pkgconfig")  
  find_package(PkgConfig REQUIRED)
  pkg_check_modules(PETSC REQUIRED craypetsc_real)

but

-- Checking for module 'craypetsc_real'
--   No package 'craypetsc_real' found
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:363 (message):
  A required package was not found

  

> cat $PETSC_DIR/lib/pkgconfig/craypetsc_real.pc

VERSION=3.8.4.0
PE=GNU
pe=gnu
GENCOMP=7.1
CPU_TARGET=haswell

install_prefix=/opt/cray/pe
root=${install_prefix}/petsc/3.8.4.0/real
prefix=${root}/${PE}/${GENCOMP}/${CPU_TARGET}
libdir=${prefix}/lib
includedir=${prefix}/include

cray_as_needed=
cray_no_as_needed=

Name: craypetsc_real
Description: Scientific libraries
Version: ${VERSION}
Libs: -L${libdir} ${cray_as_needed}-lcraypetsc_gnu_71_real${cray_no_as_needed}  -fopenmp
Libs.private: 
Requires: 
Requires.private: mpich >= 7.0 sci_mp >= 13.0 cray-tpsl >= 16.03.1 hdf5_parallel
Conflicts: hdf5
Cflags:  -I${includedir}

pkg-config also finds it:

> PKG_CONFIG_PATH=$PETSC_DIR/lib/pkgconfig pkg-config --print-variables craypetsc_real 
cray_as_needed
prefix
libdir
[...]


CMakeError.log does not exist, CMakeOutput.log I have attached.

Thanks!
Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeOutput.log
Type: text/x-log
Size: 35513 bytes
Desc: not available
URL: <https://cmake.org/pipermail/cmake/attachments/20180921/eead54f2/attachment-0001.bin>


More information about the CMake mailing list