This is an automated email from the ASF dual-hosted git repository.
cmcfarlen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new dce2ddafc8 cmake: small fixes to install (#10945)
dce2ddafc8 is described below
commit dce2ddafc88570a7f00dacdbb3672476e8da3c08
Author: Chris McFarlen <[email protected]>
AuthorDate: Wed Dec 20 09:47:32 2023 -0600
cmake: small fixes to install (#10945)
* cmake: small fixes to install
* fix post install command
* Install yaml-cpp if the build uses the internal version
---------
Co-authored-by: Chris McFarlen <[email protected]>
---
.gitignore | 2 +-
CMakeLists.txt | 4 +++-
cmake/post_install.cmake | 5 ++---
lib/CMakeLists.txt | 2 +-
src/api/CMakeLists.txt | 2 +-
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/.gitignore b/.gitignore
index 5c26e9a34f..8635f43500 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,7 +23,7 @@ Makefile.in
.cproject
.idea
-CMakeUserPresets.json
+/CMakeUserPresets.json
# clangd language server files.
/compile_commands.json
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac0a9e1a2c..93cc4f651d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -720,7 +720,9 @@ install(DIRECTORY DESTINATION ${CMAKE_INSTALL_CACHEDIR})
install(CODE "set(OWNER_USER ${TS_PKGSYSUSER})")
install(CODE "set(OWNER_GROUP ${TS_PKGSYSGROUP})")
-install(CODE "set(CHOWN_DIRS ${CMAKE_INSTALL_LOGDIR}
${CMAKE_INSTALL_RUNSTATEDIR} ${CMAKE_INSTALL_CACHEDIR})")
+install(
+ CODE "set(CHOWN_DIRS ${CMAKE_INSTALL_FULL_LOGDIR}
${CMAKE_INSTALL_FULL_RUNSTATEDIR} ${CMAKE_INSTALL_FULL_CACHEDIR})"
+)
install(SCRIPT cmake/post_install.cmake)
# Display build summary
diff --git a/cmake/post_install.cmake b/cmake/post_install.cmake
index 641e198bfb..01e08a5fc4 100644
--- a/cmake/post_install.cmake
+++ b/cmake/post_install.cmake
@@ -17,8 +17,7 @@
if("$ENV{USER}" STREQUAL root)
foreach(DIR ${CHOWN_DIRS})
- message(STATUS "Changing ${DIR} ownership to ${OWNER_USER}:${OWNER_GROUP}")
- execute_process(COMMAND chown ${OWNER_USER}:${OWNER_GROUP}
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${DIR}")
+ message(STATUS "Changing $ENV{DESTDIR}${DIR} ownership to
${OWNER_USER}:${OWNER_GROUP}")
+ execute_process(COMMAND chown ${OWNER_USER}:${OWNER_GROUP}
"$ENV{DESTDIR}${DIR}")
endforeach()
-
endif()
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 5ad291e7cc..513fefccdd 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -23,7 +23,7 @@ if(NOT TARGET yaml-cpp::yaml-cpp)
# Turning CLANG_FORMAT off causes yamlcpp to not add its format target which
# otherwise conflicts with our format target.
set(YAML_CPP_CLANG_FORMAT_EXE OFF)
- set(YAML_CPP_INSTALL OFF)
+ set(YAML_CPP_INSTALL ON)
add_subdirectory(yamlcpp)
install(TARGETS yaml-cpp)
endif()
diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt
index f9b65b52df..3f00e974f2 100644
--- a/src/api/CMakeLists.txt
+++ b/src/api/CMakeLists.txt
@@ -51,7 +51,7 @@ target_link_libraries(
)
install(
- TARGETS tsapi tsapibackend
+ TARGETS tsapi
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ts