Skip to content

Commit

Permalink
cmake(pkg-config): resolve CMAKE_INSTALL_PREFIX at install time
Browse files Browse the repository at this point in the history
not at configure, else this won't work:

    cmake -B builddir ...
    cmake --build builddir ...
    cmake --install builddir --prefix=destdir

as the populated cmake file will not know about the desired prefix
  • Loading branch information
Piraty authored and arvidn committed Jan 27, 2025
1 parent 23156c5 commit 56cae3b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ set(_interface_compile_options "${_TARGET_INTERFACE_COMPILE_OPTIONS}")
string(REPLACE ";" " " _interface_compile_options "${_interface_compile_options}")

configure_file("@_pkg_config_file_template_filename@" "@_generate_target_dir@/@[email protected]" @ONLY)
file(INSTALL "@_generate_target_dir@/@[email protected]" DESTINATION "@CMAKE_INSTALL_FULL_LIBDIR@/pkgconfig")
file(INSTALL "@_generate_target_dir@/@[email protected]" DESTINATION "${CMAKE_INSTALL_PREFIX}/@CMAKE_INSTALL_LIBDIR@/pkgconfig")

0 comments on commit 56cae3b

Please sign in to comment.