source: orange/source/orangeqt/CMakeLists.txt @ 10515:512a085effc0

Revision 10515:512a085effc0, 1.9 KB checked in by mstajdohar, 2 years ago (diff)

Removed building orangeqt 3D libs by default since there are some unresolved errors on some platforms (for example: Mint, Ubuntu).

Line 
1project(orangeqt)
2
3cmake_minimum_required(VERSION 2.6)
4find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED)
5find_package(PythonInterp REQUIRED)
6
7set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/modules)
8find_package(PyQt4 REQUIRED)
9find_package(SIP REQUIRED)
10find_package(PythonLibrary REQUIRED)
11#find_package(OpenGL)
12find_package(Numpy)
13include(SIPMacros)
14
15include_directories(${QT_INCLUDES} ${SIP_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_INCLUDE_PATH} ${NUMPY_INCLUDE_DIR})
16
17if (${CMAKE_BUILD_TYPE} STREQUAL Release OR ${CMAKE_BUILD_TYPE} STREQUAL RelWithDebInfo)
18  add_definitions(-DQT_NO_DEBUG)
19  add_definitions(-DQT_NO_DEBUG_OUTPUT)
20endif ()
21
22#### orangeqt sources ####
23set(orangeqt_SRCS
24    plotitem.cpp
25    point.cpp
26    curve.cpp
27    unconnectedlinescurve.cpp
28    networkcurve.cpp
29    multicurve.cpp
30    plot.cpp
31#    plot3d.cpp
32#    canvas3d.cpp
33#    glextensions.cpp
34)
35qt4_automoc(${orangeqt_SRCS})
36
37#### Python bindings ####
38set(SIP_PLATFORM_TAG)
39if (Q_WS_WIN)
40    set(PYQT4_PLATFORM_TAG "WS_WIN")
41endif (Q_WS_WIN)
42if (Q_WS_X11)
43    set(PYQT4_PLATFORM_TAG "WS_X11")
44endif (Q_WS_X11)
45if (Q_WS_MAC)
46    set(PYQT4_PLATFORM_TAG "WS_MACX")
47endif (Q_WS_MAC)
48set(SIP_TAGS ${PYQT4_VERSION_TAG} ${PYQT4_PLATFORM_TAG})
49set(SIP_INCLUDES ${PYQT4_SIP_DIR})
50set(SIP_CONCAT_PARTS 1)
51set(SIP_EXTRA_OPTIONS "-k")
52
53#set(SIP_EXTRA_LINK_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY})
54set(SIP_EXTRA_LINK_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
55set(SIP_EXTRA_SOURCES ${orangeqt_SRCS})
56
57add_sip_python_module(orangeqt orangeqt.sip)
58
59#### copying the library after building ####
60if (NOT ORANGE_LIB_DIR)
61    set (ORANGE_LIB_DIR "../..")
62endif()
63
64get_target_property(PYTHON_LIB_LOCATION python_module_orangeqt LOCATION)
65
66message(${ORANGE_LIB_DIR})
67
68add_custom_command(
69   TARGET python_module_orangeqt
70   POST_BUILD
71   COMMAND ${CMAKE_COMMAND} -E copy ${PYTHON_LIB_LOCATION} ${ORANGE_LIB_DIR}
72 )
Note: See TracBrowser for help on using the repository browser.