[libcalamares] [locale] Adjust CMakeLists to moved code

main
Adriaan de Groot 6 years ago
parent 7ec7278fd3
commit 9ed46fc275

@ -69,7 +69,20 @@ if( WITH_PYTHON )
)
endif()
add_library( calamares SHARED ${libSources} ${kdsagSources} ${utilsSources} )
set( geoipSources
geoip/GeoIP.cpp
geoip/GeoIPJSON.cpp
)
set( geoip_libs )
find_package(Qt5 COMPONENTS Xml)
if( Qt5Xml_FOUND )
list( APPEND geoipSources geoip/GeoIPXML.cpp )
list( APPEND geoip_libs Qt5::Network Qt5::Xml )
add_definitions( -DHAVE_XML )
endif()
add_library( calamares SHARED ${libSources} ${kdsagSources} ${utilsSources} ${geoipSources} )
set_target_properties( calamares
PROPERTIES
VERSION ${CALAMARES_VERSION_SHORT}
@ -82,6 +95,7 @@ target_link_libraries( calamares
${OPTIONAL_PRIVATE_LIBRARIES}
LINK_PUBLIC
${YAMLCPP_LIBRARY}
${geoip_libs}
Qt5::Core
)
@ -103,6 +117,24 @@ if ( ECM_FOUND AND BUILD_TESTING )
Qt5::Test
)
calamares_automoc( libcalamarestest )
ecm_add_test(
geoip/GeoIPTests.cpp
${geoip_src}
TEST_NAME
geoiptest
LINK_LIBRARIES
calamares
Qt5::Test
${YAMLCPP_LIBRARY}
)
calamares_automoc( geoiptest )
endif()
if( BUILD_TESTING )
add_executable( test_geoip geoip/test_geoip.cpp ${geoip_src} )
target_link_libraries( test_geoip calamares Qt5::Network ${YAMLCPP_LIBRARY} )
calamares_automoc( test_geoip )
endif()
# Make symlink lib/calamares/libcalamares.so to lib/libcalamares.so.VERSION so

@ -8,16 +8,6 @@ endif()
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
set( geoip_src GeoIP.cpp GeoIPJSON.cpp )
set( geoip_libs )
find_package(Qt5 COMPONENTS Xml)
if( Qt5Xml_FOUND )
list( APPEND geoip_src GeoIPXML.cpp )
list( APPEND geoip_libs Qt5::Xml )
add_definitions( -DHAVE_XML )
endif()
calamares_add_plugin( locale
TYPE viewmodule
EXPORT_MACRO PLUGINDLLEXPORT_PRO
@ -42,20 +32,6 @@ calamares_add_plugin( locale
)
if( ECM_FOUND AND BUILD_TESTING )
ecm_add_test(
GeoIPTests.cpp
${geoip_src}
TEST_NAME
geoiptest
LINK_LIBRARIES
calamaresui
Qt5::Network
Qt5::Test
${geoip_libs}
${YAMLCPP_LIBRARY}
)
calamares_automoc( geoiptest )
ecm_add_test(
Tests.cpp
LocaleConfiguration.cpp
@ -67,9 +43,3 @@ if( ECM_FOUND AND BUILD_TESTING )
)
calamares_automoc( localetest )
endif()
if( BUILD_TESTING )
add_executable( test_geoip test_geoip.cpp ${geoip_src} )
target_link_libraries( test_geoip calamaresui Qt5::Network ${geoip_libs} ${YAMLCPP_LIBRARY} )
calamares_automoc( test_geoip )
endif()

Loading…
Cancel
Save