Warning, /rolisteam/rolisteam/src/libraries/common/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16)
0002 
0003 project(common VERSION 1.0.0 DESCRIPTION "Common Elements")
0004 
0005 set(CMAKE_INCLUDE_CURRENT_DIR ON)
0006 
0007 set(CMAKE_AUTOMOC ON)
0008 set(CMAKE_AUTOUIC ON)
0009 set(CMAKE_AUTORCC ON)
0010 
0011 set(CMAKE_CXX_STANDARD 17)
0012 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0013 
0014 # Add a compiler flag
0015 #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
0016 
0017 set(QT_REQUIRED_VERSION "6.3.0")
0018 set(QT_VERSION_MAJOR "6")
0019 find_package(Qt${QT_VERSION_MAJOR} ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Core Widgets Network Qml Gui)
0020 
0021 
0022 set(common_core_public_headers include/common/common_global.h
0023     include/common/remotelogcontroller.h
0024     include/common/logcontroller.h
0025     include/common/common_types.h
0026     include/common/logcategory.h
0027     include/common/uploadlogtoserver.h)
0028 
0029 set(common_core_src
0030   task/uploadlogtoserver.cpp
0031   controller/remotelogcontroller.cpp
0032   controller/logcontroller.cpp
0033 )
0034 
0035 
0036 
0037 add_library(common_core SHARED ${common_core_src} ${common_core_public_headers})
0038 target_compile_definitions(common_core PRIVATE COMMON_LIBRARY)
0039 set_target_properties(common_core PROPERTIES PUBLIC_HEADER "${common_core_public_headers}")
0040 target_link_libraries(common_core PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network)
0041 target_include_directories(common_core
0042     PRIVATE
0043         ${CMAKE_CURRENT_SOURCE_DIR}/task
0044         ${CMAKE_CURRENT_SOURCE_DIR}/controller
0045     PUBLIC
0046         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
0047         $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
0048 )
0049 
0050 #===========================================================
0051 
0052 set(common_widget_public_header
0053 include/common_widgets/logpanel.h
0054 include/common_widgets/colorbutton.h
0055 include/common_widgets/common_widgets_global.h
0056 include/common_widgets/busyindicatordialog.h
0057 )
0058 set(common_widget_src
0059 widgets/logpanel.cpp
0060 widgets/colorbutton.cpp
0061 widgets/busyindicatordialog.cpp
0062 )
0063 
0064 add_library(common_widget SHARED ${common_widget_public_header} ${common_widget_src})
0065 target_compile_definitions(common_widget PRIVATE COMMON_WIDGET_LIBRARY)
0066 set_target_properties(common_widget PROPERTIES PUBLIC_HEADER "${common_widget_public_header}")
0067 target_link_libraries(common_widget PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets common_core)
0068 target_include_directories(common_widget
0069     PRIVATE
0070         ${CMAKE_CURRENT_SOURCE_DIR}/widgets
0071     PUBLIC
0072         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
0073         $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
0074 )
0075 
0076 
0077 #===========================================================
0078 
0079 set(common_qml_public_header include/common_qml/common_qml_global.h include/common_qml/theme.h)
0080 set(common_qml_src controller/theme.cpp)
0081 
0082 add_library(common_qml SHARED ${common_qml_public_header} ${common_qml_src})
0083 target_compile_definitions(common_qml PRIVATE COMMON_QML_LIBRARY)
0084 set_target_properties(common_qml PROPERTIES PUBLIC_HEADER "${common_qml_public_header}")
0085 target_link_libraries(common_qml PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Qml Qt${QT_VERSION_MAJOR}::Gui)
0086 target_include_directories(common_qml
0087     PRIVATE
0088         ${CMAKE_CURRENT_SOURCE_DIR}/controller
0089     PUBLIC
0090         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
0091         $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
0092 )
0093 
0094 include(install_helper)
0095 rinstallLib(common_qml libraries)
0096 rinstallLib(common_widget libraries)
0097 rinstallLib(common_core libraries)