2018-04-12 22:05:02 +02:00
|
|
|
find_package(ECM ${ECM_VERSION} NO_MODULE)
|
2018-04-12 22:55:24 +02:00
|
|
|
if( ECM_FOUND AND BUILD_TESTING )
|
2018-04-12 22:05:02 +02:00
|
|
|
include( ECMAddTests )
|
2018-04-12 22:55:24 +02:00
|
|
|
find_package( Qt5 COMPONENTS Core Test REQUIRED )
|
2018-04-12 22:05:02 +02:00
|
|
|
endif()
|
|
|
|
|
2014-07-03 18:00:40 +02:00
|
|
|
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
|
|
|
|
2018-04-16 10:32:49 +02:00
|
|
|
set( geoip_src GeoIP.cpp GeoIPJSON.cpp )
|
2018-04-12 18:18:43 +02:00
|
|
|
set( geoip_libs )
|
|
|
|
|
|
|
|
find_package(Qt5 COMPONENTS Xml)
|
|
|
|
if( Qt5Xml_FOUND )
|
|
|
|
list( APPEND geoip_src GeoIPXML.cpp )
|
|
|
|
list( APPEND geoip_libs Qt5::Xml )
|
2018-04-12 20:37:38 +02:00
|
|
|
add_definitions( -DHAVE_XML )
|
2018-04-12 18:18:43 +02:00
|
|
|
endif()
|
|
|
|
|
2014-07-02 17:59:24 +02:00
|
|
|
calamares_add_plugin( locale
|
|
|
|
TYPE viewmodule
|
|
|
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
|
|
|
SOURCES
|
2018-04-12 18:18:43 +02:00
|
|
|
${geoip_src}
|
2014-11-25 17:40:38 +01:00
|
|
|
LCLocaleDialog.cpp
|
2016-08-10 11:40:22 +02:00
|
|
|
LocaleConfiguration.cpp
|
2014-07-02 17:59:24 +02:00
|
|
|
LocalePage.cpp
|
2016-08-10 11:40:22 +02:00
|
|
|
LocaleViewStep.cpp
|
2014-08-01 16:29:19 +02:00
|
|
|
SetTimezoneJob.cpp
|
2014-07-02 17:59:24 +02:00
|
|
|
timezonewidget/timezonewidget.cpp
|
|
|
|
timezonewidget/localeglobal.cpp
|
|
|
|
UI
|
2014-08-26 15:18:30 +02:00
|
|
|
RESOURCES
|
|
|
|
locale.qrc
|
2016-12-07 16:37:29 +01:00
|
|
|
LINK_PRIVATE_LIBRARIES
|
2014-07-03 18:00:40 +02:00
|
|
|
calamaresui
|
2016-12-07 16:37:29 +01:00
|
|
|
Qt5::Network
|
2018-04-12 18:18:43 +02:00
|
|
|
${geoip_libs}
|
2017-09-13 18:49:43 +02:00
|
|
|
${YAMLCPP_LIBRARY}
|
2014-07-02 17:59:24 +02:00
|
|
|
SHARED_LIB
|
|
|
|
)
|
2018-04-12 22:05:02 +02:00
|
|
|
|
2018-04-12 22:55:24 +02:00
|
|
|
if( ECM_FOUND AND BUILD_TESTING )
|
2018-04-12 22:05:02 +02:00
|
|
|
ecm_add_test(
|
|
|
|
GeoIPTests.cpp
|
|
|
|
${geoip_src}
|
|
|
|
TEST_NAME
|
|
|
|
geoiptest
|
|
|
|
LINK_LIBRARIES
|
|
|
|
calamaresui
|
|
|
|
Qt5::Network
|
|
|
|
Qt5::Test
|
|
|
|
${geoip_libs}
|
|
|
|
${YAMLCPP_LIBRARY}
|
|
|
|
)
|
|
|
|
set_target_properties( geoiptest PROPERTIES AUTOMOC TRUE )
|
|
|
|
endif()
|
2018-04-12 22:55:24 +02:00
|
|
|
|
|
|
|
if( BUILD_TESTING )
|
|
|
|
add_executable( test_geoip test_geoip.cpp ${geoip_src} )
|
|
|
|
target_link_libraries( test_geoip calamaresui Qt5::Network ${geoip_libs} ${YAMLCPP_LIBRARY} )
|
|
|
|
endif()
|