cmake: supernova - missing include_directories() for Jack
[supercollider.git] / QtCollider / CMakeLists.txt
blob83e6702a0a006117b9065062f1087862fbcbde77
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/QcKnob.hpp
28   ${QT_COLLIDER_DIR}/widgets/QcTextEdit.h
29   ${QT_COLLIDER_DIR}/widgets/QcScope.h
30   ${QT_COLLIDER_DIR}/widgets/QcScopeShm.h
31   ${QT_COLLIDER_DIR}/widgets/QcGraph.h
32   ${QT_COLLIDER_DIR}/widgets/QcLevelIndicator.h
33   ${QT_COLLIDER_DIR}/widgets/QcCanvas.h
34   ${QT_COLLIDER_DIR}/widgets/soundfileview/view.hpp
35   ${QT_COLLIDER_DIR}/widgets/QcFileDialog.h
36   ${QT_COLLIDER_DIR}/widgets/QcPenPrinter.h
37   ${QT_COLLIDER_DIR}/widgets/QcWebView.h
38   ${QT_COLLIDER_DIR}/widgets/QcWindow.h
39   ${QT_COLLIDER_DIR}/layouts/layouts.hpp
40   ${QT_COLLIDER_DIR}/layouts/stack_layout.hpp
41   ${QT_COLLIDER_DIR}/style/style.hpp
44 set( QT_COLLIDER_SRCS
45   ${QT_COLLIDER_DIR}/debug.cpp
46   ${QT_COLLIDER_DIR}/interface.cpp
47   ${QT_COLLIDER_DIR}/factories.cpp
48   ${QT_COLLIDER_DIR}/QcApplication.cpp
49   ${QT_COLLIDER_DIR}/Common.cpp
50   ${QT_COLLIDER_DIR}/QObjectProxy.cpp
51   ${QT_COLLIDER_DIR}/QWidgetProxy.cpp
52   ${QT_COLLIDER_DIR}/Slot.cpp
53   ${QT_COLLIDER_DIR}/QcObjectFactory.cpp
54   ${QT_COLLIDER_DIR}/hacks/hacks_x11.cpp
55   ${QT_COLLIDER_DIR}/primitives/primitives.cpp
56   ${QT_COLLIDER_DIR}/primitives/prim_QObject.cpp
57   ${QT_COLLIDER_DIR}/primitives/prim_QPen.cpp
58   ${QT_COLLIDER_DIR}/primitives/prim_misc.cpp
59   ${QT_COLLIDER_DIR}/primitives/prim_QWidget.cpp
60   ${QT_COLLIDER_DIR}/primitives/prim_QPalette.cpp
61   ${QT_COLLIDER_DIR}/widgets/BasicWidgets.cpp
62   ${QT_COLLIDER_DIR}/widgets/QcTreeWidget.cpp
63   ${QT_COLLIDER_DIR}/widgets/QcScrollArea.cpp
64   ${QT_COLLIDER_DIR}/widgets/QcAbstractStepValue.cpp
65   ${QT_COLLIDER_DIR}/widgets/QcNumberBox.cpp
66   ${QT_COLLIDER_DIR}/widgets/QcSlider.cpp
67   ${QT_COLLIDER_DIR}/widgets/QcSlider2D.cpp
68   ${QT_COLLIDER_DIR}/widgets/QcRangeSlider.cpp
69   ${QT_COLLIDER_DIR}/widgets/QcMultiSlider.cpp
70   ${QT_COLLIDER_DIR}/widgets/QcKnob.cpp
71   ${QT_COLLIDER_DIR}/widgets/QcTextEdit.cpp
72   ${QT_COLLIDER_DIR}/widgets/QcScope.cpp
73   ${QT_COLLIDER_DIR}/widgets/QcScopeShm.cpp
74   ${QT_COLLIDER_DIR}/widgets/QcLevelIndicator.cpp
75   ${QT_COLLIDER_DIR}/widgets/QcWindow.cpp
76   ${QT_COLLIDER_DIR}/widgets/QcGraph.cpp
77   ${QT_COLLIDER_DIR}/widgets/QcCanvas.cpp
78   ${QT_COLLIDER_DIR}/widgets/soundfileview/view.cpp
79   ${QT_COLLIDER_DIR}/widgets/soundfileview/filestream.cpp
80   ${QT_COLLIDER_DIR}/widgets/soundfileview/cachestream.cpp
81   ${QT_COLLIDER_DIR}/widgets/QcFileDialog.cpp
82   ${QT_COLLIDER_DIR}/widgets/QcPenPrinter.cpp
83   ${QT_COLLIDER_DIR}/widgets/QcWebView.cpp
84   ${QT_COLLIDER_DIR}/layouts/classic_layouts.cpp
85   ${QT_COLLIDER_DIR}/layouts/layouts.cpp
86   ${QT_COLLIDER_DIR}/layouts/stack_layout.cpp
87   ${QT_COLLIDER_DIR}/style/ProxyStyle.cpp
88   ${QT_COLLIDER_DIR}/style/style.cpp
91 if(QT_COLLIDER_LANG_CLIENT)
92     list(APPEND QT_COLLIDER_HDRS ${QT_COLLIDER_DIR}/LanguageClient.h)
93     list(APPEND QT_COLLIDER_SRCS ${QT_COLLIDER_DIR}/LanguageClient.cpp)
94 endif()
96 if(APPLE)
97   set( QT_COLLIDER_OBJCPP_SRCS
98       ${QT_COLLIDER_DIR}/hacks/hacks_mac.M
99   )
100 endif()
102 if( CMAKE_COMPILER_IS_GNUCXX )
103   set_source_files_properties( ${QT_COLLIDER_OBJCPP_SRCS}
104       PROPERTIES COMPILE_FLAGS "-x objective-c++ -fobjc-exceptions"
105   )
106 endif()
108 set( QT_USE_QTWEBKIT TRUE )
110 include(${QT_USE_FILE})
112 set( SC_HEADERS_DIR "${CMAKE_SOURCE_DIR}/include" )
113 include_directories(
114   "${SC_HEADERS_DIR}/QtCollider"
117 qt4_wrap_cpp( QT_COLLIDER_MOC_SRCS ${QT_COLLIDER_HDRS} )
118 qt4_add_resources( QT_COLLIDER_RCC ${QT_COLLIDER_DIR}/resources.qrc )
120 list( APPEND QT_COLLIDER_SRCS
121   ${QT_COLLIDER_OBJCPP_SRCS}
122   ${QT_COLLIDER_MOC_SRCS}
123   ${QT_COLLIDER_RCC}
126 add_definitions(-DSC_QT -DQT_COLLIDER_EXPORTING -DQT_NO_KEYWORDS)
128 set (QT_COLLIDER_LIBS ${QT_LIBRARIES} ${MATH_LIBRARY})
130 if(APPLE)
131   list(APPEND QT_COLLIDER_LIBS "-framework Cocoa" )
132 endif()
134 if (CMAKE_SYSTEM_NAME MATCHES "Linux")
135         find_package(X11)
137         if(X11_FOUND)
138                 include_directories(X11_INCLUDE_DIR)
139                 list(APPEND QT_COLLIDER_LIBS ${X11_X11_LIB})
140         elseif()
141                 message(SEND_ERROR "Cannot find libx11")
142         endif()
143 endif()