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}/common
7 ${CMAKE_SOURCE_DIR}/external_libraries/boost-lockfree
8 ${CMAKE_SOURCE_DIR}/external_libraries/threadpool
9 ${CMAKE_SOURCE_DIR}/external_libraries/yaml-cpp-0.3.0/include
10 ${CMAKE_SOURCE_DIR}/external_libraries/TLSF-2.4.6/src
14 include_directories(${Boost_INCLUDE_DIRS})
16 include_directories(${CMAKE_SOURCE_DIR}/external_libraries/boost)
20 include_directories("LangPrimSource/${HID_UTIL_DIR}")
21 elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
24 find_package(Portmidi)
27 find_package(Readline 5.0)
32 LangPrimSource/SC_Wii.cpp
33 LangPrimSource/PyrSignalPrim.cpp
34 LangPrimSource/PyrSched.cpp
35 LangPrimSource/PyrPrimitive.cpp
36 LangPrimSource/PyrMathPrim.cpp
37 LangPrimSource/SC_ComPort.cpp
38 LangPrimSource/OSCData.cpp
39 LangPrimSource/PyrArchiver.cpp
40 LangPrimSource/PyrArrayPrimitives.cpp
41 LangPrimSource/PyrBitPrim.cpp
42 LangPrimSource/PyrCharPrim.cpp
43 LangPrimSource/PyrFilePrim.cpp
44 LangPrimSource/PyrListPrim.cpp
45 LangPrimSource/PyrPlatformPrim.cpp
46 LangPrimSource/PyrStringPrim.cpp
47 LangPrimSource/PyrSymbolPrim.cpp
48 LangPrimSource/PyrUnixPrim.cpp
49 LangSource/AdvancingAllocPool.cpp
50 LangSource/ByteCodeArray.cpp
51 LangSource/DumpParseNode.cpp
53 LangSource/InitAlloc.cpp
54 LangSource/PyrInterpreter3.cpp
55 LangSource/PyrLexer.cpp
56 LangSource/PyrMathOps.cpp
57 LangSource/PyrMathSupport.cpp
58 LangSource/PyrMessage.cpp
59 LangSource/PyrObject.cpp
60 LangSource/PyrParseNode.cpp
61 LangSource/PyrSignal.cpp
62 LangSource/PyrSymbolTable.cpp
63 LangSource/SC_LanguageClient.cpp
64 LangSource/SC_LibraryConfig.cpp
65 LangSource/SC_TerminalClient.cpp
67 LangSource/SimpleStack.cpp
68 LangSource/VMGlobals.cpp
69 LangSource/dumpByteCodes.cpp
71 ${CMAKE_SOURCE_DIR}/common/fftlib.c
72 ${CMAKE_SOURCE_DIR}/common/SC_AllocPool.cpp
73 ${CMAKE_SOURCE_DIR}/common/SC_DirUtils.cpp
74 ${CMAKE_SOURCE_DIR}/common/SC_Reply.cpp
75 ${CMAKE_SOURCE_DIR}/common/SC_Sem.cpp
76 ${CMAKE_SOURCE_DIR}/common/SC_StandAloneInfo_Darwin.cpp
77 ${CMAKE_SOURCE_DIR}/common/SC_StringBuffer.cpp
78 ${CMAKE_SOURCE_DIR}/common/SC_StringParser.cpp
79 ${CMAKE_SOURCE_DIR}/common/SC_TextUtils.cpp
81 ${CMAKE_SOURCE_DIR}/common/scsynthsend.cpp
82 ${CMAKE_SOURCE_DIR}/common/sc_popen.cpp
86 file(GLOB boost_system_sources ../external_libraries/boost/libs/system/src/*cpp)
87 file(GLOB boost_fs_sources ../external_libraries/boost/libs/filesystem/src/*cpp)
88 file(GLOB boost_regex_sources ../external_libraries/boost/libs/regex/src/*cpp)
89 list(APPEND sclang_sources ${boost_fs_sources} ${boost_system_sources} ${boost_regex_sources})
92 file(GLOB_RECURSE headers ../include/*.h* )
93 file(GLOB_RECURSE external_headers ../external_libraries/*.h* )
94 list(APPEND sclang_sources ${headers} ${external_headers}) # make qt creator happy
97 list(APPEND sclang_sources LangPrimSource/PyrSerialPrim.cpp)
101 list(APPEND sclang_sources ${CMAKE_SOURCE_DIR}/common/SC_Win32Utils.cpp)
105 include_directories(../platform/windows/compat_stuff)
106 list(APPEND sclang_sources ../platform/windows/compat_stuff/getopt.c)
109 set(sclang_parser_source LangSource/Bison/lang11d_tab.cpp)
111 add_definitions(-DYYSTACK_USE_ALLOCA)
115 list(APPEND sclang_sources
116 LangPrimSource/WiiMote_OSX/wiiremote.c
117 LangPrimSource/SC_HID.cpp
118 LangPrimSource/${HID_UTIL_DIR}/HID_Utilities.c
119 LangPrimSource/${HID_UTIL_DIR}/HID_Name_Lookup.c
120 LangPrimSource/${HID_UTIL_DIR}/HID_Queue_Utilities.c
121 LangPrimSource/${HID_UTIL_DIR}/HID_Error_Handler.c
122 LangPrimSource/SC_CoreMIDI.cpp
123 LangPrimSource/SC_CoreAudioPrim.cpp
124 LangPrimSource/SC_Speech.M
126 add_definitions(-DHAVE_SPEECH)
127 if (CMAKE_COMPILER_IS_GNUCXX)
128 set_source_files_properties(LangPrimSource/SC_Speech.M
129 PROPERTIES COMPILE_FLAGS "-x objective-c++ -fobjc-exceptions")
131 if(NOT (HID_UTIL_DIR MATCHES "HID_Utilities_10_4"))
132 list(APPEND sclang_sources
133 LangPrimSource/${HID_UTIL_DIR}/IOHIDElement_.c
134 LangPrimSource/${HID_UTIL_DIR}/IOHIDDevice_.c
139 list(APPEND sclang_sources LangPrimSource/SC_AlsaMIDI.cpp)
141 list(APPEND sclang_sources LangPrimSource/SC_LID.cpp)
142 add_definitions(-DHAVE_LID)
148 include_directories (../platform/windows/compat_stuff)
149 list(APPEND sclang_sources ../platform/windows/compat_stuff/getopt.c)
151 include_directories (${PORTMIDI_INCLUDE_DIRS})
152 add_definitions(-DHAVE_PORTMIDI)
153 list(APPEND sclang_sources LangPrimSource/SC_PortMidi.cpp)
158 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
160 find_package(Bluetooth)
162 if (BLUETOOTH_FOUND AND CWIID_FOUND)
163 add_definitions(-DHAVE_WII)
164 include_directories(${CWIID_INCLUDE_DIRS} ${BLUETOOTH_INCLUDE_DIRS})
165 message(STATUS "Compiling with WiiMote support")
167 message(SEND_ERROR "Cannot find libcwiid or libbluetooth.\n (If Wii support is not required, then set SC_WII=no)")
170 add_definitions(-DHAVE_WII)
171 list(APPEND sclang_sources LangPrimSource/WiiMote_OSX/wiiremote.c)
172 include_directories(LangPrimSource/WiiMote_OSX)
176 include(../SCDoc/CMakeLists.txt)
177 list(APPEND sclang_sources ${SCDOC_SRCS})
180 add_definitions(-DSC_IDE)
181 list(APPEND sclang_sources ../editors/sc-ide/primitives/sc_ipc_client.cpp)
185 set(QT_COLLIDER_LANG_CLIENT ON)
186 include(../QtCollider/CMakeLists.txt)
187 list(APPEND sclang_sources ${QT_COLLIDER_SRCS})
190 if(0 AND FINAL_BUILD) # sclang final-builds are broken
191 CREATE_FINAL_FILE(libsclang_final.cpp ${sclang_sources})
192 add_library(libsclang STATIC libsclang_final.cpp ${sclang_parser_source})
194 add_library(libsclang STATIC ${sclang_sources} ${sclang_parser_source})
197 set_property(TARGET libsclang
199 PROPERTY COMPILE_DEFINITIONS BUILDING_SUPERCOLLIDER)
202 if (BLUETOOTH_FOUND AND CWIID_FOUND)
203 target_link_libraries(libsclang ${BLUETOOTH_LIBRARIES} ${CWIID_LIBRARIES})
205 target_link_libraries(libsclang "-framework IOBluetooth")
210 target_link_libraries(libsclang ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
214 target_link_libraries(libsclang libscsynth)
216 set_property(TARGET libsclang
218 PROPERTY COMPILE_DEFINITIONS NO_INTERNAL_SERVER
223 set_property(TARGET libsclang
224 PROPERTY OUTPUT_NAME sclang)
227 ## external libraries
229 message(STATUS "Compiling with Readline support")
230 set_property(TARGET libsclang
232 PROPERTY COMPILE_DEFINITIONS HAVE_READLINE)
233 include_directories(${READLINE_INCLUDE_DIR})
234 target_link_libraries(libsclang ${READLINE_LIBRARY})
235 endif(READLINE_FOUND)
238 target_link_libraries(libsclang "-framework Carbon")
239 target_link_libraries(libsclang "-framework CoreAudio")
240 target_link_libraries(libsclang "-framework CoreMIDI")
241 target_link_libraries(libsclang "-framework IOKit")
242 target_link_libraries(libsclang "-framework CoreServices")
246 message(STATUS "Compiling with ALSA midi support")
247 set_property(TARGET libsclang
249 PROPERTY COMPILE_DEFINITIONS HAVE_ALSA=1)
250 target_link_libraries(libsclang ${ALSA_LIBRARY})
254 include_directories(${SNDFILE_INCLUDE_DIR})
255 target_link_libraries(libsclang ${SNDFILE_LIBRARIES})
256 elseif(NOT NO_LIBSNDFILE)
257 message(SEND_ERROR "Cannot find libsndfile")
261 include_directories (${FFTW3F_INCLUDE_DIR})
262 target_link_libraries(libsclang ${FFTW3F_LIBRARY})
266 target_link_libraries(libsclang wsock32 ws2_32)
268 target_link_libraries(libsclang ${PORTMIDI_LIBRARIES})
273 add_definitions(-DGC_SANITYCHECK)
276 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
277 target_link_libraries(libsclang rt)
280 target_link_libraries(libsclang ${PTHREADS_LIBRARY} yaml)
283 target_link_libraries(libsclang ${QT_COLLIDER_LIBS})
286 add_executable(sclang LangSource/cmdLineFuncs.cpp)
289 target_link_libraries(sclang libsclang ${Boost_THREAD_LIBRARY})
291 target_link_libraries(sclang libsclang boost_thread)
294 set_property(TARGET sclang
296 PROPERTY COMPILE_DEFINITIONS USE_SC_TERMINAL_CLIENT)
299 set_property(TARGET sclang libsclang
300 APPEND PROPERTY COMPILE_FLAGS "-flto -flto-report")
302 set_property(TARGET sclang libsclang
303 APPEND PROPERTY LINK_FLAGS "-flto -flto-report -fwhole-program")
307 # determines the app name and app install location (scappbundlename, scappdir):
308 include (${CMAKE_SOURCE_DIR}/cmake_modules/MacAppFolder.cmake)
310 install(TARGETS sclang
311 DESTINATION "${scappauxresourcesdir}"
312 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
314 install(TARGETS sclang
315 DESTINATION "SuperCollider"
316 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
318 install(TARGETS sclang
319 RUNTIME DESTINATION "bin"
320 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)