CMake: generate a pkg-config file that follow pkg-config conventions (#4456)
* CMake: configure pkg-config with @only
And use @ replacement instead of {}, since ${} is significant in
pkg-config's format
* CMake: use conventional prefix and incluedir variables in pkg-config
This is more standard, and has some advantages when cross compiling.
This also means that the pkg-config files generated by Meson and CMake
now match.
This commit is contained in:
parent
3d6c664de2
commit
d333f08958
@ -149,6 +149,7 @@ endif()
|
|||||||
CONFIGURE_FILE(
|
CONFIGURE_FILE(
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkg-config.pc.in"
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkg-config.pc.in"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
|
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
|
||||||
|
@ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
Name: ${PROJECT_NAME}
|
prefix=@CMAKE_INSTALL_PREFIX@
|
||||||
|
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
|
||||||
|
|
||||||
|
Name: @PROJECT_NAME@
|
||||||
Description: JSON for Modern C++
|
Description: JSON for Modern C++
|
||||||
Version: ${PROJECT_VERSION}
|
Version: @PROJECT_VERSION@
|
||||||
Cflags: -I${CMAKE_INSTALL_FULL_INCLUDEDIR}
|
Cflags: -I${includedir}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user