From 94076513166704edafd0567b438fa52c05569e25 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Wed, 19 Feb 2020 12:48:14 +0100 Subject: [PATCH] Fix issue when trying to install the library with cmake (wrong headers hierarchy) --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aea3c5a86..4e3389606 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,10 +260,12 @@ SET_TARGET_PROPERTIES(reactphysics3d PROPERTIES SOVERSION "0.7" ) -# Install target +# Install target (install library only, not headers) INSTALL(TARGETS reactphysics3d ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/reactphysics3d ) + +# Install the headers separately (because INSTALL(TARGETS ... PUBLIC_HEADER DESTINATION ...) does not support subfolders +INSTALL(DIRECTORY src/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/reactphysics3d FILES_MATCHING PATTERN "*.h")