diff --git a/Sofa/framework/Simulation/Common/CMakeLists.txt b/Sofa/framework/Simulation/Common/CMakeLists.txt index 19ffb4de7c1..0afa122d21d 100644 --- a/Sofa/framework/Simulation/Common/CMakeLists.txt +++ b/Sofa/framework/Simulation/Common/CMakeLists.txt @@ -41,10 +41,10 @@ sofa_find_package(Sofa.Core REQUIRED) sofa_find_package(Sofa.Simulation.Core REQUIRED) sofa_find_package(TinyXML2 REQUIRED) -if(CMAKE_SYSTEM_NAME STREQUAL Windows) - sofa_install_libraries(TARGETS tinyxml2::tinyxml2) -else() +if(UNIX AND NOT APPLE) sofa_install_libraries(PATHS ${TinyXML2_LIBRARY}) +else() + sofa_install_libraries(TARGETS tinyxml2::tinyxml2) endif() add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) diff --git a/cmake/Modules/FindTinyXML2.cmake b/cmake/Modules/FindTinyXML2.cmake index 20dc67353c5..6dda44b060d 100644 --- a/cmake/Modules/FindTinyXML2.cmake +++ b/cmake/Modules/FindTinyXML2.cmake @@ -40,8 +40,11 @@ else() set(TinyXML2_INCLUDE_DIRS ${TinyXML2_INCLUDE_DIR}) if(NOT TARGET tinyxml2::tinyxml2) - add_library(tinyxml2::tinyxml2 INTERFACE IMPORTED) - set_property(TARGET tinyxml2::tinyxml2 PROPERTY INTERFACE_LINK_LIBRARIES "${TinyXML2_LIBRARIES}") + add_library(tinyxml2::tinyxml2 SHARED IMPORTED) + set_property(TARGET tinyxml2::tinyxml2 PROPERTY IMPORTED_LOCATION "${TinyXML2_LIBRARIES}") + if(WIN32) + set_property(TARGET tinyxml2::tinyxml2 PROPERTY IMPORTED_IMPLIB "${TinyXML2_LIBRARIES}") + endif() set_property(TARGET tinyxml2::tinyxml2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${TinyXML2_INCLUDE_DIR}") endif() else() diff --git a/tools/postinstall-fixup/macos-postinstall-fixup.sh b/tools/postinstall-fixup/macos-postinstall-fixup.sh index 60a17db6c25..d29865ab2c4 100644 --- a/tools/postinstall-fixup/macos-postinstall-fixup.sh +++ b/tools/postinstall-fixup/macos-postinstall-fixup.sh @@ -114,6 +114,7 @@ check-all-deps() { echo "$dependencies" | grep --quiet "/libicu" || echo "$dependencies" | grep --quiet "/libGLEW" || echo "$dependencies" | grep --quiet "/libjpeg" || + echo "$dependencies" | grep --quiet "/libtinyxml2" || echo "$dependencies" | grep --quiet "/libpng" ; then is_fixup_needed="true" fi @@ -134,6 +135,8 @@ check-all-deps() { libname="$libjpeg" elif libpng="$(echo $dep | egrep -o "/libpng[^\/]*?\.dylib$" | cut -c2-)" && [ -n "$libpng" ]; then libname="$libpng" + elif libtinyxml2="$(echo $dep | egrep -o "/libtinyxml2[^\/]*?\.dylib$" | cut -c2-)" && [ -n "$libtinyxml2" ]; then + libname="$libtinyxml2" elif libtiff="$(echo $dep | egrep -o "/libtiff[^\/]*?\.dylib$" | cut -c2-)" && [ -n "$libtiff" ]; then libname="$libtiff" else