source: orange/source/orangeqt/CMakeLists.txt @ 9252:0f95168f50b6

Revision 9252:0f95168f50b6, 1.9 KB checked in by miha <miha.stajdohar@…>, 2 years ago (diff)

Clean build dir.

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)
11find_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
53set(SIP_EXTRA_LINK_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY})
54set(SIP_EXTRA_SOURCES ${orangeqt_SRCS})
55
56add_sip_python_module(orangeqt orangeqt.sip)
57
58#### copying the library after building ####
59if (NOT ORANGE_LIB_DIR)
60    set (ORANGE_LIB_DIR "../..")
61endif()
62
63get_target_property(PYTHON_LIB_LOCATION python_module_orangeqt LOCATION)
64
65message(${ORANGE_LIB_DIR})
66
67add_custom_command(
68   TARGET python_module_orangeqt
69   POST_BUILD
70   COMMAND ${CMAKE_COMMAND} -E copy ${PYTHON_LIB_LOCATION} ${ORANGE_LIB_DIR}
71 )
Note: See TracBrowser for help on using the repository browser.