From 9af5a7ecbe4fabf1f3885f938ddf07af0b609de3 Mon Sep 17 00:00:00 2001 From: Dusan Baran Date: Tue, 22 Oct 2024 15:31:30 +0200 Subject: [PATCH] Fixing auditwheel issues --- apis/python/CMakeLists.txt | 12 +----- libtiledbvcf/CMakeLists.txt | 2 + libtiledbvcf/src/CMakeLists.txt | 68 ++++++++++++++++----------------- 3 files changed, 38 insertions(+), 44 deletions(-) diff --git a/apis/python/CMakeLists.txt b/apis/python/CMakeLists.txt index c3c8b4551..376d4149d 100644 --- a/apis/python/CMakeLists.txt +++ b/apis/python/CMakeLists.txt @@ -62,22 +62,14 @@ target_link_libraries(${VCF_TARGET_NAME} PRIVATE tiledbvcf) if (APPLE) set_target_properties(${VCF_TARGET_NAME} PROPERTIES INSTALL_RPATH "@loader_path/lib") else() - set_target_properties(${VCF_TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/") - set_target_properties(tiledbvcf PROPERTIES INSTALL_RPATH "$ORIGIN/") + set_target_properties(${VCF_TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/lib") endif() -install( - IMPORTED_RUNTIME_ARTIFACTS - TileDB::tiledb_shared - RUNTIME DESTINATION tiledbvcf - LIBRARY DESTINATION tiledbvcf -) - # Install the extension module install( TARGETS ${VCF_TARGET_NAME} RUNTIME DESTINATION tiledbvcf - LIBRARY DESTINATION tiledbvcf + LIBRARY DESTINATION tiledbvcf # MODULE ARCHIVE DESTINATION tiledbvcf INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tiledbvcf diff --git a/libtiledbvcf/CMakeLists.txt b/libtiledbvcf/CMakeLists.txt index f153c6b14..1bf6c28da 100644 --- a/libtiledbvcf/CMakeLists.txt +++ b/libtiledbvcf/CMakeLists.txt @@ -50,6 +50,8 @@ find_package(TileDB REQUIRED) find_package(CLI11 REQUIRED) find_package(spdlog REQUIRED) +# TODO: Add simple find_package for Conda builds + if (WIN32) FetchContent_Declare( htslib diff --git a/libtiledbvcf/src/CMakeLists.txt b/libtiledbvcf/src/CMakeLists.txt index e0f1e4e78..8f78914b1 100644 --- a/libtiledbvcf/src/CMakeLists.txt +++ b/libtiledbvcf/src/CMakeLists.txt @@ -250,56 +250,56 @@ else() set_target_properties(tiledbvcf PROPERTIES INSTALL_RPATH "$ORIGIN/") endif() -set_property( - TARGET tiledbvcf-bin - PROPERTY INSTALL_RPATH - "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" - "${CMAKE_INSTALL_PREFIX}/lib" -) +#set_property( +# TARGET tiledbvcf-bin +# PROPERTY INSTALL_RPATH +# "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" +# "${CMAKE_INSTALL_PREFIX}/lib" +#) + +#if(WIN32) +# # Having the .dll and the .exe with the same name was resulting in a .exp +# # file for the .exe being 'last out' (replacing one of same name for the .dll) +# # and was causing the python api extension +# # to link to the .exe, which was not functional. +# # So, tiledbvcf-bin now sets an output (above somewhere) of tiledbvcfcli.exe +# # and we install it here RENAMEing it to match the known name in pre-existing +# # *nix world. +# install(PROGRAMS $ +# RENAME tiledbvcf.exe +# DESTINATION tiledbvcf +# ) +#else() +# install( +# TARGETS tiledbvcf-bin +# RUNTIME DESTINATION tiledbvcf +# ) +#endif() -if(WIN32) - # Having the .dll and the .exe with the same name was resulting in a .exp - # file for the .exe being 'last out' (replacing one of same name for the .dll) - # and was causing the python api extension - # to link to the .exe, which was not functional. - # So, tiledbvcf-bin now sets an output (above somewhere) of tiledbvcfcli.exe - # and we install it here RENAMEing it to match the known name in pre-existing - # *nix world. - install(PROGRAMS $ - RENAME tiledbvcf.exe - DESTINATION ${CMAKE_INSTALL_BINDIR} - ) -else() +if(TILEDBVCF_INSTALL_TILEDB) install( - TARGETS tiledbvcf-bin - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + IMPORTED_RUNTIME_ARTIFACTS + TileDB::tiledb_shared + RUNTIME DESTINATION tiledbvcf + LIBRARY DESTINATION tiledbvcf/lib ) endif() -#if(TILEDBVCF_INSTALL_TILEDB) -# install( -# IMPORTED_RUNTIME_ARTIFACTS -# TileDB::tiledb_shared -# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -# ) -#endif() - install( TARGETS tiledbvcf RUNTIME DESTINATION tiledbvcf - LIBRARY DESTINATION tiledbvcf - ARCHIVE DESTINATION tiledbvcf + LIBRARY DESTINATION tiledbvcf/lib + ARCHIVE DESTINATION tiledbvcf/lib INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tiledbvcf ) if (TILEDBVCF_ENABLE_PYTHON) if (APPLE) - set_target_properties(tiledbvcf-bin PROPERTIES INSTALL_RPATH "@loader_path/../lib") +# set_target_properties(tiledbvcf-bin PROPERTIES INSTALL_RPATH "@loader_path/..") set_target_properties(tiledbvcf PROPERTIES INSTALL_RPATH "@loader_path") else() - set_target_properties(tiledbvcf-bin PROPERTIES INSTALL_RPATH "\$ORIGIN/../lib") +# set_target_properties(tiledbvcf-bin PROPERTIES INSTALL_RPATH "\$ORIGIN/..") set_target_properties(tiledbvcf PROPERTIES INSTALL_RPATH "\$ORIGIN") endif() endif()