summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
blob: bd0b61897b8b75bde2d9a2320864462bfc030690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
###########################################
#                                         #
#  Improvements and feedback are welcome  #
#                                         #
#  This file is released under GPL >= 3   #
#                                         #
###########################################


# required stuff
find_package( TQt )
find_package( TDE )

tde_setup_architecture_flags( )

include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)

tde_setup_largefiles( )


##### check for gcc visibility support #########

if( WITH_GCC_VISIBILITY )
  tde_setup_gcc_visibility( )
endif( )


#### check for headers

check_include_file( "sys/sysmacros.h" HAVE_SYS_SYSMACROS_H )

#### check for libdvdread, libdvdnav and libdvdcss

macro( tqt_message )
    message( STATUS "${ARGN}" )
endmacro( )

set(_dvdlibs dvdread dvdnav)
set(_handlevars LIBDVD_INCLUDE_DIRS DVDREAD_LIBRARY DVDNAV_LIBRARY)

if(WITH_ALL_OPTIONS)
    set(WITH_DVDCSS "ON")
endif()

if(WITH_DVDCSS)
    list(APPEND _dvdlibs libdvdcss)
    list(APPEND _handlevars DVDCSS_LIBRARY LIBDVDCSS_INCLUDE_DIRS )
endif()

if(PKG_CONFIG_FOUND)
    pkg_check_modules(PC_DVD ${_dvdlibs} QUIET)
endif()

find_path(LIBDVD_INCLUDE_DIRS dvdnav/dvdnav.h PATHS ${PC_DVD_INCLUDE_DIRS})
find_library(DVDREAD_LIBRARY NAMES dvdread libdvdread PATHS ${PC_DVD_dvdread_LIBDIR})
find_library(DVDNAV_LIBRARY NAMES dvdnav libdvdnav PATHS ${PC_DVD_dvdnav_LIBDIR})

if(WITH_DVDCSS)
    find_path(LIBDVDCSS_INCLUDE_DIRS dvdcss/dvdcss.h PATHS ${PC_DVD_INCLUDE_DIRS})
    find_library(DVDCSS_LIBRARY NAMES dvdcss libdvdcss PATHS ${PC_DVD_libdvdcss_LIBDIR})
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibDvd REQUIRED_VARS ${_handlevars})
if(LIBDVD_FOUND)
    list(APPEND LIBDVD_LIBRARIES ${DVDREAD_LIBRARY})
    list(APPEND LIBDVD_LIBRARIES ${DVDNAV_LIBRARY})
    if(WITH_DVDCSS)
        list(APPEND LIBDVD_LIBRARIES ${DVDCSS_LIBRARY})
    endif()
    foreach(_dvd_lib ${LIBDVD_LIBRARIES})
        tqt_message( "       ${_dvd_lib}" )
    endforeach()
else()
    tde_message_fatal( "  DVD libraries not found" )
endif()