1 find_package (Qt4 4.5 COMPONENTS QtCore QtGui QtWebKit)
4 set(FIND_QT_ERROR_MSG "You are trying to compile with Qt GUI support, but a suitable version of Qt or one of its components could not be found:")
6 if(NOT QT_QTCORE_FOUND)
7 set(FIND_QT_ERROR_MSG "${FIND_QT_ERROR_MSG}\n-- Missing component: QtCore")
10 set(FIND_QT_ERROR_MSG "${FIND_QT_ERROR_MSG}\n-- Missing component: QtGui")
12 if(NOT QT_QTWEBKIT_FOUND)
13 set(FIND_QT_ERROR_MSG "${FIND_QT_ERROR_MSG}\n-- Missing component: QtWebKit")
16 set(FIND_QT_ERROR_MSG "${FIND_QT_ERROR_MSG}\nPlease either install Qt (version 4.5 or greater), or compile without Qt GUI support (add -DSC_QT=OFF to the cmake command line).")
18 message(FATAL_ERROR ${FIND_QT_ERROR_MSG})
21 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DQC_DEBUG")
22 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQC_DEBUG")
24 set(QT_COLLIDER_DIR ${CMAKE_SOURCE_DIR}/QtCollider)
27 ${QT_COLLIDER_DIR}/QcApplication.h
28 ${QT_COLLIDER_DIR}/QObjectProxy.h
29 ${QT_COLLIDER_DIR}/QWidgetProxy.h
30 ${QT_COLLIDER_DIR}/widgets/BasicWidgets.h
31 ${QT_COLLIDER_DIR}/widgets/QcButton.h
32 ${QT_COLLIDER_DIR}/widgets/QcCheckBox.h
33 ${QT_COLLIDER_DIR}/widgets/QcTextField.h
34 ${QT_COLLIDER_DIR}/widgets/QcListWidget.h
35 ${QT_COLLIDER_DIR}/widgets/QcPopUpMenu.h
36 ${QT_COLLIDER_DIR}/widgets/QcTreeWidget.h
37 ${QT_COLLIDER_DIR}/widgets/QcScrollArea.h
38 ${QT_COLLIDER_DIR}/widgets/QcNumberBox.h
39 ${QT_COLLIDER_DIR}/widgets/QcSlider.h
40 ${QT_COLLIDER_DIR}/widgets/QcSlider2D.h
41 ${QT_COLLIDER_DIR}/widgets/QcRangeSlider.h
42 ${QT_COLLIDER_DIR}/widgets/QcMultiSlider.h
43 ${QT_COLLIDER_DIR}/widgets/QcKnob.hpp
44 ${QT_COLLIDER_DIR}/widgets/QcTextEdit.h
45 ${QT_COLLIDER_DIR}/widgets/QcScope.h
46 ${QT_COLLIDER_DIR}/widgets/QcScopeShm.h
47 ${QT_COLLIDER_DIR}/widgets/QcGraph.h
48 ${QT_COLLIDER_DIR}/widgets/QcLevelIndicator.h
49 ${QT_COLLIDER_DIR}/widgets/QcCanvas.h
50 ${QT_COLLIDER_DIR}/widgets/soundfileview/view.hpp
51 ${QT_COLLIDER_DIR}/widgets/QcFileDialog.h
52 ${QT_COLLIDER_DIR}/widgets/QcPenPrinter.h
53 ${QT_COLLIDER_DIR}/widgets/QcWebView.h
54 ${QT_COLLIDER_DIR}/widgets/QcWindow.h
55 ${QT_COLLIDER_DIR}/layouts/layouts.hpp
56 ${QT_COLLIDER_DIR}/layouts/stack_layout.hpp
57 ${QT_COLLIDER_DIR}/style/style.hpp
61 ${QT_COLLIDER_DIR}/debug.cpp
62 ${QT_COLLIDER_DIR}/interface.cpp
63 ${QT_COLLIDER_DIR}/factories.cpp
64 ${QT_COLLIDER_DIR}/QcApplication.cpp
65 ${QT_COLLIDER_DIR}/Common.cpp
66 ${QT_COLLIDER_DIR}/QObjectProxy.cpp
67 ${QT_COLLIDER_DIR}/QWidgetProxy.cpp
68 ${QT_COLLIDER_DIR}/Slot.cpp
69 ${QT_COLLIDER_DIR}/QcObjectFactory.cpp
70 ${QT_COLLIDER_DIR}/hacks/hacks_x11.cpp
71 ${QT_COLLIDER_DIR}/primitives/primitives.cpp
72 ${QT_COLLIDER_DIR}/primitives/prim_QObject.cpp
73 ${QT_COLLIDER_DIR}/primitives/prim_QPen.cpp
74 ${QT_COLLIDER_DIR}/primitives/prim_misc.cpp
75 ${QT_COLLIDER_DIR}/primitives/prim_QWidget.cpp
76 ${QT_COLLIDER_DIR}/primitives/prim_QPalette.cpp
77 ${QT_COLLIDER_DIR}/widgets/BasicWidgets.cpp
78 ${QT_COLLIDER_DIR}/widgets/QcButton.cpp
79 ${QT_COLLIDER_DIR}/widgets/QcCheckBox.h
80 ${QT_COLLIDER_DIR}/widgets/QcTextField.h
81 ${QT_COLLIDER_DIR}/widgets/QcListWidget.cpp
82 ${QT_COLLIDER_DIR}/widgets/QcPopUpMenu.cpp
83 ${QT_COLLIDER_DIR}/widgets/QcTreeWidget.cpp
84 ${QT_COLLIDER_DIR}/widgets/QcScrollArea.cpp
85 ${QT_COLLIDER_DIR}/widgets/QcAbstractStepValue.cpp
86 ${QT_COLLIDER_DIR}/widgets/QcNumberBox.cpp
87 ${QT_COLLIDER_DIR}/widgets/QcSlider.cpp
88 ${QT_COLLIDER_DIR}/widgets/QcSlider2D.cpp
89 ${QT_COLLIDER_DIR}/widgets/QcRangeSlider.cpp
90 ${QT_COLLIDER_DIR}/widgets/QcMultiSlider.cpp
91 ${QT_COLLIDER_DIR}/widgets/QcKnob.cpp
92 ${QT_COLLIDER_DIR}/widgets/QcTextEdit.cpp
93 ${QT_COLLIDER_DIR}/widgets/QcScope.cpp
94 ${QT_COLLIDER_DIR}/widgets/QcScopeShm.cpp
95 ${QT_COLLIDER_DIR}/widgets/QcLevelIndicator.cpp
96 ${QT_COLLIDER_DIR}/widgets/QcWindow.cpp
97 ${QT_COLLIDER_DIR}/widgets/QcGraph.cpp
98 ${QT_COLLIDER_DIR}/widgets/QcCanvas.cpp
99 ${QT_COLLIDER_DIR}/widgets/soundfileview/view.cpp
100 ${QT_COLLIDER_DIR}/widgets/soundfileview/filestream.cpp
101 ${QT_COLLIDER_DIR}/widgets/soundfileview/cachestream.cpp
102 ${QT_COLLIDER_DIR}/widgets/QcFileDialog.cpp
103 ${QT_COLLIDER_DIR}/widgets/QcPenPrinter.cpp
104 ${QT_COLLIDER_DIR}/widgets/QcWebView.cpp
105 ${QT_COLLIDER_DIR}/layouts/layouts.cpp
106 ${QT_COLLIDER_DIR}/layouts/stack_layout.cpp
107 ${QT_COLLIDER_DIR}/style/ProxyStyle.cpp
108 ${QT_COLLIDER_DIR}/style/style.cpp
111 if(QT_COLLIDER_LANG_CLIENT)
112 list(APPEND QT_COLLIDER_HDRS ${QT_COLLIDER_DIR}/LanguageClient.h)
113 list(APPEND QT_COLLIDER_SRCS ${QT_COLLIDER_DIR}/LanguageClient.cpp)
117 set( QT_COLLIDER_OBJCPP_SRCS
118 ${QT_COLLIDER_DIR}/hacks/hacks_mac.M
122 if( CMAKE_COMPILER_IS_GNUCXX )
123 set_source_files_properties( ${QT_COLLIDER_OBJCPP_SRCS}
124 PROPERTIES COMPILE_FLAGS "-x objective-c++ -fobjc-exceptions"
128 include(${QT_USE_FILE})
130 set( SC_HEADERS_DIR "${CMAKE_SOURCE_DIR}/include" )
132 "${SC_HEADERS_DIR}/QtCollider"
135 qt4_wrap_cpp( QT_COLLIDER_MOC_SRCS ${QT_COLLIDER_HDRS} )
136 qt4_add_resources( QT_COLLIDER_RCC ${QT_COLLIDER_DIR}/resources.qrc )
138 list( APPEND QT_COLLIDER_SRCS
139 ${QT_COLLIDER_OBJCPP_SRCS}
140 ${QT_COLLIDER_MOC_SRCS}
144 add_definitions(-DSC_QT -DQT_COLLIDER_EXPORTING -DQT_NO_KEYWORDS)
146 set (QT_COLLIDER_LIBS ${QT_LIBRARIES} ${MATH_LIBRARY})
149 list(APPEND QT_COLLIDER_LIBS "-framework Cocoa" )
152 if (CMAKE_SYSTEM_NAME MATCHES "Linux")
156 include_directories(X11_INCLUDE_DIR)
157 list(APPEND QT_COLLIDER_LIBS ${X11_X11_LIB})
159 message(SEND_ERROR "Cannot find libx11")