Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake #86

Merged
merged 5 commits into from
Jan 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions schnapps/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ project(schnapps_core
LANGUAGES CXX
)

# Hide symbols by default
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)

find_package(cgogn_core REQUIRED)
find_package(cgogn_rendering REQUIRED)
find_package(QOGLViewer REQUIRED)
Expand All @@ -11,7 +15,6 @@ add_library(schnapps::core ALIAS schnapps_core)

target_sources(${PROJECT_NAME}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/dll.h"
"${CMAKE_CURRENT_LIST_DIR}/schnapps_window.h"
"${CMAKE_CURRENT_LIST_DIR}/schnapps_window.cpp"
"${CMAKE_CURRENT_LIST_DIR}/schnapps_window_factory.h"
Expand Down Expand Up @@ -56,8 +59,6 @@ target_sources(${PROJECT_NAME}
"${SCHNAPPS_SOURCE_DIR}/schnapps/resources/resources.qrc"
)

target_compile_definitions(${PROJECT_NAME} PRIVATE "SCHNAPPS_CORE_DLL_EXPORT")

if (SCHNAPPS_ALIGNED_VEC3)
target_compile_definitions(${PROJECT_NAME} PUBLIC "SCHNAPPS_USE_ALIGNEDVEC3")
endif()
Expand All @@ -74,11 +75,14 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
EXPORT_NAME core)

target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${SCHNAPPS_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

# Write out schnapps_core_export.h to the current binary directory
generate_export_header(schnapps_core)

target_link_libraries(${PROJECT_NAME}
cgogn::core
cgogn::rendering
Expand All @@ -95,9 +99,15 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
# the trailing slash is IMPORTANT, see https://cmake.org/pipermail/cmake/2009-December/033850.html
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/schnapps/core
COMPONENT schnapps_core_headers
FILES_MATCHING PATTERN "*.h"
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/schnapps_core_export.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/schnapps/core
COMPONENT schnapps_core_headers
)

schnapps_create_package("${CMAKE_CURRENT_SOURCE_DIR}")

set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER core)
5 changes: 3 additions & 2 deletions schnapps/core/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#ifndef SCHNAPPS_CORE_CAMERA_H_
#define SCHNAPPS_CORE_CAMERA_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>

#include <schnapps/core/types.h>

#include <QOGLViewer/camera.h>
Expand All @@ -41,7 +42,7 @@ class View;
* A camera object is generated with each new view
* Cameras can be shared among views.
*/
class SCHNAPPS_CORE_API Camera : public qoglviewer::Camera
class SCHNAPPS_CORE_EXPORT Camera : public qoglviewer::Camera
{
Q_OBJECT

Expand Down
5 changes: 3 additions & 2 deletions schnapps/core/color_combo_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
#ifndef SCHNAPPS_CORE_COLOR_COMBO_BOX_H_
#define SCHNAPPS_CORE_COLOR_COMBO_BOX_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>

#include <QComboBox>

class QColor;
class QWidget;

class SCHNAPPS_CORE_API ColorComboBox : public QComboBox
class SCHNAPPS_CORE_EXPORT ColorComboBox : public QComboBox
{
Q_OBJECT
Q_PROPERTY(QColor color READ color WRITE setColor USER true)
Expand Down
5 changes: 3 additions & 2 deletions schnapps/core/control_dock_camera_tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#ifndef SCHNAPPS_CORE_CONTROL_DOCK_CAMERA_TAB_H_
#define SCHNAPPS_CORE_CONTROL_DOCK_CAMERA_TAB_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>


#include <ui_control_dock_camera_tab_widget.h>

Expand All @@ -38,7 +39,7 @@ class SCHNApps;
class Camera;
class View;

class SCHNAPPS_CORE_API ControlDock_CameraTab : public QWidget, public Ui::ControlDock_CameraTabWidget
class SCHNAPPS_CORE_EXPORT ControlDock_CameraTab : public QWidget, public Ui::ControlDock_CameraTabWidget
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion schnapps/core/control_dock_camera_tab_widget.ui
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<exportmacro>SCHNAPPS_CORE_API</exportmacro>
<exportmacro>SCHNAPPS_CORE_EXPORT</exportmacro>
<class>ControlDock_CameraTabWidget</class>
<widget class="QWidget" name="ControlDock_CameraTabWidget">
<property name="geometry">
Expand Down
5 changes: 3 additions & 2 deletions schnapps/core/control_dock_plugin_tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#ifndef SCHNAPPS_CORE_CONTROL_DOCK_PLUGIN_TAB_H_
#define SCHNAPPS_CORE_CONTROL_DOCK_PLUGIN_TAB_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>


#include <ui_control_dock_plugin_tab_widget.h>

Expand All @@ -37,7 +38,7 @@ namespace schnapps
class SCHNApps;
class Plugin;

class SCHNAPPS_CORE_API ControlDock_PluginTab : public QWidget, public Ui::ControlDock_PluginTabWidget
class SCHNAPPS_CORE_EXPORT ControlDock_PluginTab : public QWidget, public Ui::ControlDock_PluginTabWidget
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion schnapps/core/control_dock_plugin_tab_widget.ui
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<exportmacro>SCHNAPPS_CORE_API</exportmacro>
<exportmacro>SCHNAPPS_CORE_EXPORT</exportmacro>
<class>ControlDock_PluginTabWidget</class>
<widget class="QWidget" name="ControlDock_PluginTabWidget">
<property name="geometry">
Expand Down
42 changes: 0 additions & 42 deletions schnapps/core/dll.h

This file was deleted.

5 changes: 3 additions & 2 deletions schnapps/core/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#ifndef SCHNAPPS_CORE_OBJECT_H_
#define SCHNAPPS_CORE_OBJECT_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>

#include <schnapps/core/types.h>

#include <cgogn/rendering/drawer.h>
Expand All @@ -40,7 +41,7 @@ namespace schnapps
class View;
class PluginProvider;

class SCHNAPPS_CORE_API Object : public QObject
class SCHNAPPS_CORE_EXPORT Object : public QObject
{
Q_OBJECT

Expand Down
5 changes: 3 additions & 2 deletions schnapps/core/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#ifndef SCHNAPPS_CORE_PLUGIN_H_
#define SCHNAPPS_CORE_PLUGIN_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>

#include <schnapps/core/settings.h>

#include <QtPlugin>
Expand All @@ -34,7 +35,7 @@ namespace schnapps

class SCHNApps;

class SCHNAPPS_CORE_API Plugin : public QObject
class SCHNAPPS_CORE_EXPORT Plugin : public QObject
{
Q_OBJECT

Expand Down
5 changes: 3 additions & 2 deletions schnapps/core/plugin_interaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#ifndef SCHNAPPS_CORE_PLUGIN_INTERACTION_H_
#define SCHNAPPS_CORE_PLUGIN_INTERACTION_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>

#include <schnapps/core/plugin.h>

#include <QKeyEvent>
Expand All @@ -37,7 +38,7 @@ namespace schnapps
class View;
class Object;

class SCHNAPPS_CORE_API PluginInteraction : public Plugin
class SCHNAPPS_CORE_EXPORT PluginInteraction : public Plugin
{
Q_OBJECT

Expand Down
5 changes: 3 additions & 2 deletions schnapps/core/plugin_processing.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@
#ifndef SCHNAPPS_CORE_PLUGIN_PROCESSING_H_
#define SCHNAPPS_CORE_PLUGIN_PROCESSING_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>

#include <schnapps/core/plugin.h>

namespace schnapps
{

class Object;

class SCHNAPPS_CORE_API PluginProcessing : public Plugin
class SCHNAPPS_CORE_EXPORT PluginProcessing : public Plugin
{
Q_OBJECT

Expand Down
5 changes: 3 additions & 2 deletions schnapps/core/plugin_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#ifndef SCHNAPPS_CORE_PLUGIN_PROVIDER_H_
#define SCHNAPPS_CORE_PLUGIN_PROVIDER_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>

#include <schnapps/core/types.h>
#include <schnapps/core/plugin.h>

Expand All @@ -33,7 +34,7 @@ namespace schnapps

class Object;

class SCHNAPPS_CORE_API PluginProvider : public Plugin
class SCHNAPPS_CORE_EXPORT PluginProvider : public Plugin
{
Q_OBJECT

Expand Down
5 changes: 3 additions & 2 deletions schnapps/core/schnapps.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#ifndef SCHNAPPS_CORE_SCHNAPPS_H_
#define SCHNAPPS_CORE_SCHNAPPS_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>

#include <schnapps/core/settings.h>
#include <schnapps/core/status_bar_output.h>
#include <schnapps/core/plugin_provider.h>
Expand Down Expand Up @@ -52,7 +53,7 @@ class ControlDock_PluginTab;
/**
* @brief The SCHNApps central object application
*/
class SCHNAPPS_CORE_API SCHNApps : public QObject
class SCHNAPPS_CORE_EXPORT SCHNApps : public QObject
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion schnapps/core/schnapps.ui
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<exportmacro>SCHNAPPS_CORE_API</exportmacro>
<exportmacro>SCHNAPPS_CORE_EXPORT</exportmacro>
<class>SCHNAppsWindow</class>
<widget class="QMainWindow" name="SCHNAppsWindow">
<property name="geometry">
Expand Down
3 changes: 2 additions & 1 deletion schnapps/core/schnapps_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace schnapps
/**
* @brief generate a SCHNApps_window (no need of schnapps_window.h !)
*/
SCHNAPPS_CORE_API std::unique_ptr<QMainWindow> schnapps_window_factory(
SCHNAPPS_CORE_EXPORT std::unique_ptr<QMainWindow> schnapps_window_factory(
const QString& app_path,
const QString& settings_path,
const QString& init_plugin_name
Expand Down Expand Up @@ -63,6 +63,7 @@ SCHNAppsWindow::SCHNAppsWindow(
control_dock_tab_widget_->setLayoutDirection(Qt::LeftToRight);
control_dock_tab_widget_->setTabPosition(QTabWidget::North);
control_dock_tab_widget_->setMovable(true);
control_dock_tab_widget_->setUsesScrollButtons(true);

addDockWidget(Qt::LeftDockWidgetArea, control_dock_);
control_dock_->setVisible(true);
Expand Down
5 changes: 3 additions & 2 deletions schnapps/core/schnapps_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#ifndef SCHNAPPS_CORE_SCHNAPPS_WINDOW_H_
#define SCHNAPPS_CORE_SCHNAPPS_WINDOW_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>


#include <ui_schnapps.h>

Expand All @@ -42,7 +43,7 @@ namespace schnapps

class SCHNApps;

class SCHNAPPS_CORE_API SCHNAppsWindow : public QMainWindow, public Ui::SCHNAppsWindow
class SCHNAPPS_CORE_EXPORT SCHNAppsWindow : public QMainWindow, public Ui::SCHNAppsWindow
{
Q_OBJECT

Expand Down
5 changes: 3 additions & 2 deletions schnapps/core/schnapps_window_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#ifndef SCHNAPPS_CORE_SCHNAPPS_WINDOW_FACTORY_H_
#define SCHNAPPS_CORE_SCHNAPPS_WINDOW_FACTORY_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>


#include <QMainWindow>
#include <QString>
Expand All @@ -36,7 +37,7 @@ namespace schnapps
* factory of SCHNApps_Window (avoid include of schnapps_window.h)
* definition in schnapps_window.cpp
*/
SCHNAPPS_CORE_API std::unique_ptr<QMainWindow> schnapps_window_factory(
SCHNAPPS_CORE_EXPORT std::unique_ptr<QMainWindow> schnapps_window_factory(
const QString& app_path,
const QString& settings_path,
const QString& init_plugin_name
Expand Down
5 changes: 3 additions & 2 deletions schnapps/core/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#ifndef SCHNAPPS_CORE_SETTINGS_H_
#define SCHNAPPS_CORE_SETTINGS_H_

#include <schnapps/core/dll.h>
#include <schnapps/core/schnapps_core_export.h>


#include <QVariantMap>
#include <QStringList>
Expand All @@ -38,7 +39,7 @@ namespace schnapps

class SettingsWidget;

class SCHNAPPS_CORE_API Settings : public QObject
class SCHNAPPS_CORE_EXPORT Settings : public QObject
{
Q_OBJECT

Expand Down
Loading