summaryrefslogtreecommitdiff
path: root/ui/qt5/CMakeLists.txt
blob: 74b9c68a1378d6612ec5e5d3b38afc1316c4c60c (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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(UI_SOURCES
    horizonwizard.cc
    horizonwizardpage.cc
    horizonhelpwindow.cc
    main.cc
    ${CMAKE_SOURCE_DIR}/3rdparty/Section.cpp
    stepprogresswidget.cc
    subnetbox.cc
    customwifidialog.cc
    mountdialog.cc
    useraccountwidget.cc
    avatardialog.cc
    crypt_sha512.c

    intropage.cc
    advoptsdialog.cc
    inputpage.cc
    partitiondiskpage.cc
    partitionchoicepage.cc
    partitionmanualpage.cc
    partitionmountpage.cc
    networkingpage.cc
    networkifacepage.cc
    netsimplewifipage.cc
    netdhcppage.cc
    netmanualpage.cc
    datetimepage.cc
    hostnamepage.cc
    pkgsimple.cc
    pkgmodel.cc
    pkgcustom.cc
    pkgdefaults.cc
    bootpage.cc
    rootpwpage.cc
    accountpage.cc

    horizon.qrc)

set(RUN_QT_SOURCES
    horizonhelpwindow.cc
    horizonwizardpage.cc
    stepprogresswidget.cc
    runner/main.cc
    runner/executorprocess.cc
    runner/executorwizard.cc
    runner/executepage.cc
    runner/errorpage.cc
    runner/finishedpage.cc

    horizon.qrc)

IF(INSTALL)
    LIST(APPEND UI_SOURCES
        commitpage.cc
        partitionprobe.cc
        partitionpage.cc)
ELSE(INSTALL)
    LIST(APPEND UI_SOURCES writeoutpage.cc)
ENDIF(INSTALL)

IF(UNSUPPORTED_NONFREE_FIRMWARE)
    LIST(APPEND UI_SOURCES firmwarepage.cc)
ENDIF(UNSUPPORTED_NONFREE_FIRMWARE)

find_package(OpenSSL REQUIRED COMPONENTS Crypto)
include_directories(${CMAKE_SOURCE_DIR}/3rdparty)
add_executable(horizon-qt5 ${UI_SOURCES})
target_link_libraries(horizon-qt5 Qt5::Network Qt5::Widgets OpenSSL::Crypto)

IF("cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
    set_property(TARGET horizon-qt5 PROPERTY CXX_STANDARD 17)
ENDIF()

install(TARGETS horizon-qt5 DESTINATION bin)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/horizon-qt5.1 DESTINATION share/man/man1)

IF(INSTALL)
    pkg_check_modules(XKBFile REQUIRED xkbfile)
    pkg_check_modules(LIBX11 REQUIRED x11)
    pkg_check_modules(LibCap REQUIRED libcap)
    find_library(SKARNET NAMES skarnet)
    find_library(BCNM NAMES wpactrl PATH_SUFFIXES bcnm)
    if(BCNM STREQUAL "BCNM-NOTFOUND")
        message(FATAL_ERROR "BCNM is required for the Installation Environment.")
    endif()
    target_link_libraries(horizon-qt5 ${BCNM} ${SKARNET} ${LIBUDEV_LIBRARIES} ${LibCap_LIBRARIES} ${LIBX11_LIBRARIES} ${XKBFile_LIBRARIES} diskman)
    add_executable(horizon-run-qt5 ${RUN_QT_SOURCES})
    target_link_libraries(horizon-run-qt5 Qt5::Widgets)
    target_compile_definitions(horizon-run-qt5 PRIVATE IN_RUNNER)
    IF("cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
        set_property(TARGET horizon-run-qt5 PROPERTY CXX_STANDARD 17)
    ENDIF()
    install(TARGETS horizon-run-qt5 DESTINATION bin)
    install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/horizon-run-qt5.8 DESTINATION share/man/man8)
    install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/horizon-ppc64-detect ${CMAKE_CURRENT_SOURCE_DIR}/horizon-xauth-helper DESTINATION bin)
    install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/horizon-ppc64-detect.1 ${CMAKE_CURRENT_SOURCE_DIR}/horizon-xauth-helper.1 DESTINATION share/man/man1)
ENDIF(INSTALL)