aboutsummaryrefslogtreecommitdiff
path: root/qdeduper/CMakeLists.txt
blob: 95bcbff3f1a4b23d23be6be4f95351beb6a97875 (plain) (blame)
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
set(CMAKE_INCLUDE_CURRENT_DIR ON)

option(QDEDUPER_USE_QT6 "Build qdeduper with Qt 6" OFF)

if (QDEDUPER_USE_QT6)
    find_package(Qt6 REQUIRED COMPONENTS Widgets Concurrent OPTIONAL_COMPONENTS DBus)
else()
    find_package(Qt5 REQUIRED COMPONENTS Widgets Concurrent OPTIONAL_COMPONENTS DBus)
endif()

if (Qt5DBus_FOUND OR Qt6DBus_FOUND)
    add_compile_definitions(HAS_QTDBUS)
endif()

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

add_executable(qdeduper
    main.cpp
    mingui.cpp
    imageitem.cpp
    sigdb_qt.cpp
    filescanner.cpp
    pathchooser.cpp
    settings.cpp
    preferencedialog.cpp
    utilities.cpp
    resources.qrc
)

target_link_libraries(qdeduper
    xsig
)

if(QDEDUPER_USE_QT6)
    target_link_libraries(qdeduper Qt6::Widgets Qt6::Concurrent)
    if(Qt6DBus_FOUND)
        target_link_libraries(qdeduper Qt6::DBus)
    endif()
else()
    target_link_libraries(qdeduper Qt5::Widgets Qt5::Concurrent)
    if(Qt5DBus_FOUND)
        target_link_libraries(qdeduper Qt5::DBus)
    endif()
endif()

if(WIN32)
    set_property(TARGET qdeduper PROPERTY WIN32_EXECUTABLE True)
endif()