mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-08-10 14:09:48 +00:00
Implement autodetect set type.
Only supports HardDisk, Directory, CdRom, DVD, BluRay for now.
This commit is contained in:
parent
87bc031e65
commit
fe2ea40c4f
13 changed files with 499 additions and 17 deletions
35
cmake/Modules/Findblkid.cmake
Normal file
35
cmake/Modules/Findblkid.cmake
Normal file
|
@ -0,0 +1,35 @@
|
|||
#Find libblkid
|
||||
#
|
||||
# BLKID_INCLUDE_DIRS - where to find blkid/blkid.h
|
||||
# BLKID_LIBRARIES - list of libraries when using libblkid
|
||||
# BLKID_FOUND - true if libblkid found
|
||||
# BLKID_VERSION_STRING- the version of the libblkid found
|
||||
#
|
||||
|
||||
|
||||
find_path(BLKID_INCLUDE_DIR NAMES blkid/blkid.h)
|
||||
mark_as_advanced(BLKID_INCLUDE_DIR)
|
||||
|
||||
find_library(BLKID_LIBRARY NAMES
|
||||
blkid
|
||||
)
|
||||
mark_as_advanced(BLKID_LIBRARY)
|
||||
|
||||
if(BLKID_INCLUDE_DIR)
|
||||
if(EXISTS "${BLKID_INCLUDE_DIR}/blkid/blkid.h")
|
||||
file(STRINGS "${BLKID_INCLUDE_DIR}/blkid/blkid.h" blkid_version_str REGEX "^#define[\t ]+BLKID_VERSION[\t ]+\".*\"")
|
||||
string(REGEX REPLACE "^#define[\t ]+BLKID_VERSION[\t ]+\"([^\"]*)\".*" "\\1" BLKID_VERSION_STRING "${blkid_version_str}")
|
||||
unset(blkid_version_str)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BLKID
|
||||
REQUIRED_VARS BLKID_LIBRARY BLKID_INCLUDE_DIR
|
||||
VERSION_VAR BLKID_VERSION_STRING
|
||||
)
|
||||
|
||||
if(BLKID_FOUND)
|
||||
set(BLKID_LIBRARIES ${BLKID_LIBRARY})
|
||||
set(BLKID_INCLUDE_DIRS ${BLKID_INCLUDE_DIR})
|
||||
endif()
|
Loading…
Add table
Add a link
Reference in a new issue