From 42295e555040e8cbc41c5a68aa54abaf84163ba5 Mon Sep 17 00:00:00 2001 From: Tiago Garcia Date: Thu, 18 Jul 2024 19:13:15 +0100 Subject: [PATCH] CMake workflow update Signed-off-by: Tiago Garcia --- .gitignore | 22 +++++++++---------- CMakeLists.txt | 4 ++-- .../gh-wh-handler.service.in | 0 .../uninstall.cmake.in | 0 4 files changed, 13 insertions(+), 13 deletions(-) rename gh-wh-handler.service.in => build/gh-wh-handler.service.in (100%) rename uninstall.cmake.in => build/uninstall.cmake.in (100%) diff --git a/.gitignore b/.gitignore index 795d4b1..44bf4e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,15 @@ # CMake build directories -/build*/ -/CMakeFiles/ -/CMakeCache.txt -/cmake_install.cmake -/*.cmake -/*.cbp -/*.layout -/*.stackdump -/CPackConfig.cmake -/Makefile -/CTestTestfile.cmake +CMakeFiles/ +CMakeCache.txt +cmake_install.cmake +*.cmake +*.cbp +*.layout +*.stackdump +CPackConfig.cmake +Makefile +CTestTestfile.cmake +install_manifest.txt # Compiled binaries /bin/ diff --git a/CMakeLists.txt b/CMakeLists.txt index eec890f..b920fef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ set_target_properties(${EXECUTABLE_NAME} PROPERTIES LINK_FLAGS set(SERVICE_EXECUTABLE "/services/gh-wh-handler/${EXECUTABLE_NAME}") set(SERVICE_CONFIG "/services/gh-wh-handler/config.json") configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/gh-wh-handler.service.in" + "${CMAKE_CURRENT_BINARY_DIR}/gh-wh-handler.service.in" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/gh-wh-handler.service" @ONLY) install(CODE "file(MAKE_DIRECTORY /services/gh-wh-handler)") @@ -65,7 +65,7 @@ install(CODE "execute_process(COMMAND systemctl start gh-wh-handler)") if(NOT TARGET uninstall) configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake" IMMEDIATE @ONLY) add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake) endif() diff --git a/gh-wh-handler.service.in b/build/gh-wh-handler.service.in similarity index 100% rename from gh-wh-handler.service.in rename to build/gh-wh-handler.service.in diff --git a/uninstall.cmake.in b/build/uninstall.cmake.in similarity index 100% rename from uninstall.cmake.in rename to build/uninstall.cmake.in