Skip to content

Commit

Permalink
- Updated cmake config for PkgConfig::JACK checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
rncbc committed Dec 8, 2023
1 parent 5e14bff commit a61bf76
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 18 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,24 @@ endif ()


# Find package modules
find_package (Jack REQUIRED)
set (CONFIG_JACK 1)
set (CMAKE_REQUIRED_LIBRARIES "${Jack_LIBRARIES};${CMAKE_REQUIRED_LIBRARIES}")
set (CMAKE_REQUIRED_INCLUDES "${Jack_INCLUDE_DIRS};${CMAKE_REQUIRED_INCLUDES}")
include (FindPkgConfig)

pkg_check_modules (JACK IMPORTED_TARGET jack>=0.100.0)
if (JACK_FOUND)
find_library (JACK_LIBRARY NAMES ${JACK_LIBRARIES} HINTS ${JACK_LIBDIR})
if (JACK_LIBRARY)
set (CONFIG_JACK 1)
set (CMAKE_REQUIRED_LIBRARIES "${JACK_LIBRARIES};${CMAKE_REQUIRED_LIBRARIES}")
set (CMAKE_REQUIRED_INCLUDES "${JACK_INCLUDE_DIRS};${CMAKE_REQUIRED_INCLUDES}")
else ()
message (FATAL_ERROR "*** JACK library not found.")
set (CONFIG_JACK 0)
endif ()
else ()
message (FATAL_ERROR "*** JACK package not found.")
set (CONFIG_JACK 0)
endif ()

# Check for jack/statistics.h header.
check_include_file (jack/statistics.h HAVE_JACK_STATISTICS_H)
if (NOT HAVE_JACK_STATISTICS_H)
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ if (CONFIG_DBUS)
endif ()

if (CONFIG_JACK)
target_link_libraries (${PROJECT_NAME} PRIVATE Jack::Jack)
target_link_libraries (${PROJECT_NAME} PRIVATE PkgConfig::JACK)
endif ()

if (CONFIG_ALSA_SEQ)
Expand Down

0 comments on commit a61bf76

Please sign in to comment.