From e94bb01577309d4b8a1492fa3a7b76923036dd31 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Tue, 31 Jul 2018 20:12:15 +0200 Subject: [PATCH] Fix CMake install issue (not installing headers and always building a static library) --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 147a6a73..decc5367 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,7 +234,7 @@ SET (REACTPHYSICS3D_SOURCES ) # Create the library -ADD_LIBRARY(reactphysics3d STATIC ${REACTPHYSICS3D_HEADERS} ${REACTPHYSICS3D_SOURCES}) +ADD_LIBRARY(reactphysics3d ${REACTPHYSICS3D_HEADERS} ${REACTPHYSICS3D_SOURCES}) # Headers TARGET_INCLUDE_DIRECTORIES(reactphysics3d PUBLIC @@ -252,10 +252,12 @@ IF(RP3D_COMPILE_TESTS) add_subdirectory(test/) ENDIF() +SET_TARGET_PROPERTIES(reactphysics3d PROPERTIES PUBLIC_HEADER "${REACTPHYSICS3D_HEADERS}") + # Install target INSTALL(TARGETS reactphysics3d - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/reactphysics3d + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/reactphysics3d + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/reactphysics3d + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/reactphysics3d )