Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmake] FindCdio: also search for libiso9660 #12706

Merged
merged 1 commit into from Aug 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions cmake/modules/FindCdio.cmake
Expand Up @@ -23,16 +23,25 @@ find_path(CDIO_INCLUDE_DIR NAMES cdio/cdio.h
find_library(CDIO_LIBRARY NAMES cdio libcdio
PATHS ${CDIO_libcdio_LIBDIR} ${CDIO_libiso9660_LIBDIR})

if(NOT WIN32)
find_path(ISO9660_INCLUDE_DIR NAMES cdio/iso9660.h
PATHS ${PC_CDIO_libcdio_INCLUDEDIR}
${PC_CDIO_libiso9660_INCLUDEDIR})
find_library(ISO9660_LIBRARY NAMES iso9660
PATHS ${CDIO_libcdio_LIBDIR} ${CDIO_libiso9660_LIBDIR})
list(APPEND ISO9660_VARS ISO9660_INCLUDE_DIR ISO9660_LIBRARY)
endif()

set(CDIO_VERSION ${PC_CDIO_libcdio_VERSION})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Cdio
REQUIRED_VARS CDIO_LIBRARY CDIO_INCLUDE_DIR
REQUIRED_VARS CDIO_LIBRARY CDIO_INCLUDE_DIR ${ISO9660_VARS}
VERSION_VAR CDIO_VERSION)

if(CDIO_FOUND)
set(CDIO_LIBRARIES ${CDIO_LIBRARY})
set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR})
set(CDIO_LIBRARIES ${CDIO_LIBRARY} ${ISO9660_LIBRARY})
set(CDIO_INCLUDE_DIRS ${CDIO_INCLUDE_DIR} ${ISO9660_INCLUDE_DIR})

if(NOT TARGET CDIO::CDIO)
add_library(CDIO::CDIO UNKNOWN IMPORTED)
Expand All @@ -42,4 +51,4 @@ if(CDIO_FOUND)
endif()
endif()

mark_as_advanced(CDIO_INCLUDE_DIR CDIO_LIBRARY)
mark_as_advanced(CDIO_INCLUDE_DIR CDIO_LIBRARY ISO9660_INCLUDE_DIR ISO9660_LIBRARY)