Skip to content

Commit

Permalink
Merge pull request #1125 from otegami/fix-ignored-includedir
Browse files Browse the repository at this point in the history
Fix header file installation to respect `CMAKE_INSTALL_INCLUDEDIR`
  • Loading branch information
redboltz authored Jun 24, 2024
2 parents a5c8a2c + 724d1aa commit bf2504e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,14 @@ INSTALL (TARGETS ${MSGPACK_INSTALLTARGETS} EXPORT msgpack-c-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
FOREACH (file ${msgpack-c_common_HEADERS})
GET_FILENAME_COMPONENT (dir ${file} PATH)
INSTALL (FILES ${file} DESTINATION ${dir})
GET_FILENAME_COMPONENT(dir ${file} DIRECTORY)
STRING(REPLACE "include" "${CMAKE_INSTALL_INCLUDEDIR}" header_path ${dir})
INSTALL (FILES ${file} DESTINATION ${header_path})
ENDFOREACH ()
FOREACH (file ${msgpack-c_configured_HEADERS})
GET_FILENAME_COMPONENT (dir ${file} PATH)
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION ${dir})
GET_FILENAME_COMPONENT(dir ${file} DIRECTORY)
STRING(REPLACE "include" "${CMAKE_INSTALL_INCLUDEDIR}" header_path ${dir})
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION ${header_path})
ENDFOREACH ()
IF (NOT MSVC)
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/msgpack-c.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
Expand Down

0 comments on commit bf2504e

Please sign in to comment.