Skip to content

Commit

Permalink
Also install a pkg-config file
Browse files Browse the repository at this point in the history
This for interoperability with other build systems
  • Loading branch information
ytnuf committed Nov 19, 2024
1 parent cd6bb16 commit 1f6f05e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmake/godot-cpp.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@

Name: godot-cpp
Description: C++ bindings for the Godot script API
Version: @GODOT_API_VERSION@
Libs: -L${libdir} -l@GODOTCPP_OUTPUT_NAME@
Cflags: -I${includedir}
13 changes: 13 additions & 0 deletions cmake/godotcpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,18 @@ function( godotcpp_installable )
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/godot"
COMPONENT "godot-cpp"
)

# Install the pkg-config file
get_target_property(GODOTCPP_OUTPUT_NAME "${PROJECT_NAME}" OUTPUT_NAME)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/godot-cpp.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/godot-cpp.pc"
@ONLY
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/godot-cpp.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
COMPONENT "godot-cpp"
)
endif()
endfunction()

0 comments on commit 1f6f05e

Please sign in to comment.