1 include_directories(${CMAKE_SOURCE_DIR}/include/common
2 ${CMAKE_SOURCE_DIR}/include/lang
3 ${CMAKE_SOURCE_DIR}/include/plugin_interface
4 ${CMAKE_SOURCE_DIR}/include/server
5 ${CMAKE_SOURCE_DIR}/external_libraries/boost-lockfree
6 ${CMAKE_SOURCE_DIR}/external_libraries/threadpool
7 ${CMAKE_SOURCE_DIR}/external_libraries/yaml-cpp-0.3.0/include
8 ${CMAKE_SOURCE_DIR}/external_libraries/TLSF-2.4.6/src
12 include_directories(${Boost_INCLUDE_DIRS})
14 include_directories(${CMAKE_SOURCE_DIR}/external_libraries/boost)
18 include_directories("LangPrimSource/${HID_UTIL_DIR}")
19 elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
22 find_package(Portmidi)
25 find_package(Readline 5.0)
30 LangPrimSource/SC_Wii.cpp
31 LangPrimSource/PyrSignalPrim.cpp
32 LangPrimSource/PyrSched.cpp
33 LangPrimSource/PyrPrimitive.cpp
34 LangPrimSource/PyrMathPrim.cpp
35 LangPrimSource/SC_ComPort.cpp
36 LangPrimSource/OSCData.cpp
37 LangPrimSource/PyrArchiver.cpp
38 LangPrimSource/PyrArrayPrimitives.cpp
39 LangPrimSource/PyrBitPrim.cpp
40 LangPrimSource/PyrCharPrim.cpp
41 LangPrimSource/PyrFilePrim.cpp
42 LangPrimSource/PyrListPrim.cpp
43 LangPrimSource/PyrPlatformPrim.cpp
44 LangPrimSource/PyrStringPrim.cpp
45 LangPrimSource/PyrSymbolPrim.cpp
46 LangPrimSource/PyrUnixPrim.cpp
47 LangSource/AdvancingAllocPool.cpp
48 LangSource/ByteCodeArray.cpp
49 LangSource/DumpParseNode.cpp
51 LangSource/InitAlloc.cpp
52 LangSource/PyrFileUtils.cpp
53 LangSource/PyrInterpreter3.cpp
54 LangSource/PyrLexer.cpp
55 LangSource/PyrMathOps.cpp
56 LangSource/PyrMathSupport.cpp
57 LangSource/PyrMessage.cpp
58 LangSource/PyrObject.cpp
59 LangSource/PyrParseNode.cpp
60 LangSource/PyrSignal.cpp
61 LangSource/PyrSymbolTable.cpp
62 LangSource/SC_LanguageClient.cpp
63 LangSource/SC_LibraryConfig.cpp
64 LangSource/SC_TerminalClient.cpp
66 LangSource/SimpleStack.cpp
67 LangSource/VMGlobals.cpp
68 LangSource/dumpByteCodes.cpp
70 ${CMAKE_SOURCE_DIR}/common/fftlib.c
71 ${CMAKE_SOURCE_DIR}/common/SC_AllocPool.cpp
72 ${CMAKE_SOURCE_DIR}/common/SC_DirUtils.cpp
73 ${CMAKE_SOURCE_DIR}/common/SC_Reply.cpp
74 ${CMAKE_SOURCE_DIR}/common/SC_Sem.cpp
75 ${CMAKE_SOURCE_DIR}/common/SC_StandAloneInfo_Darwin.cpp
76 ${CMAKE_SOURCE_DIR}/common/SC_StringBuffer.cpp
77 ${CMAKE_SOURCE_DIR}/common/SC_StringParser.cpp
78 ${CMAKE_SOURCE_DIR}/common/scsynthsend.cpp
79 ${CMAKE_SOURCE_DIR}/common/sc_popen.cpp
83 file(GLOB boost_system_sources ../external_libraries/boost/libs/system/src/*cpp)
84 file(GLOB boost_fs_sources ../external_libraries/boost/libs/filesystem/src/*cpp)
85 file(GLOB boost_regex_sources ../external_libraries/boost/libs/regex/src/*cpp)
86 list(APPEND sclang_sources ${boost_fs_sources} ${boost_system_sources} ${boost_regex_sources})
89 file(GLOB_RECURSE headers ../include/*.h* )
90 file(GLOB_RECURSE external_headers ../external_libraries/*.h* )
91 list(APPEND sclang_sources ${headers} ${external_headers}) # make qt creator happy
94 list(APPEND sclang_sources LangPrimSource/PyrSerialPrim.cpp)
98 list(APPEND sclang_sources ${CMAKE_SOURCE_DIR}/common/SC_Win32Utils.cpp)
102 include_directories(../platform/windows/compat_stuff)
103 list(APPEND sclang_sources ../platform/windows/compat_stuff/getopt.c)
106 set(sclang_parser_source LangSource/Bison/lang11d_tab.cpp)
108 add_definitions(-DYYSTACK_USE_ALLOCA)
112 list(APPEND sclang_sources
113 LangPrimSource/WiiMote_OSX/wiiremote.c
114 LangPrimSource/SC_HID.cpp
115 LangPrimSource/${HID_UTIL_DIR}/HID_Utilities.c
116 LangPrimSource/${HID_UTIL_DIR}/HID_Name_Lookup.c
117 LangPrimSource/${HID_UTIL_DIR}/HID_Queue_Utilities.c
118 LangPrimSource/${HID_UTIL_DIR}/HID_Error_Handler.c
119 LangPrimSource/SC_CoreMIDI.cpp
120 LangPrimSource/SC_CoreAudioPrim.cpp
121 LangPrimSource/SC_Speech.M
123 add_definitions(-DHAVE_SPEECH)
124 if (CMAKE_COMPILER_IS_GNUCXX)
125 set_source_files_properties(LangPrimSource/SC_Speech.M
126 PROPERTIES COMPILE_FLAGS "-x objective-c++ -fobjc-exceptions")
128 if(NOT (HID_UTIL_DIR MATCHES "HID_Utilities_10_4"))
129 list(APPEND sclang_sources
130 LangPrimSource/${HID_UTIL_DIR}/IOHIDElement_.c
131 LangPrimSource/${HID_UTIL_DIR}/IOHIDDevice_.c
136 list(APPEND sclang_sources LangPrimSource/SC_AlsaMIDI.cpp)
138 list(APPEND sclang_sources LangPrimSource/SC_LID.cpp)
139 add_definitions(-DHAVE_LID)
145 include_directories (../platform/windows/compat_stuff)
146 list(APPEND sclang_sources ../platform/windows/compat_stuff/getopt.c)
148 include_directories (${PORTMIDI_INCLUDE_DIRS})
149 add_definitions(-DHAVE_PORTMIDI)
150 list(APPEND sclang_sources LangPrimSource/SC_PortMidi.cpp)
155 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
157 find_package(Bluetooth)
159 if (BLUETOOTH_FOUND AND CWIID_FOUND)
160 add_definitions(-DHAVE_WII)
161 include_directories(${CWIID_INCLUDE_DIRS} ${BLUETOOTH_INCLUDE_DIRS})
162 message(STATUS "Compiling with WiiMote support")
164 message(SEND_ERROR "Cannot find libcwiid or libbluetooth")
167 add_definitions(-DHAVE_WII)
168 list(APPEND sclang_sources LangPrimSource/WiiMote_OSX/wiiremote.c)
169 include_directories(LangPrimSource/WiiMote_OSX)
173 include(../SCDoc/CMakeLists.txt)
174 list(APPEND sclang_sources ${SCDOC_SRCS})
177 add_definitions(-DSC_IDE)
178 list(APPEND sclang_sources ../editors/sc-ide/primitives/sc_ipc_client.cpp)
182 set(QT_COLLIDER_LANG_CLIENT ON)
183 include(../QtCollider/CMakeLists.txt)
184 list(APPEND sclang_sources ${QT_COLLIDER_SRCS})
187 if(0 AND FINAL_BUILD) # sclang final-builds are broken
188 CREATE_FINAL_FILE(libsclang_final.cpp ${sclang_sources})
189 add_library(libsclang STATIC libsclang_final.cpp ${sclang_parser_source})
191 add_library(libsclang STATIC ${sclang_sources} ${sclang_parser_source})
194 set_property(TARGET libsclang
196 PROPERTY COMPILE_DEFINITIONS BUILDING_SUPERCOLLIDER)
199 if (BLUETOOTH_FOUND AND CWIID_FOUND)
200 target_link_libraries(libsclang ${BLUETOOTH_LIBRARIES} ${CWIID_LIBRARIES})
202 target_link_libraries(libsclang "-framework IOBluetooth")
207 target_link_libraries(libsclang ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
211 target_link_libraries(libsclang libscsynth)
213 set_property(TARGET libsclang
215 PROPERTY COMPILE_DEFINITIONS NO_INTERNAL_SERVER
220 set_property(TARGET libsclang
221 PROPERTY OUTPUT_NAME sclang)
224 ## external libraries
226 message(STATUS "Compiling with Readline support")
227 set_property(TARGET libsclang
229 PROPERTY COMPILE_DEFINITIONS HAVE_READLINE)
230 include_directories(${READLINE_INCLUDE_DIR})
231 target_link_libraries(libsclang ${READLINE_LIBRARY})
232 endif(READLINE_FOUND)
235 target_link_libraries(libsclang "-framework Carbon")
236 target_link_libraries(libsclang "-framework CoreAudio")
237 target_link_libraries(libsclang "-framework CoreMIDI")
238 target_link_libraries(libsclang "-framework IOKit")
239 target_link_libraries(libsclang "-framework CoreServices")
243 message(STATUS "Compiling with ALSA midi support")
244 set_property(TARGET libsclang
246 PROPERTY COMPILE_DEFINITIONS HAVE_ALSA=1)
247 target_link_libraries(libsclang ${ALSA_LIBRARY})
251 include_directories(${SNDFILE_INCLUDE_DIR})
252 target_link_libraries(libsclang ${SNDFILE_LIBRARIES})
253 elseif(NOT NO_LIBSNDFILE)
254 message(SEND_ERROR "Cannot find libsndfile")
258 include_directories (${FFTW3F_INCLUDE_DIR})
259 target_link_libraries(libsclang ${FFTW3F_LIBRARY})
263 target_link_libraries(libsclang wsock32 ws2_32)
265 target_link_libraries(libsclang ${PORTMIDI_LIBRARIES})
270 add_definitions(-DGC_SANITYCHECK)
273 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
274 target_link_libraries(libsclang rt)
277 target_link_libraries(libsclang ${PTHREADS_LIBRARY} yaml)
280 target_link_libraries(libsclang ${QT_COLLIDER_LIBS})
283 add_executable(sclang LangSource/cmdLineFuncs.cpp)
286 target_link_libraries(sclang libsclang ${Boost_THREAD_LIBRARY})
288 target_link_libraries(sclang libsclang boost_thread)
291 set_property(TARGET sclang
293 PROPERTY COMPILE_DEFINITIONS USE_SC_TERMINAL_CLIENT)
296 set_property(TARGET sclang libsclang
297 APPEND PROPERTY COMPILE_FLAGS "-flto -flto-report")
299 set_property(TARGET sclang libsclang
300 APPEND PROPERTY LINK_FLAGS "-flto -flto-report -fwhole-program")
304 # determines the app name and app install location (scappbundlename, scappdir):
305 include (${CMAKE_SOURCE_DIR}/cmake_modules/MacAppFolder.cmake)
307 install(TARGETS sclang
308 DESTINATION "${scappauxresourcesdir}"
309 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
311 install(TARGETS sclang
312 DESTINATION "SuperCollider"
313 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
315 install(TARGETS sclang
316 RUNTIME DESTINATION "bin"
317 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)