work in process

This commit is contained in:
Yuri Kozyrev 2022-07-12 19:55:20 +04:00
parent e407f5dc16
commit c80b0ed367
7 changed files with 74 additions and 38 deletions

View File

@ -1,6 +1,11 @@
cmake_minimum_required(VERSION 3.14)
project(new_alterator LANGUAGES CXX)
project(new_alterator
LANGUAGES CXX
VERSION 0.1
DESCRIPTION "Front end of new alterator")
set(CMAKE_DEBUG_POSTFIX d)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@ -14,50 +19,48 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Quick QuickWidgets DBus #[[QmlTypes]])
project(new_alterator
LANGUAGES CXX
VERSION 0.1
DESCRIPTION "Front end of new alterator")
set(SOURCES
${CMAKE_SOURCE_DIR}/src/alterator_loader.cpp
${CMAKE_SOURCE_DIR}/src/dist_info.cpp
${CMAKE_SOURCE_DIR}/src/main.cpp
${CMAKE_SOURCE_DIR}/src/dbus_connector.cpp)
set(SOURCES
${CMAKE_SOURCE_DIR}/src/alterator_loader.cpp
${CMAKE_SOURCE_DIR}/src/dist_info.cpp
${CMAKE_SOURCE_DIR}/src/main.cpp
${CMAKE_SOURCE_DIR}/src/dbus_connector.cpp)
set(HEADERS
${CMAKE_SOURCE_DIR}/include/alterator_loader.h
${CMAKE_SOURCE_DIR}/include/dist_info.h
${CMAKE_SOURCE_DIR}/include/dbus_connector.h)
set(HEADERS
${CMAKE_SOURCE_DIR}/include/alterator_loader.h
${CMAKE_SOURCE_DIR}/include/dist_info.h
${CMAKE_SOURCE_DIR}/include/dbus_connector.h)
set(RESOURCES
${CMAKE_SOURCE_DIR}/resources/wiki_logo.svg
${CMAKE_SOURCE_DIR}/resources/DistInfo.qml
${CMAKE_SOURCE_DIR}/resources/Test.qml
${CMAKE_SOURCE_DIR}/resources/resources.qrc)
set(RESOURCES
${CMAKE_SOURCE_DIR}/resources/wiki_logo.svg
${CMAKE_SOURCE_DIR}/resources/DistInfo.qml
${CMAKE_SOURCE_DIR}/resources/Test.qml
${CMAKE_SOURCE_DIR}/resources/resources.qrc)
set(SHARED
${CMAKE_SOURCE_DIR}/shared/AlteratorWindow.qml
${CMAKE_SOURCE_DIR}/shared/AlteratorToolBar.qml
${CMAKE_SOURCE_DIR}/shared/TextWithHeader.qml
${CMAKE_SOURCE_DIR}/shared/shared.qrc
${CMAKE_SOURCE_DIR}/shared/qmldir)
set(SHARED
${CMAKE_SOURCE_DIR}/shared/AlteratorWindow.qml
${CMAKE_SOURCE_DIR}/shared/AlteratorToolBar.qml
${CMAKE_SOURCE_DIR}/shared/TextWithHeader.qml
${CMAKE_SOURCE_DIR}/shared/shared.qrc
${CMAKE_SOURCE_DIR}/shared/qmldir)
add_executable(new_alterator
${CMAKE_SOURCE_DIR}/shared/shared.qrc
${CMAKE_SOURCE_DIR}/resources/resources.qrc
${CMAKE_SOURCE_DIR}/src/dist_info.cpp
${CMAKE_SOURCE_DIR}/include/dist_info.h
${CMAKE_SOURCE_DIR}/src/main.cpp)
add_executable(new_alterator
${CMAKE_SOURCE_DIR}/shared/shared.qrc
${CMAKE_SOURCE_DIR}/resources/resources.qrc
${HEADERS}
${SOURCES}
)
add_subdirectory(alterator)
#add_library(new_alterator_lib SHARED ${SHARED})
target_include_directories(new_alterator PUBLIC
"${PROJECT_BINARY_DIR}")
#target_link_libraries(new_alterator new_alterator_lib)
set_target_properties(new_alterator PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
target_link_libraries(new_alterator Alterator)
target_link_libraries(new_alterator
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Quick
Qt${QT_VERSION_MAJOR}::QuickWidgets
Qt${QT_VERSION_MAJOR}::DBus
# Qt${QT_VERSION_MAJOR}::QmlTypes
)
Qt${QT_VERSION_MAJOR}::DBus)

32
alterator/CMakeLists.txt Normal file
View File

@ -0,0 +1,32 @@
cmake_minimum_required(VERSION 3.14)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Quick QuickWidgets DBus #[[QmlTypes]])
add_library(Alterator
${CMAKE_SOURCE_DIR}/alterator/src/alterator_loader.cpp
${CMAKE_SOURCE_DIR}/alterator/include/alterator_loader.h
${CMAKE_SOURCE_DIR}/alterator/src/dbus_connector.cpp
${CMAKE_SOURCE_DIR}/alterator/include/dbus_connector.h)
target_include_directories(Alterator
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
)
target_link_libraries(Alterator
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Quick
Qt${QT_VERSION_MAJOR}::QuickWidgets
Qt${QT_VERSION_MAJOR}::DBus
# Qt${QT_VERSION_MAJOR}::QmlTypes
)

View File

@ -1,5 +1,5 @@
#include "../include/alterator_loader.h"
#include "../include/dist_info.h"
#include "../../include/dist_info.h"
#include "../include/dbus_connector.h"
#include <QQmlComponent>
#include <QQmlApplicationEngine>

View File

@ -1,7 +1,8 @@
#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include "../../new_alterator/include/alterator_loader.h"
#include <alterator/include/alterator_loader.h>
#include <alterator/include/dbus_connector.h>
int main(int argc, char *argv[])
{