CMakeLists.txt: fix PACKAGE_VERSION substitution in .pc file

Before the change project built using `cmake` had Version field empty:

    Version:

After the change version is set as expected:

    Version: 2.1.0

Noticed as as a build failure of `echant-2.6.4` which failed to find the
package using `pkg-config --exists --print-errors "UnitTest++ >= 1.6"`
expression.
This commit is contained in:
Sergei Trofimovich 2023-12-18 19:05:55 +00:00
parent 10e50ad70c
commit 91790b98e0

View file

@ -135,6 +135,7 @@ set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
set(libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
set(includedir ${CMAKE_INSTALL_PREFIX}/include/UnitTest++)
set(PACKAGE_VERSION ${CMAKE_PROJECT_VERSION})
configure_file("UnitTest++.pc.in" "UnitTest++.pc" @ONLY)
if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
set(pkgconfdir ${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig)