FMS icon indicating copy to clipboard operation
FMS copied to clipboard

Generate a pkgconf pc file from cmake

Open harshula opened this issue 6 months ago • 8 comments

While adding pkgconf support to an old fork of FMS, built via Spack, I noticed that the upstream FMS' CMake was not generating the pkgconf pc file.

Testing output:

/opt/release/linux-rocky8-x86_64/intel-2021.2.0/fms-test-b6u4j7f37pf4m2sxontqprjm5wklfxlz/lib64/pkgconfig/FMS.pc:
prefix=/opt/release/linux-rocky8-x86_64/intel-2021.2.0/fms-test-b6u4j7f37pf4m2sxontqprjm5wklfxlz
exec_prefix=/opt/release/linux-rocky8-x86_64/intel-2021.2.0/fms-test-b6u4j7f37pf4m2sxontqprjm5wklfxlz
libdir=/opt/release/linux-rocky8-x86_64/intel-2021.2.0/fms-test-b6u4j7f37pf4m2sxontqprjm5wklfxlz/lib64
includedir=/opt/release/linux-rocky8-x86_64/intel-2021.2.0/fms-test-b6u4j7f37pf4m2sxontqprjm5wklfxlz/include

# Including the following, as they may be useful when building other components
# and as a way to better record how the library was built.
ccompiler=/opt/spack/lib/spack/env/intel/icc
fccompiler=/opt/spack/lib/spack/env/intel/ifort
cppflagss.compiled=
cflags.compiled= -sox -traceback
fcflags.compiled= -fpp -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -align array64byte -nowarn -sox -traceback
ldflags.compiled=

Name: FMS
Description: The Flexible Modeling System Infrastructure Library
URL: https://www.gfdl.noaa.gov/fms
Version: 2024.2.0
Libs: -L${libdir} -lFMS
Libs.private:
Cflags: -I${includedir}
Fflags: -I${includedir}

What are the relevant CMake variables that should go in Libs.private? Also, ${CMAKE_INSTALL_LIBDIR} is lib64 whereas the FMS library is installed in lib.

harshula avatar Aug 02 '24 11:08 harshula