From 309bb778af155d220aacc1b323b67ff06c8bc9ac Mon Sep 17 00:00:00 2001 From: Daniel Rainer Date: Sun, 11 Jan 2026 18:34:01 +0100 Subject: [PATCH] cmake: use script for setting version in `fish.pc` The `build_tools/git_version_gen.sh` script can be used to determine the appropriate version string. With this change, the convoluted version file generation logic in CMake is no longer used and can subsequently be removed. Part of #12307 --- cmake/Install.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/Install.cmake b/cmake/Install.cmake index eeed6344c..6ab42fab2 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -114,9 +114,9 @@ configure_file(fish.pc.in fish.pc.noversion @ONLY) add_custom_command(OUTPUT fish.pc COMMAND sed '/Version/d' fish.pc.noversion > fish.pc COMMAND printf "Version: " >> fish.pc - COMMAND cat ${FBVF} >> fish.pc + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/git_version_gen.sh --stdout >> fish.pc WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS CHECK-FISH-BUILD-VERSION-FILE ${CMAKE_CURRENT_BINARY_DIR}/fish.pc.noversion) + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/fish.pc.noversion) add_custom_target(build_fish_pc ALL DEPENDS fish.pc) @@ -166,7 +166,7 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/user_doc/html/ # Trailing slash is install(FILES CHANGELOG.rst DESTINATION ${docdir}) # Group install targets into a InstallTargets folder -set_property(TARGET build_fish_pc CHECK-FISH-BUILD-VERSION-FILE +set_property(TARGET build_fish_pc PROPERTY FOLDER cmake/InstallTargets) # Make a target build_root that installs into the buildroot directory, for testing.