Skip to content

Commit

Permalink
fix: lib64 builds in CMake linking incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
steinwurf-sofie committed Aug 12, 2024
1 parent 2943eaa commit 2294a35
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ elseif (WIN32)
endif ()


include(GNUInstallDirs)
include(ExternalProject)
ExternalProject_add(project_srt
SOURCE_DIR ${STEINWURF_RESOLVE}/srt-source
Expand All @@ -60,23 +61,20 @@ ExternalProject_add(project_srt
EXCLUDE_FROM_ALL TRUE
STEP_TARGETS build
INSTALL_COMMAND ${CMAKE_COMMAND} --install ${STEINWURF_RESOLVE}/srt-source/cmake_build --prefix ${STEINWURF_RESOLVE}/srt-source/install --config ${CMAKE_BUILD_TYPE}
BUILD_BYPRODUCTS ${STEINWURF_RESOLVE}/srt-source/install/lib/${LIB_NAME}
BUILD_BYPRODUCTS ${STEINWURF_RESOLVE}/srt-source/install/${CMAKE_INSTALL_LIBDIR}/${LIB_NAME}
)




message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
add_library(srt STATIC IMPORTED GLOBAL)
add_dependencies(srt project_srt)
add_library(steinwurf::srt ALIAS srt)

# Make the include directory before we set the target properties otherwise cmake will complain
# as this is resovled at configure time rather than build time where the header files are generated
# as this is resolved at configure time rather than build time where the header files are generated
file(MAKE_DIRECTORY ${STEINWURF_RESOLVE}/srt-source/install/include)
set(SRT_GENERATED_INCLUDE_DIR ${STEINWURF_RESOLVE}/srt-source/install/include)
set_target_properties(srt PROPERTIES
IMPORTED_LOCATION ${STEINWURF_RESOLVE}/srt-source/install/lib/${LIB_NAME}
IMPORTED_LOCATION ${STEINWURF_RESOLVE}/srt-source/install/${CMAKE_INSTALL_LIBDIR}/${LIB_NAME}
INTERFACE_INCLUDE_DIRECTORIES ${SRT_GENERATED_INCLUDE_DIR}
)

Expand Down

0 comments on commit 2294a35

Please sign in to comment.