diff --git a/cmake/godot-cpp.pc.in b/cmake/godot-cpp.pc.in new file mode 100644 index 00000000..1813706b --- /dev/null +++ b/cmake/godot-cpp.pc.in @@ -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} diff --git a/cmake/godotcpp.cmake b/cmake/godotcpp.cmake index 6ece913a..a622c68d 100644 --- a/cmake/godotcpp.cmake +++ b/cmake/godotcpp.cmake @@ -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()