Skip to content

Commit

Permalink
Merge pull request #729 from jcarpent/master
Browse files Browse the repository at this point in the history
Add normalization step for install_path
  • Loading branch information
jcarpent authored Dec 19, 2024
2 parents 29c0eb4 + ea87561 commit bc462fb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions header.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2008-2019 LAAS-CNRS, JRL AIST-CNRS, INRIA.
# Copyright (C) 2008-2024 LAAS-CNRS, JRL AIST-CNRS, INRIA.
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -316,9 +316,20 @@ macro(HEADER_INSTALL)
string(REGEX REPLACE "${CMAKE_BINARY_DIR}" "" DIR "${DIR}")
string(REGEX REPLACE "${PROJECT_SOURCE_DIR}" "" DIR "${DIR}")
string(REGEX REPLACE "include(/|$)" "" DIR "${DIR}")
if(CMAKE_VERSION` VERSION_GREATER 3.20)
# workaround CMP0177
cmake_path(
SET
INSTALL_PATH
NORMALIZE
"${CMAKE_INSTALL_INCLUDEDIR}/${DIR}"
)
else()
set(INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}/${DIR}")
endif()
install(
FILES ${FILE}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${DIR}"
DESTINATION ${INSTALL_PATH}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
COMPONENT ${_COMPONENT_NAME}
)
Expand Down

0 comments on commit bc462fb

Please sign in to comment.