source: calamares/trunk/fuentes/src/modules/locale/CMakeLists.txt @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 13 months ago

sync with github

File size: 1.7 KB
Line 
1find_package(ECM ${ECM_VERSION} NO_MODULE)
2if( ECM_FOUND AND BUILD_TESTING )
3    include( ECMAddTests )
4    find_package( Qt5 COMPONENTS Core Test REQUIRED )
5endif()
6
7# When debugging the timezone widget, add this debugging definition
8# to have a debugging-friendly timezone widget, debug logging,
9# and no intrusive timezone-setting while clicking around.
10#
11# add_definitions( -DDEBUG_TIMEZONES )
12
13include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
14
15set( geoip_src GeoIP.cpp GeoIPJSON.cpp )
16set( geoip_libs )
17
18find_package(Qt5 COMPONENTS Xml)
19if( Qt5Xml_FOUND )
20    list( APPEND geoip_src GeoIPXML.cpp )
21    list( APPEND geoip_libs Qt5::Xml )
22    add_definitions( -DHAVE_XML )
23endif()
24
25calamares_add_plugin( locale
26    TYPE viewmodule
27    EXPORT_MACRO PLUGINDLLEXPORT_PRO
28    SOURCES
29        ${geoip_src}
30        LCLocaleDialog.cpp
31        LocaleConfiguration.cpp
32        LocalePage.cpp
33        LocaleViewStep.cpp
34        SetTimezoneJob.cpp
35        timezonewidget/timezonewidget.cpp
36        timezonewidget/localeglobal.cpp
37    UI
38    RESOURCES
39        locale.qrc
40    LINK_PRIVATE_LIBRARIES
41        calamaresui
42        Qt5::Network
43        ${geoip_libs}
44        ${YAMLCPP_LIBRARY}
45    SHARED_LIB
46)
47
48if( ECM_FOUND AND BUILD_TESTING )
49    ecm_add_test(
50            GeoIPTests.cpp
51            ${geoip_src}
52        TEST_NAME
53            geoiptest
54        LINK_LIBRARIES
55            calamaresui
56            Qt5::Network
57            Qt5::Test
58            ${geoip_libs}
59            ${YAMLCPP_LIBRARY}
60    )
61    set_target_properties( geoiptest PROPERTIES AUTOMOC TRUE )
62endif()
63
64if( BUILD_TESTING )
65    add_executable( test_geoip test_geoip.cpp ${geoip_src} )
66    target_link_libraries( test_geoip calamaresui Qt5::Network ${geoip_libs} ${YAMLCPP_LIBRARY} )
67endif()
Note: See TracBrowser for help on using the repository browser.