Skip to content

Commit

Permalink
Merge pull request #3849 from uklotzde/cmake_target_link_libraries
Browse files Browse the repository at this point in the history
CMake: Restrict transitive dependencies between libraries, part 2
  • Loading branch information
Holzhaus authored May 9, 2021
2 parents 3254748 + 255d77c commit 458ba09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ if(ENGINEPRIME)
# An existing installation of djinterop is available.
message(STATUS "Using existing system installation of libdjinterop")
target_include_directories(mixxx-lib PUBLIC ${DjInterop_INCLUDE_DIRS})
target_link_libraries(mixxx-lib PUBLIC DjInterop::DjInterop)
target_link_libraries(mixxx-lib PRIVATE DjInterop::DjInterop)
else()
# Fetch djinterop sources from GitHub and build them statically.

Expand Down Expand Up @@ -1740,15 +1740,15 @@ if(ENGINEPRIME)
set(DJINTEROP_LIBRARY_PATH "${DJINTEROP_INSTALL_DIR}/${DJINTEROP_LIBRARY}")
set_target_properties(mixxx-libdjinterop PROPERTIES IMPORTED_LOCATION "${DJINTEROP_LIBRARY_PATH}")
target_include_directories(mixxx-lib PUBLIC ${DJINTEROP_INCLUDE_DIR})
target_link_libraries(mixxx-lib PUBLIC mixxx-libdjinterop)
target_link_libraries(mixxx-lib PRIVATE mixxx-libdjinterop)

# Since we have built libdjinterop from sources as a static library, its
# transitive dependencies are not automatically recognised. libdjinterop
# depends on zlib and optionally sqlite3. If libdjinterop was configured
# to depend on system SQLite, Mixxx will already have the dependency.
# But it does not have zlib, so we explicitly add that here.
find_package(ZLIB 1.2.8 REQUIRED)
target_link_libraries(mixxx-lib PUBLIC ${ZLIB_LIBRARIES})
target_link_libraries(mixxx-lib PRIVATE ${ZLIB_LIBRARIES})
endif()

# Include conditional sources only required with Engine Prime export support.
Expand Down

0 comments on commit 458ba09

Please sign in to comment.