From 6ce59d74eeae2b5f9c2c6971f4707206debb2f98 Mon Sep 17 00:00:00 2001 From: Markus Rickert Date: Sat, 28 Nov 2020 23:30:47 +0100 Subject: [PATCH] Use NAMELINK_COMPONENT in CMake install --- CMakeLists.txt | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ebb7dd2..70190906 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -638,20 +638,29 @@ if(ODE_WITH_OU OR NOT ODE_NO_THREADING_INTF) target_link_libraries(ODE ${CMAKE_THREAD_LIBS_INIT}) endif() -install( - TARGETS ODE - EXPORT ODE - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_SKIP - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime -) - -if(BUILD_SHARED_LIBS) +if(NOT CMAKE_VERSION VERSION_LESS 3.12) install( TARGETS ODE EXPORT ODE - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development NAMELINK_ONLY + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_COMPONENT development + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime ) +else() + install( + TARGETS ODE + EXPORT ODE + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_SKIP + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + ) + if(BUILD_SHARED_LIBS) + install( + TARGETS ODE + EXPORT ODE + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development NAMELINK_ONLY + ) + endif() endif() if(MSVC AND BUILD_SHARED_LIBS AND NOT CMAKE_VERSION VERSION_LESS 3.1) -- 2.11.4.GIT