Commit ca8882d9 authored by Julien Wintz's avatar Julien Wintz
Browse files

Fixed install rules for dtk.

Towards using either build tree or install tree in e.g. dtk-imaging.
parent 39bc98c1
...@@ -42,15 +42,11 @@ set(CMAKE_MODULE_PATH ...@@ -42,15 +42,11 @@ set(CMAKE_MODULE_PATH
set_directory_properties(PROPERTIES TEST_INCLUDE_FILE "@CMAKE_BINARY_DIR@/dtkSetTestEnvironment.cmake") set_directory_properties(PROPERTIES TEST_INCLUDE_FILE "@CMAKE_BINARY_DIR@/dtkSetTestEnvironment.cmake")
find_package(Qt5 REQUIRED COMPONENTS Core Concurrent Network Quick Svg Test Widgets Xml NO_DEFAULT_PATH)
set(dtk_MODULE_PATH "@CMAKE_BINARY_DIR@") set(dtk_MODULE_PATH "@CMAKE_BINARY_DIR@")
set(dtk_INSTALL_DOCS @dtk_INSTALL_DOCS@) set(dtk_INSTALL_DOCS "@dtk_INSTALL_DOCS@")
set(dtk_CONFIG_DOCS @dtk_CONFIG_DOCS@) set(dtk_CONFIG_DOCS "@dtk_CONFIG_DOCS@")
set(dtk_WRAP_BASE "@CMAKE_BINARY_DIR@/dtk_base.i")
set(dtk_WRAP_CORE "@CMAKE_BINARY_DIR@/dtkCore.i") set(dtk_WRAP_PREFIX "@CMAKE_SOURCE_DIR@/wrp")
set(dtk_WRAP_WIDGETS "@CMAKE_BINARY_DIR@/dtkWidgets.i")
set(dtk_WRAP_QVARIANT "@CMAKE_BINARY_DIR@/QVariant.i")
## ################################################################### ## ###################################################################
## Options ## Options
......
...@@ -34,27 +34,13 @@ set(CMAKE_MODULE_PATH ...@@ -34,27 +34,13 @@ set(CMAKE_MODULE_PATH
set(DTK_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@") set(DTK_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
set(dtk_INSTALL_DOCS "@CMAKE_INSTALL_PREFIX@/doc") set(dtk_INSTALL_DOCS "@CMAKE_INSTALL_PREFIX@/doc")
set(dtk_WRAP_BASE "@CMAKE_INSTALL_PREFIX@/include/swig/dtk_base.i")
set(dtk_WRAP_CORE "@CMAKE_INSTALL_PREFIX@/include/swig/dtkCore.i")
set(dtk_WRAP_WIDGETS "@CMAKE_INSTALL_PREFIX@/include/swig/dtkWidgets.i")
set(dtk_WRAP_QVARIANT "@CMAKE_INSTALL_PREFIX@/include/swig/QVariant.i")
set(dtk_WRAP_PREFIX "@CMAKE_INSTALL_PREFIX@/wrp")
include("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake/dtk/dtkDepends.cmake") include("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake/dtk/dtkDepends.cmake")
include("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake/dtk/dtkWrap.cmake") include("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake/dtk/dtkWrap.cmake")
set_directory_properties(PROPERTIES TEST_INCLUDE_FILE "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake/dtk/dtkSetTestEnvironment.cmake") set_directory_properties(PROPERTIES TEST_INCLUDE_FILE "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake/dtk/dtkSetTestEnvironment.cmake")
find_package(Qt5 REQUIRED COMPONENTS
Core
Concurrent
Network
Quick
Svg
Test
Widgets
Xml)
## ################################################################### ## ###################################################################
## Options ## Options
## ################################################################### ## ###################################################################
......
...@@ -102,8 +102,6 @@ if(SWIG_FOUND) ...@@ -102,8 +102,6 @@ if(SWIG_FOUND)
"-c++" "-c++"
"-module" ${name} "-module" ${name}
${include_dirs} ${include_dirs}
"-I${PROJECT_SOURCE_DIR}/.."
"-I${PROJECT_SOURCE_DIR}/src"
"-outdir" ${CMAKE_CURRENT_BINARY_DIR} "-outdir" ${CMAKE_CURRENT_BINARY_DIR}
"-o" ${wrap_output} "-o" ${wrap_output}
${input} ${input}
......
...@@ -120,7 +120,7 @@ if(DTK_BUILD_WRAPPERS) ...@@ -120,7 +120,7 @@ if(DTK_BUILD_WRAPPERS)
set(${PROJECT_NAME}_WRAP_DEPENDS ${${PROJECT_NAME}_WRAP_DEPENDS} ${CMAKE_BINARY_DIR}/dtkCore.i) set(${PROJECT_NAME}_WRAP_DEPENDS ${${PROJECT_NAME}_WRAP_DEPENDS} ${CMAKE_BINARY_DIR}/dtkCore.i)
if (DTK_WRAPPING_PYTHON AND PYTHONLIBS_FOUND) if (DTK_WRAPPING_PYTHON AND PYTHONLIBS_FOUND)
dtk_wrap(${PROJECT_NAME} ${PROJECT_NAME}_SOURCES_WRAP dtkcore python ${PROJECT_SOURCE_DIR}/dtkCore.i "${${PROJECT_NAME}_WRAP_DEPENDS}" ".") dtk_wrap(${PROJECT_NAME} ${PROJECT_NAME}_SOURCES_WRAP dtkcore python ${PROJECT_SOURCE_DIR}/dtkCore.i "${${PROJECT_NAME}_WRAP_DEPENDS}" "${CMAKE_SOURCE_DIR}/src;${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_SOURCE_DIR}/wrp/dtkBase;${CMAKE_SOURCE_DIR}/wrp/QtCore")
endif() endif()
if (DTK_WRAPPING_TCL AND TCL_FOUND) if (DTK_WRAPPING_TCL AND TCL_FOUND)
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
%module(directors="1") dtkcore %module(directors="1") dtkcore
%include "dtk_base.i" %include <dtk_base.i>
%include "qrunnable.i" %include <qrunnable.i>
%{ %{
......
...@@ -48,7 +48,7 @@ if(DTK_BUILD_WRAPPERS AND SWIG_FOUND) ...@@ -48,7 +48,7 @@ if(DTK_BUILD_WRAPPERS AND SWIG_FOUND)
if (DTK_WRAPPING_PYTHON) if (DTK_WRAPPING_PYTHON)
if (PYTHONLIBS_FOUND) if (PYTHONLIBS_FOUND)
dtk_wrap(${PROJECT_NAME} ${PROJECT_NAME}_SOURCES_WRAP dtklog python ${PROJECT_SOURCE_DIR}/dtkLog.i "${${PROJECT_NAME}_WRAP_DEPENDS}" ".") dtk_wrap(${PROJECT_NAME} ${PROJECT_NAME}_SOURCES_WRAP dtklog python ${PROJECT_SOURCE_DIR}/dtkLog.i "${${PROJECT_NAME}_WRAP_DEPENDS}" "${CMAKE_SOURCE_DIR}/src;${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_SOURCE_DIR}/wrp/dtkBase;${CMAKE_SOURCE_DIR}/wrp/QtCore")
endif() endif()
endif() endif()
......
...@@ -134,7 +134,7 @@ if(DTK_BUILD_WRAPPERS) ...@@ -134,7 +134,7 @@ if(DTK_BUILD_WRAPPERS)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dtkWidgets.i ${CMAKE_BINARY_DIR}/dtkWidgets.i COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dtkWidgets.i ${CMAKE_BINARY_DIR}/dtkWidgets.i COPYONLY)
if (DTK_WRAPPING_PYTHON AND PYTHONLIBS_FOUND) if (DTK_WRAPPING_PYTHON AND PYTHONLIBS_FOUND)
dtk_wrap(${PROJECT_NAME} ${PROJECT_NAME}_SOURCES_WRAP dtkwidgets python ${PROJECT_SOURCE_DIR}/dtkWidgets.i "${${PROJECT_NAME}_WRAP_DEPENDS}" ".") dtk_wrap(${PROJECT_NAME} ${PROJECT_NAME}_SOURCES_WRAP dtkwidgets python ${PROJECT_SOURCE_DIR}/dtkWidgets.i "${${PROJECT_NAME}_WRAP_DEPENDS}" "${CMAKE_SOURCE_DIR}/src;${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_SOURCE_DIR}/wrp/dtkBase;${CMAKE_SOURCE_DIR}/wrp/dtkWidgets;${CMAKE_SOURCE_DIR}/wrp/QtCore;${CMAKE_SOURCE_DIR}/wrp/QtWidgets")
endif() endif()
if (DTK_WRAPPING_TCL AND TCL_FOUND) if (DTK_WRAPPING_TCL AND TCL_FOUND)
dtk_wrap(${PROJECT_NAME} ${PROJECT_NAME}_SOURCES_WRAP dtkwidgets tcl ${PROJECT_SOURCE_DIR}/dtkWidgets.i "${${PROJECT_NAME}_WRAP_DEPENDS}" ".") dtk_wrap(${PROJECT_NAME} ${PROJECT_NAME}_SOURCES_WRAP dtkwidgets tcl ${PROJECT_SOURCE_DIR}/dtkWidgets.i "${${PROJECT_NAME}_WRAP_DEPENDS}" ".")
...@@ -304,7 +304,6 @@ install(FILES ${${PROJECT_NAME}_HEADERS} ...@@ -304,7 +304,6 @@ install(FILES ${${PROJECT_NAME}_HEADERS}
install(FILES ${${PROJECT_NAME}_MODULES} DESTINATION modules) install(FILES ${${PROJECT_NAME}_MODULES} DESTINATION modules)
install(FILES ${CMAKE_BINARY_DIR}/dtkWidgets.i DESTINATION include/swig) install(FILES ${CMAKE_BINARY_DIR}/dtkWidgets.i DESTINATION include/swig)
## ################################################################### ## ###################################################################
## Install rules - targets ## Install rules - targets
## ################################################################### ## ###################################################################
......
/* dtkApplication.h --- // Version: $Id$
* //
* Author: Nicolas Niclausse //
* Copyright (C) 2015 - Nicolas Niclausse, Inria.
* Created: 2015/02/04 12:01:21
*/
/* Commentary: // Commentary:
* //
*/ //
/* Change log: // Change Log:
* //
*/ //
// Code:
#pragma once #pragma once
#include <dtkWidgetsExport.h> #include <dtkWidgetsExport.h>
#include <dtkLog> #include <dtkLog>
#include <QApplication> #include <QtCore>
#include <QtWidgets>
class dtkApplicationPrivate; class dtkApplicationPrivate;
class DTKWIDGETS_EXPORT dtkApplication: public QApplication class DTKWIDGETS_EXPORT dtkApplication: public QApplication
{ {
public: public:
dtkApplication(int& argc, char **argv); dtkApplication(int& argc, char **argv);
virtual ~dtkApplication(void); virtual ~dtkApplication(void);
public: public:
...@@ -36,10 +36,11 @@ public: ...@@ -36,10 +36,11 @@ public:
public: public:
static dtkApplication *create(int& argc, char *argv[]) { static dtkApplication *create(int& argc, char *argv[]) {
for (int i = 0; i < argc; i++) for (int i = 0; i < argc; i++) {
if (!qstrcmp(argv[i], "-nw") || !qstrcmp(argv[i], "--nw") || !qstrcmp(argv[i], "-no-window") || !qstrcmp(argv[i], "--no-window") || !qstrcmp(argv[i], "-h") || !qstrcmp(argv[i], "--help") || !qstrcmp(argv[i], "--version")) { if (!qstrcmp(argv[i], "-nw") || !qstrcmp(argv[i], "--nw") || !qstrcmp(argv[i], "-no-window") || !qstrcmp(argv[i], "--no-window") || !qstrcmp(argv[i], "-h") || !qstrcmp(argv[i], "--help") || !qstrcmp(argv[i], "--version")) {
qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("minimal")); qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("minimal"));
} }
}
return new dtkApplication(argc, argv); return new dtkApplication(argc, argv);
} }
...@@ -52,3 +53,5 @@ protected: ...@@ -52,3 +53,5 @@ protected:
dtkApplicationPrivate *d; dtkApplicationPrivate *d;
}; };
//
// dtkApplication.h ends here
...@@ -12,9 +12,10 @@ ...@@ -12,9 +12,10 @@
## ##
### Code: ### Code:
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qt_core.i ${CMAKE_BINARY_DIR}/qt_core.i COPYONLY) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/qt_core.i DESTINATION wrp/QtCore/)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/QVariant.i ${CMAKE_BINARY_DIR}/QVariant.i COPYONLY) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/qrunnable.i DESTINATION wrp/QtCore/)
install(FILES ${CMAKE_BINARY_DIR}/QVariant.i DESTINATION include/swig) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/QVariant.i DESTINATION wrp/QtCore/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/QObject.h DESTINATION wrp/QtCore/)
###################################################################### ######################################################################
### CMakeLists.txt ends here ### CMakeLists.txt ends here
...@@ -12,7 +12,11 @@ ...@@ -12,7 +12,11 @@
## ##
### Code: ### Code:
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qt_widgets.i ${CMAKE_BINARY_DIR}/qt_widgets.i COPYONLY) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/QBoxLayout.h DESTINATION wrp/QtWidgets/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/QVBoxLayout.h DESTINATION wrp/QtWidgets/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/QLayout.h DESTINATION wrp/QtWidgets/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/QWidget.h DESTINATION wrp/QtWidgets/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/qt_widgets.i DESTINATION wrp/QtWidgets/)
###################################################################### ######################################################################
### CMakeLists.txt ends here ### CMakeLists.txt ends here
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
## ##
### Code: ### Code:
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dtk_base.i ${CMAKE_BINARY_DIR}/dtk_base.i COPYONLY) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dtk_base.i DESTINATION wrp/dtkBase/)
install(FILES ${CMAKE_BINARY_DIR}/dtk_base.i DESTINATION include/swig)
###################################################################### ######################################################################
### CMakeLists.txt ends here ### CMakeLists.txt ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment