Skip to content
Snippets Groups Projects
Commit 4ec72f4a authored by Teo Mrnjavac's avatar Teo Mrnjavac
Browse files

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.
parent 1efb4f11
No related branches found
No related tags found
No related merge requests found
Showing
with 68 additions and 35 deletions
project( calamares )
cmake_minimum_required( VERSION 2.8.12 )
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" )
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( YamlCpp 0.5.1 REQUIRED )
find_package( KF5 CONFIG REQUIRED CoreAddons )
###
### Calamares application info
......
......@@ -10,13 +10,13 @@ function(calamares_add_library)
set(LIBRARY_NAME ${NAME})
# message("*** Arguments for ${LIBRARY_NAME}")
# message("Sources: ${LIBRARY_SOURCES}")
# message("Link libraries: ${LIBRARY_LINK_LIBRARIES}")
# message("UI: ${LIBRARY_UI}")
# message("TARGET_TYPE: ${LIBRARY_TARGET_TYPE}")
# message("EXPORT_MACRO: ${LIBRARY_EXPORT_MACRO}")
# message("NO_INSTALL: ${LIBRARY_NO_INSTALL}")
message("*** Arguments for ${LIBRARY_NAME}")
message("Sources: ${LIBRARY_SOURCES}")
message("Link libraries: ${LIBRARY_LINK_LIBRARIES}")
message("UI: ${LIBRARY_UI}")
message("TARGET_TYPE: ${LIBRARY_TARGET_TYPE}")
message("EXPORT_MACRO: ${LIBRARY_EXPORT_MACRO}")
message("NO_INSTALL: ${LIBRARY_NO_INSTALL}")
set(target ${LIBRARY_NAME})
......
......@@ -8,12 +8,13 @@ include_directories( ${CMAKE_CURRENT_LIST_DIR} )
# library
add_subdirectory( libcalamares )
add_subdirectory( libcalamaresui )
# application
add_subdirectory( calamares )
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/calamares )
include_directories( ${CMAKE_CURRENT_LIST_DIR}/calamares )
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/libcalamaresui )
include_directories( ${CMAKE_CURRENT_LIST_DIR}/libcalamaresui )
# plugins
add_subdirectory( modules )
......@@ -10,13 +10,6 @@ set( calamaresSources
main.cpp
CalamaresApplication.cpp
CalamaresWindow.cpp
Settings.cpp
ViewManager.cpp
YamlUtils.cpp
modulesystem/Module.cpp
modulesystem/ModuleManager.cpp
modulesystem/ViewModule.cpp
progresstree/CategoryItem.cpp
progresstree/ProgressTreeDelegate.cpp
......@@ -24,11 +17,6 @@ set( calamaresSources
progresstree/ProgressTreeModel.cpp
progresstree/ProgressTreeView.cpp
progresstree/ViewStepItem.cpp
utils/CalamaresUtilsGui.cpp
viewpages/ViewStep.cpp
viewpages/AbstractPage.cpp
)
set( calamaresUi
......@@ -41,6 +29,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}/../libcalamares
../libcalamares
../libcalamaresui
)
include( GNUInstallDirs )
......@@ -68,6 +57,7 @@ qt5_use_modules( calamares_bin Core Widgets )
target_link_libraries( calamares_bin
${LINK_LIBRARIES}
${CALAMARES_LIBRARIES}
calamaresui
Qt5::Core
Qt5::Widgets
yaml-cpp
......
......@@ -20,12 +20,13 @@
#include "CalamaresWindow.h"
#include "CalamaresVersion.h"
#include "modulesystem/ModuleManager.h"
#include "progresstree/ProgressTreeView.h"
#include "progresstree/ProgressTreeModel.h"
#include "Settings.h"
#include "modulesystem/ModuleManager.h"
#include "utils/CalamaresUtils.h"
#include "utils/Logger.h"
#include "Settings.h"
#include "ViewManager.h"
......@@ -108,7 +109,7 @@ CalamaresApplication::mainWindow()
void
CalamaresApplication::initSettings()
{
new Calamares::Settings( this );
new Calamares::Settings( isDebug(), this );
}
......
......@@ -22,7 +22,7 @@
#include "../CalamaresWindow.h"
#include "ViewStepItem.h"
#include "ProgressTreeModel.h"
#include "../ViewManager.h"
#include "ViewManager.h"
#include <QAbstractItemView>
#include <QPainter>
......
......@@ -20,22 +20,33 @@
namespace Calamares
{
JobQueue* JobQueue::s_instance = nullptr;
JobQueue*
JobQueue::instance()
{
return s_instance;
}
JobQueue::JobQueue( QObject* parent )
: QObject( parent )
{
}
void
JobQueue::enqueue( const Calamares::job_ptr& job )
{
}
void
JobQueue::enqueue( const QList< job_ptr >& jobs )
{
}
} // namespace Calamares
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 "CalamaresApplication.h"
#include "utils/CalamaresUtils.h"
#include "utils/Logger.h"
#include "YamlUtils.h"
#include "utils/YamlUtils.h"
#include <QDir>
#include <QFile>
......@@ -41,11 +40,11 @@ Settings::instance()
}
Settings::Settings( QObject* parent )
Settings::Settings( bool debugMode, QObject* parent )
: QObject( parent )
{
QFileInfo settingsFile( CalamaresUtils::appDataDir().absoluteFilePath( "settings.conf" ) );
if ( APP->isDebug() )
if ( debugMode )
{
QFileInfo localFile( QDir( QDir::currentPath() ).absoluteFilePath( "settings.conf" ) );
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
// running from the build dir, so we add a maximum priority
// module search path in the build dir.
if ( APP->isDebug() )
if ( debugMode )
{
QString buildDirModules = QDir::current().absolutePath() +
QDir::separator() + "src" +
......
......@@ -19,6 +19,8 @@
#ifndef SETTINGS_H
#define SETTINGS_H
#include "UiDllMacro.h"
#include <QObject>
#include <QStringList>
......@@ -26,11 +28,11 @@
namespace Calamares
{
class Settings : public QObject
class UIDLLEXPORT Settings : public QObject
{
Q_OBJECT
public:
explicit Settings( QObject *parent = nullptr );
explicit Settings( bool debugMode, QObject *parent = nullptr );
static Settings* instance();
//TODO: load from JSON then emit ready
......
File moved
File moved
File moved
......@@ -19,7 +19,7 @@
#include "Module.h"
#include "ViewModule.h"
#include "YamlUtils.h"
#include "utils/YamlUtils.h"
#include "utils/Logger.h"
#include <yaml-cpp/yaml.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment