diff --git a/.gitignore b/.gitignore index 1cebe8c..6d903a6 100644 --- a/.gitignore +++ b/.gitignore @@ -187,4 +187,5 @@ src/python/setup.py src/python/pyproject.toml src/python/README.md src/python/librir/libs -install \ No newline at end of file +install +src/cpp/rir_config.h \ No newline at end of file diff --git a/extra/ffmpeg/CMakeLists.txt b/extra/ffmpeg/CMakeLists.txt index 6cc534f..7938049 100644 --- a/extra/ffmpeg/CMakeLists.txt +++ b/extra/ffmpeg/CMakeLists.txt @@ -164,7 +164,9 @@ set(FFMPEG_CONFIGURE_CMD export LD_LIBRARY_PATH=${3RD_64_INSTALL_DIR}/lib:$ENV{LD_LIBRARY_PATH} && export PKG_CONFIG_PATH=${3RD_64_INSTALL_DIR}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH} && export OPENSSL_LIBS="-L/usr/lib64 -llibeay32 -lssleay32 -llibcrypto -luser32 -lgdi32 -lwsock32 -lws2_32" && - ./configure --arch=native --enable-asm --disable-libvpx --disable-libaom --disable-static --enable-shared --enable-libx264 --enable-libkvazaar --extra-cflags=-DKVZ_STATIC_LIB --enable-gpl --enable-rpath --enable-pic --disable-debug) + export LDSOFLAGS="-Wl,-rpath,\\\$$\\$$$$ORIGIN" && # This monstruosity is due to makefile substitions in ffmpeg configure + # export LDEXEFLAGS=-Wl,-rpath,\''$$ORIGIN/../lib'\' && + ./configure --arch=native --enable-asm --disable-libvpx --disable-libaom --disable-static --enable-shared --enable-libx264 --enable-libkvazaar --extra-cflags=-DKVZ_STATIC_LIB --enable-gpl --enable-pic --disable-debug) ExternalProject_Add(ffmpeg SOURCE_DIR ${CMAKE_BINARY_DIR}/_deps/ffmpeg-src @@ -200,6 +202,7 @@ set(FFMPEG_SHARED_LIBRARIES) foreach(component version IN ZIP_LISTS REQUIRED_FFMPEG_COMPONENTS FFMPEG_SHARED_LIBRARIES_VERSIONS) add_library("FFMPEG::lib${component}" SHARED IMPORTED GLOBAL) + set_target_properties("FFMPEG::lib${component}" PROPERTIES INSTALL_RPATH "$ORIGIN") add_dependencies("FFMPEG::lib${component}" ffmpeg) set(${component}_LIBRARY_NAME lib${component}.so) diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index d90d85b..2f92b83 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -110,4 +110,11 @@ if(PIP_EXECUTABLE AND BUILD_WHEEL) install(CODE "execute_process(COMMAND ${PIP_EXECUTABLE} wheel ${CMAKE_CURRENT_SOURCE_DIR} -w ${CMAKE_INSTALL_PREFIX}/dist --no-deps)") endif() -# add_custom_command() \ No newline at end of file +# On Linux plateforms: +# Copy west shared libs to python/librir_west/libs with links, at it is not properly done by cmake install +if(UNIX AND NOT APPLE) + install(CODE "execute_process(COMMAND cp --verbose -a ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libtools.so.${CMAKE_PROJECT_VERSION} ${CMAKE_INSTALL_PREFIX}/python/librir/libs/)") + install(CODE "execute_process(COMMAND cp --verbose -a ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libgeometry.so.${CMAKE_PROJECT_VERSION} ${CMAKE_INSTALL_PREFIX}/python/librir/libs/)") + install(CODE "execute_process(COMMAND cp --verbose -a ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libsignal_processing.so.${CMAKE_PROJECT_VERSION} ${CMAKE_INSTALL_PREFIX}/python/librir/libs/)") + install(CODE "execute_process(COMMAND cp --verbose -a ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libvideo_io.so.${CMAKE_PROJECT_VERSION} ${CMAKE_INSTALL_PREFIX}/python/librir/libs/)") +endif() \ No newline at end of file