project( weather )
cmake_minimum_required( VERSION 3.16 )

set( PROJECT_VERSION 5.0.0 )
set( PROJECT_VERSION_MAJOR 5 )
set( PROJECT_VERSION_MINOR 0 )
set( PROJECT_VERSION_PATCH 0 )

set( PROJECT_VERSION_MAJOR_MINOR ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} )
add_compile_definitions(VERSION_TEXT="${PROJECT_VERSION}")

set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_INCLUDE_CURRENT_DIR ON )
set( CMAKE_BUILD_TYPE Release )

add_definitions ( -Wall )
if ( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
    set( CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Location for installing the project" FORCE )
endif()

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

find_package( Qt6Core REQUIRED )
find_package( Qt6Gui REQUIRED )
find_package( Qt6Widgets REQUIRED )
find_package( Qt6Network REQUIRED )
find_package( Qt6Svg REQUIRED )

set( weather_HDRS
	weatherdata.h
	weathericon.h
)

set( weather_SRCS
	apirequest.cpp
	astroinfo.cpp
	locationinfo.cpp
	weatherdata.cpp
	weathericon.cpp
	weatherinfo.cpp
	weatherview.cpp
)

set( weather_MOCS
	apirequest.h
	astroinfo.h
	locationinfo.h
	weatherinfo.h
	weatherview.h
)

set( weather_UIS
	weatherview.ui
)

add_library( weather MODULE ${weather_SRCS} ${weather_MOCS} ${weather_UIS}  )
target_link_libraries( weather  Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Network Qt6::Svg  cprime-widgets cprime-core csys )

install( TARGETS weather LIBRARY DESTINATION lib/coreapps/plugins )
