Browse.html: Color-code document types.
[supercollider.git] / QtCollider / CMakeLists.txt
blobeedf98de254769c3381cc7e7af299ac724b4ae09
1 find_package (Qt4 4.5)
2 if (NOT QT4_FOUND)
3     message(FATAL_ERROR
4         "You are trying to compile with Qt GUI support, but either Qt version on your"
5         " system is not compatible, or Qt cannot be found."
6         " Please either install Qt (version 4.5 or greater), or compile without Qt GUI support"
7         " (add -DSC_QT=OFF to the cmake command line).")
8 endif()
10 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}  -DQC_DEBUG")
11 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}  -DQC_DEBUG")
13 set(QT_COLLIDER_DIR ${CMAKE_SOURCE_DIR}/QtCollider)
15 set( QT_COLLIDER_HDRS
16   ${QT_COLLIDER_DIR}/QcApplication.h
17   ${QT_COLLIDER_DIR}/QObjectProxy.h
18   ${QT_COLLIDER_DIR}/QWidgetProxy.h
19   ${QT_COLLIDER_DIR}/widgets/BasicWidgets.h
20   ${QT_COLLIDER_DIR}/widgets/QcTreeWidget.h
21   ${QT_COLLIDER_DIR}/widgets/QcScrollArea.h
22   ${QT_COLLIDER_DIR}/widgets/QcNumberBox.h
23   ${QT_COLLIDER_DIR}/widgets/QcSlider.h
24   ${QT_COLLIDER_DIR}/widgets/QcSlider2D.h
25   ${QT_COLLIDER_DIR}/widgets/QcRangeSlider.h
26   ${QT_COLLIDER_DIR}/widgets/QcMultiSlider.h
27   ${QT_COLLIDER_DIR}/widgets/QcTextEdit.h
28   ${QT_COLLIDER_DIR}/widgets/QcScope.h
29   ${QT_COLLIDER_DIR}/widgets/QcScopeShm.h
30   ${QT_COLLIDER_DIR}/widgets/QcGraph.h
31   ${QT_COLLIDER_DIR}/widgets/QcLevelIndicator.h
32   ${QT_COLLIDER_DIR}/widgets/QcCanvas.h
33   ${QT_COLLIDER_DIR}/widgets/QcSoundFileView.h
34   ${QT_COLLIDER_DIR}/widgets/QcFileDialog.h
35   ${QT_COLLIDER_DIR}/widgets/QcPenPrinter.h
36   ${QT_COLLIDER_DIR}/widgets/QcWebView.h
37   ${QT_COLLIDER_DIR}/widgets/QcWindow.h
38   ${QT_COLLIDER_DIR}/layouts/layouts.hpp
41 set( QT_COLLIDER_SRCS
42   ${QT_COLLIDER_DIR}/debug.cpp
43   ${QT_COLLIDER_DIR}/interface.cpp
44   ${QT_COLLIDER_DIR}/QcApplication.cpp
45   ${QT_COLLIDER_DIR}/Common.cpp
46   ${QT_COLLIDER_DIR}/QObjectProxy.cpp
47   ${QT_COLLIDER_DIR}/QWidgetProxy.cpp
48   ${QT_COLLIDER_DIR}/Slot.cpp
49   ${QT_COLLIDER_DIR}/QcObjectFactory.cpp
50   ${QT_COLLIDER_DIR}/hacks/hacks_x11.cpp
51   ${QT_COLLIDER_DIR}/primitives/primitives.cpp
52   ${QT_COLLIDER_DIR}/primitives/prim_QObject.cpp
53   ${QT_COLLIDER_DIR}/primitives/prim_QPen.cpp
54   ${QT_COLLIDER_DIR}/primitives/prim_misc.cpp
55   ${QT_COLLIDER_DIR}/primitives/prim_QWidget.cpp
56   ${QT_COLLIDER_DIR}/widgets/BasicWidgets.cpp
57   ${QT_COLLIDER_DIR}/widgets/QcTreeWidget.cpp
58   ${QT_COLLIDER_DIR}/widgets/QcScrollArea.cpp
59   ${QT_COLLIDER_DIR}/widgets/QcAbstractStepValue.cpp
60   ${QT_COLLIDER_DIR}/widgets/QcNumberBox.cpp
61   ${QT_COLLIDER_DIR}/widgets/QcSlider.cpp
62   ${QT_COLLIDER_DIR}/widgets/QcSlider2D.cpp
63   ${QT_COLLIDER_DIR}/widgets/QcRangeSlider.cpp
64   ${QT_COLLIDER_DIR}/widgets/QcMultiSlider.cpp
65   ${QT_COLLIDER_DIR}/widgets/QcTextEdit.cpp
66   ${QT_COLLIDER_DIR}/widgets/QcScope.cpp
67   ${QT_COLLIDER_DIR}/widgets/QcScopeShm.cpp
68   ${QT_COLLIDER_DIR}/widgets/QcLevelIndicator.cpp
69   ${QT_COLLIDER_DIR}/widgets/QcWindow.cpp
70   ${QT_COLLIDER_DIR}/widgets/QcGraph.cpp
71   ${QT_COLLIDER_DIR}/widgets/QcCanvas.cpp
72   ${QT_COLLIDER_DIR}/widgets/QcSoundFileView.cpp
73   ${QT_COLLIDER_DIR}/widgets/QcFileDialog.cpp
74   ${QT_COLLIDER_DIR}/widgets/QcPenPrinter.cpp
75   ${QT_COLLIDER_DIR}/widgets/QcWebView.cpp
76   ${QT_COLLIDER_DIR}/layouts/classic_layouts.cpp
77   ${QT_COLLIDER_DIR}/layouts/layouts.cpp
78   ${QT_COLLIDER_DIR}/style/ProxyStyle.cpp
81 if(QT_COLLIDER_LANG_CLIENT)
82     list(APPEND QT_COLLIDER_HDRS ${QT_COLLIDER_DIR}/LanguageClient.h)
83     list(APPEND QT_COLLIDER_SRCS ${QT_COLLIDER_DIR}/LanguageClient.cpp)
84 endif()
86 if(APPLE)
87   set( QT_COLLIDER_OBJCPP_SRCS
88       ${QT_COLLIDER_DIR}/hacks/hacks_mac.M
89   )
90 endif()
92 if( CMAKE_COMPILER_IS_GNUCXX )
93   set_source_files_properties( ${QT_COLLIDER_OBJCPP_SRCS}
94       PROPERTIES COMPILE_FLAGS "-x objective-c++ -fobjc-exceptions"
95   )
96 endif()
98 set( QT_USE_QTWEBKIT TRUE )
100 include(${QT_USE_FILE})
102 set( SC_HEADERS_DIR "${CMAKE_SOURCE_DIR}/include" )
103 include_directories(
104   "${SC_HEADERS_DIR}/QtCollider"
107 qt4_wrap_cpp( QT_COLLIDER_MOC_SRCS ${QT_COLLIDER_HDRS} )
108 qt4_add_resources( QT_COLLIDER_RCC ${QT_COLLIDER_DIR}/resources.qrc )
110 list( APPEND QT_COLLIDER_SRCS
111   ${QT_COLLIDER_OBJCPP_SRCS}
112   ${QT_COLLIDER_MOC_SRCS}
113   ${QT_COLLIDER_RCC}
116 add_definitions(-DSC_QT -DQT_COLLIDER_EXPORTING -DQT_NO_KEYWORDS)
118 set (QT_COLLIDER_LIBS ${QT_LIBRARIES} ${MATH_LIBRARY})
120 if(APPLE)
121   list(APPEND QT_COLLIDER_LIBS "-framework Cocoa" )
122 endif()
124 if (CMAKE_SYSTEM_NAME MATCHES "Linux")
125         find_package(X11)
127         if(X11_FOUND)
128                 include_directories(X11_INCLUDE_DIR)
129                 list(APPEND QT_COLLIDER_LIBS ${X11_X11_LIB})
130         elseif()
131                 message(SEND_ERROR "Cannot find libx11")
132         endif()
133 endif()