Refactored calamares_bin into calamares_bin and libcalamaresui.
Now linking with -Wl,--no-undefined! Moved find_package KF5 from the root CMakeLists.txt to the partitioning module where it belongs. KF5 deps should be limited to plugins. Lots of random fixage to make stuff link. Removed CalamaresApplication reference from Settings. Removed the use of AbstractPage, we don't need it right now.
This commit is contained in:
parent
1efb4f1101
commit
4ec72f4afb
@ -1,7 +1,7 @@
|
|||||||
project( calamares )
|
project( calamares )
|
||||||
cmake_minimum_required( VERSION 2.8.12 )
|
cmake_minimum_required( VERSION 2.8.12 )
|
||||||
set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )
|
set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )
|
||||||
#set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wl,--no-undefined" )
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wl,--no-undefined" )
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wl,--fatal-warnings -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type" )
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wl,--fatal-warnings -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type" )
|
||||||
|
|
||||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||||
@ -19,7 +19,6 @@ cmake_policy( SET CMP0043 OLD )
|
|||||||
|
|
||||||
find_package( Qt5 5.3.0 CONFIG REQUIRED Core Gui Widgets LinguistTools )
|
find_package( Qt5 5.3.0 CONFIG REQUIRED Core Gui Widgets LinguistTools )
|
||||||
find_package( YamlCpp 0.5.1 REQUIRED )
|
find_package( YamlCpp 0.5.1 REQUIRED )
|
||||||
find_package( KF5 CONFIG REQUIRED CoreAddons )
|
|
||||||
|
|
||||||
###
|
###
|
||||||
### Calamares application info
|
### Calamares application info
|
||||||
|
@ -10,13 +10,13 @@ function(calamares_add_library)
|
|||||||
set(LIBRARY_NAME ${NAME})
|
set(LIBRARY_NAME ${NAME})
|
||||||
|
|
||||||
|
|
||||||
# message("*** Arguments for ${LIBRARY_NAME}")
|
message("*** Arguments for ${LIBRARY_NAME}")
|
||||||
# message("Sources: ${LIBRARY_SOURCES}")
|
message("Sources: ${LIBRARY_SOURCES}")
|
||||||
# message("Link libraries: ${LIBRARY_LINK_LIBRARIES}")
|
message("Link libraries: ${LIBRARY_LINK_LIBRARIES}")
|
||||||
# message("UI: ${LIBRARY_UI}")
|
message("UI: ${LIBRARY_UI}")
|
||||||
# message("TARGET_TYPE: ${LIBRARY_TARGET_TYPE}")
|
message("TARGET_TYPE: ${LIBRARY_TARGET_TYPE}")
|
||||||
# message("EXPORT_MACRO: ${LIBRARY_EXPORT_MACRO}")
|
message("EXPORT_MACRO: ${LIBRARY_EXPORT_MACRO}")
|
||||||
# message("NO_INSTALL: ${LIBRARY_NO_INSTALL}")
|
message("NO_INSTALL: ${LIBRARY_NO_INSTALL}")
|
||||||
|
|
||||||
set(target ${LIBRARY_NAME})
|
set(target ${LIBRARY_NAME})
|
||||||
|
|
||||||
|
@ -8,12 +8,13 @@ include_directories( ${CMAKE_CURRENT_LIST_DIR} )
|
|||||||
|
|
||||||
# library
|
# library
|
||||||
add_subdirectory( libcalamares )
|
add_subdirectory( libcalamares )
|
||||||
|
add_subdirectory( libcalamaresui )
|
||||||
|
|
||||||
# application
|
# application
|
||||||
add_subdirectory( calamares )
|
add_subdirectory( calamares )
|
||||||
|
|
||||||
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/calamares )
|
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/libcalamaresui )
|
||||||
include_directories( ${CMAKE_CURRENT_LIST_DIR}/calamares )
|
include_directories( ${CMAKE_CURRENT_LIST_DIR}/libcalamaresui )
|
||||||
|
|
||||||
# plugins
|
# plugins
|
||||||
add_subdirectory( modules )
|
add_subdirectory( modules )
|
||||||
|
@ -10,13 +10,6 @@ set( calamaresSources
|
|||||||
main.cpp
|
main.cpp
|
||||||
CalamaresApplication.cpp
|
CalamaresApplication.cpp
|
||||||
CalamaresWindow.cpp
|
CalamaresWindow.cpp
|
||||||
Settings.cpp
|
|
||||||
ViewManager.cpp
|
|
||||||
YamlUtils.cpp
|
|
||||||
|
|
||||||
modulesystem/Module.cpp
|
|
||||||
modulesystem/ModuleManager.cpp
|
|
||||||
modulesystem/ViewModule.cpp
|
|
||||||
|
|
||||||
progresstree/CategoryItem.cpp
|
progresstree/CategoryItem.cpp
|
||||||
progresstree/ProgressTreeDelegate.cpp
|
progresstree/ProgressTreeDelegate.cpp
|
||||||
@ -24,11 +17,6 @@ set( calamaresSources
|
|||||||
progresstree/ProgressTreeModel.cpp
|
progresstree/ProgressTreeModel.cpp
|
||||||
progresstree/ProgressTreeView.cpp
|
progresstree/ProgressTreeView.cpp
|
||||||
progresstree/ViewStepItem.cpp
|
progresstree/ViewStepItem.cpp
|
||||||
|
|
||||||
utils/CalamaresUtilsGui.cpp
|
|
||||||
|
|
||||||
viewpages/ViewStep.cpp
|
|
||||||
viewpages/AbstractPage.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set( calamaresUi
|
set( calamaresUi
|
||||||
@ -41,6 +29,7 @@ include_directories(
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}/../libcalamares
|
${CMAKE_CURRENT_BINARY_DIR}/../libcalamares
|
||||||
|
|
||||||
../libcalamares
|
../libcalamares
|
||||||
|
../libcalamaresui
|
||||||
)
|
)
|
||||||
|
|
||||||
include( GNUInstallDirs )
|
include( GNUInstallDirs )
|
||||||
@ -68,6 +57,7 @@ qt5_use_modules( calamares_bin Core Widgets )
|
|||||||
target_link_libraries( calamares_bin
|
target_link_libraries( calamares_bin
|
||||||
${LINK_LIBRARIES}
|
${LINK_LIBRARIES}
|
||||||
${CALAMARES_LIBRARIES}
|
${CALAMARES_LIBRARIES}
|
||||||
|
calamaresui
|
||||||
Qt5::Core
|
Qt5::Core
|
||||||
Qt5::Widgets
|
Qt5::Widgets
|
||||||
yaml-cpp
|
yaml-cpp
|
||||||
|
@ -20,12 +20,13 @@
|
|||||||
|
|
||||||
#include "CalamaresWindow.h"
|
#include "CalamaresWindow.h"
|
||||||
#include "CalamaresVersion.h"
|
#include "CalamaresVersion.h"
|
||||||
#include "modulesystem/ModuleManager.h"
|
|
||||||
#include "progresstree/ProgressTreeView.h"
|
#include "progresstree/ProgressTreeView.h"
|
||||||
#include "progresstree/ProgressTreeModel.h"
|
#include "progresstree/ProgressTreeModel.h"
|
||||||
#include "Settings.h"
|
|
||||||
|
#include "modulesystem/ModuleManager.h"
|
||||||
#include "utils/CalamaresUtils.h"
|
#include "utils/CalamaresUtils.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
#include "Settings.h"
|
||||||
#include "ViewManager.h"
|
#include "ViewManager.h"
|
||||||
|
|
||||||
|
|
||||||
@ -108,7 +109,7 @@ CalamaresApplication::mainWindow()
|
|||||||
void
|
void
|
||||||
CalamaresApplication::initSettings()
|
CalamaresApplication::initSettings()
|
||||||
{
|
{
|
||||||
new Calamares::Settings( this );
|
new Calamares::Settings( isDebug(), this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include "../CalamaresWindow.h"
|
#include "../CalamaresWindow.h"
|
||||||
#include "ViewStepItem.h"
|
#include "ViewStepItem.h"
|
||||||
#include "ProgressTreeModel.h"
|
#include "ProgressTreeModel.h"
|
||||||
#include "../ViewManager.h"
|
#include "ViewManager.h"
|
||||||
|
|
||||||
#include <QAbstractItemView>
|
#include <QAbstractItemView>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
@ -20,22 +20,33 @@
|
|||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
JobQueue* JobQueue::s_instance = nullptr;
|
JobQueue* JobQueue::s_instance = nullptr;
|
||||||
|
|
||||||
|
|
||||||
JobQueue*
|
JobQueue*
|
||||||
JobQueue::instance()
|
JobQueue::instance()
|
||||||
{
|
{
|
||||||
return s_instance;
|
return s_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
JobQueue::JobQueue( QObject* parent )
|
JobQueue::JobQueue( QObject* parent )
|
||||||
: QObject( parent )
|
: QObject( parent )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
JobQueue::enqueue( const Calamares::job_ptr& job )
|
JobQueue::enqueue( const Calamares::job_ptr& job )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
JobQueue::enqueue( const QList< job_ptr >& jobs )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Calamares
|
} // namespace Calamares
|
||||||
|
30
src/libcalamaresui/CMakeLists.txt
Normal file
30
src/libcalamaresui/CMakeLists.txt
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
set( CALAMARESUI_LIBRARY_TARGET calamaresui )
|
||||||
|
|
||||||
|
list( APPEND ${CALAMARESUI_LIBRARY_TARGET}_SOURCES
|
||||||
|
modulesystem/Module.cpp
|
||||||
|
modulesystem/ModuleManager.cpp
|
||||||
|
modulesystem/ViewModule.cpp
|
||||||
|
|
||||||
|
utils/CalamaresUtilsGui.cpp
|
||||||
|
utils/YamlUtils.cpp
|
||||||
|
|
||||||
|
viewpages/AbstractPage.cpp
|
||||||
|
viewpages/ViewStep.cpp
|
||||||
|
|
||||||
|
Settings.cpp
|
||||||
|
ViewManager.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
list( APPEND ${CALAMARESUI_LIBRARY_TARGET}_UI
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
calamares_add_library( ${CALAMARESUI_LIBRARY_TARGET}
|
||||||
|
SOURCES ${${CALAMARESUI_LIBRARY_TARGET}_SOURCES}
|
||||||
|
UI ${${CALAMARESUI_LIBRARY_TARGET}_UI}
|
||||||
|
EXPORT_MACRO UIDLLEXPORT_PRO
|
||||||
|
LINK_LIBRARIES
|
||||||
|
yaml-cpp
|
||||||
|
EXPORT CalamaresLibraryDepends
|
||||||
|
VERSION ${CALAMARES_VERSION_SHORT}
|
||||||
|
)
|
@ -18,10 +18,9 @@
|
|||||||
|
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
#include "CalamaresApplication.h"
|
|
||||||
#include "utils/CalamaresUtils.h"
|
#include "utils/CalamaresUtils.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "YamlUtils.h"
|
#include "utils/YamlUtils.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@ -41,11 +40,11 @@ Settings::instance()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Settings::Settings( QObject* parent )
|
Settings::Settings( bool debugMode, QObject* parent )
|
||||||
: QObject( parent )
|
: QObject( parent )
|
||||||
{
|
{
|
||||||
QFileInfo settingsFile( CalamaresUtils::appDataDir().absoluteFilePath( "settings.conf" ) );
|
QFileInfo settingsFile( CalamaresUtils::appDataDir().absoluteFilePath( "settings.conf" ) );
|
||||||
if ( APP->isDebug() )
|
if ( debugMode )
|
||||||
{
|
{
|
||||||
QFileInfo localFile( QDir( QDir::currentPath() ).absoluteFilePath( "settings.conf" ) );
|
QFileInfo localFile( QDir( QDir::currentPath() ).absoluteFilePath( "settings.conf" ) );
|
||||||
if ( localFile.exists() && localFile.isReadable() )
|
if ( localFile.exists() && localFile.isReadable() )
|
||||||
@ -72,7 +71,7 @@ Settings::Settings( QObject* parent )
|
|||||||
// If we're running in debug mode, we assume we might also be
|
// If we're running in debug mode, we assume we might also be
|
||||||
// running from the build dir, so we add a maximum priority
|
// running from the build dir, so we add a maximum priority
|
||||||
// module search path in the build dir.
|
// module search path in the build dir.
|
||||||
if ( APP->isDebug() )
|
if ( debugMode )
|
||||||
{
|
{
|
||||||
QString buildDirModules = QDir::current().absolutePath() +
|
QString buildDirModules = QDir::current().absolutePath() +
|
||||||
QDir::separator() + "src" +
|
QDir::separator() + "src" +
|
@ -19,6 +19,8 @@
|
|||||||
#ifndef SETTINGS_H
|
#ifndef SETTINGS_H
|
||||||
#define SETTINGS_H
|
#define SETTINGS_H
|
||||||
|
|
||||||
|
#include "UiDllMacro.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
@ -26,11 +28,11 @@
|
|||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
|
|
||||||
class Settings : public QObject
|
class UIDLLEXPORT Settings : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Settings( QObject *parent = nullptr );
|
explicit Settings( bool debugMode, QObject *parent = nullptr );
|
||||||
|
|
||||||
static Settings* instance();
|
static Settings* instance();
|
||||||
//TODO: load from JSON then emit ready
|
//TODO: load from JSON then emit ready
|
@ -19,7 +19,7 @@
|
|||||||
#include "Module.h"
|
#include "Module.h"
|
||||||
|
|
||||||
#include "ViewModule.h"
|
#include "ViewModule.h"
|
||||||
#include "YamlUtils.h"
|
#include "utils/YamlUtils.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
#include <yaml-cpp/yaml.h>
|
@ -1,4 +1,4 @@
|
|||||||
include_directories( ${PROJECT_BINARY_DIR}/src/calamares )
|
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
||||||
calamares_add_plugin( greeting
|
calamares_add_plugin( greeting
|
||||||
TYPE viewmodule
|
TYPE viewmodule
|
||||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||||
@ -9,5 +9,7 @@ calamares_add_plugin( greeting
|
|||||||
UI
|
UI
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
${CALAMARES_LIBRARIES}
|
${CALAMARES_LIBRARIES}
|
||||||
|
calamaresui
|
||||||
|
${CALAMARESUI_LIBRARIES}
|
||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
include_directories( ${PROJECT_BINARY_DIR}/src/calamares )
|
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
||||||
|
|
||||||
calamares_add_plugin( locale
|
calamares_add_plugin( locale
|
||||||
TYPE viewmodule
|
TYPE viewmodule
|
||||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||||
@ -11,6 +12,6 @@ calamares_add_plugin( locale
|
|||||||
timezonewidget/localeglobal.cpp
|
timezonewidget/localeglobal.cpp
|
||||||
UI
|
UI
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
${CALAMARES_LIBRARIES}
|
calamaresui
|
||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
if( WITH_PARTITIONMANAGER )
|
if( WITH_PARTITIONMANAGER )
|
||||||
|
|
||||||
|
find_package( KF5 CONFIG REQUIRED CoreAddons )
|
||||||
|
|
||||||
add_definitions( -DCALAMARES )
|
add_definitions( -DCALAMARES )
|
||||||
|
|
||||||
include_directories( ${PROJECT_BINARY_DIR}/src/calamares )
|
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
||||||
calamares_add_plugin( partition
|
calamares_add_plugin( partition
|
||||||
TYPE viewmodule
|
TYPE viewmodule
|
||||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||||
@ -22,7 +24,7 @@ calamares_add_plugin( partition
|
|||||||
PartitionPage.ui
|
PartitionPage.ui
|
||||||
LINK_LIBRARIES
|
LINK_LIBRARIES
|
||||||
calapm
|
calapm
|
||||||
${CALAMARES_LIBRARIES}
|
calamaresui
|
||||||
KF5::CoreAddons
|
KF5::CoreAddons
|
||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
@ -37,7 +39,6 @@ set( partview_SRCS
|
|||||||
PartitionModel.cpp
|
PartitionModel.cpp
|
||||||
PartitionPage.cpp
|
PartitionPage.cpp
|
||||||
PMUtils.cpp
|
PMUtils.cpp
|
||||||
${calamares_SOURCE_DIR}/viewpages/AbstractPage.cpp
|
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
qt5_wrap_ui( partview_SRCS
|
qt5_wrap_ui( partview_SRCS
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
PartitionPage::PartitionPage( PartitionCoreModule* core, QWidget* parent )
|
PartitionPage::PartitionPage( PartitionCoreModule* core, QWidget* parent )
|
||||||
: Calamares::AbstractPage( parent )
|
: QWidget( parent )
|
||||||
, m_ui( new Ui_PartitionPage )
|
, m_ui( new Ui_PartitionPage )
|
||||||
, m_core( core )
|
, m_core( core )
|
||||||
{
|
{
|
||||||
|
@ -19,8 +19,7 @@
|
|||||||
#ifndef PARTITIONPAGE_H
|
#ifndef PARTITIONPAGE_H
|
||||||
#define PARTITIONPAGE_H
|
#define PARTITIONPAGE_H
|
||||||
|
|
||||||
#include "viewpages/AbstractPage.h"
|
#include <QWidget>
|
||||||
|
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
|
|
||||||
class PartitionCoreModule;
|
class PartitionCoreModule;
|
||||||
@ -28,7 +27,7 @@ class Ui_PartitionPage;
|
|||||||
|
|
||||||
class DeviceModel;
|
class DeviceModel;
|
||||||
|
|
||||||
class PartitionPage : public Calamares::AbstractPage
|
class PartitionPage : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user