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/boost
7 ${CMAKE_SOURCE_DIR}/external_libraries/threadpool
8 ${CMAKE_SOURCE_DIR}/external_libraries/yaml-cpp-0.2.6/include
9 ${CMAKE_SOURCE_DIR}/external_libraries/TLSF-2.4.6/src
13 include_directories("LangPrimSource/${HID_UTIL_DIR}")
14 elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
18 find_package(Readline 5.0)
23 LangPrimSource/SC_Wii.cpp
24 LangPrimSource/PyrSignalPrim.cpp
25 LangPrimSource/PyrSched.cpp
26 LangPrimSource/PyrPrimitive.cpp
27 LangPrimSource/PyrMathPrim.cpp
28 LangPrimSource/SC_ComPort.cpp
29 LangPrimSource/OSCData.cpp
30 LangPrimSource/PyrArchiver.cpp
31 LangPrimSource/PyrArrayPrimitives.cpp
32 LangPrimSource/PyrBitPrim.cpp
33 LangPrimSource/PyrCharPrim.cpp
34 LangPrimSource/PyrFilePrim.cpp
35 LangPrimSource/PyrListPrim.cpp
36 LangPrimSource/PyrPlatformPrim.cpp
37 LangPrimSource/PyrStringPrim.cpp
38 LangPrimSource/PyrSymbolPrim.cpp
39 LangPrimSource/PyrUnixPrim.cpp
40 LangSource/AdvancingAllocPool.cpp
41 LangSource/ByteCodeArray.cpp
42 LangSource/DumpParseNode.cpp
44 LangSource/InitAlloc.cpp
45 LangSource/PyrFileUtils.cpp
46 LangSource/PyrInterpreter3.cpp
47 LangSource/PyrLexer.cpp
48 LangSource/PyrMathOps.cpp
49 LangSource/PyrMathSupport.cpp
50 LangSource/PyrMessage.cpp
51 LangSource/PyrObject.cpp
52 LangSource/PyrParseNode.cpp
53 LangSource/PyrSignal.cpp
54 LangSource/PyrSymbolTable.cpp
55 LangSource/SC_LanguageClient.cpp
56 LangSource/SC_LibraryConfig.cpp
57 LangSource/SC_TerminalClient.cpp
59 LangSource/SimpleStack.cpp
60 LangSource/VMGlobals.cpp
61 LangSource/dumpByteCodes.cpp
63 ${CMAKE_SOURCE_DIR}/common/fftlib.c
64 ${CMAKE_SOURCE_DIR}/common/SC_AllocPool.cpp
65 ${CMAKE_SOURCE_DIR}/common/SC_DirUtils.cpp
66 ${CMAKE_SOURCE_DIR}/common/SC_Sem.cpp
67 ${CMAKE_SOURCE_DIR}/common/SC_StandAloneInfo_Darwin.cpp
68 ${CMAKE_SOURCE_DIR}/common/SC_StringBuffer.cpp
69 ${CMAKE_SOURCE_DIR}/common/SC_StringParser.cpp
70 ${CMAKE_SOURCE_DIR}/common/scsynthsend.cpp
71 ${CMAKE_SOURCE_DIR}/common/sc_popen.cpp
74 file(GLOB boost_system_sources ../external_libraries/boost/libs/system/src/*cpp)
75 file(GLOB boost_fs_sources ../external_libraries/boost/libs/filesystem/v3/src/*cpp)
76 file(GLOB boost_regex_sources ../external_libraries/boost/libs/regex/src/*cpp)
77 list(APPEND sclang_sources ${boost_fs_sources} ${boost_system_sources} ${boost_regex_sources})
79 file(GLOB yaml_sources ../external_libraries/yaml-cpp-0.2.6/src/*cpp)
80 list(APPEND sclang_sources ${yaml_sources})
83 list(APPEND sclang_sources LangPrimSource/PyrSerialPrim.cpp)
87 list(APPEND sclang_sources ${CMAKE_SOURCE_DIR}/common/SC_Win32Utils.cpp)
91 include_directories(../platform/windows/compat_stuff)
92 list(APPEND sclang_sources ../platform/windows/compat_stuff/getopt.c)
95 set(sclang_parser_source LangSource/Bison/lang11d_tab.cpp)
97 add_definitions(-DYYSTACK_USE_ALLOCA)
101 list(APPEND sclang_sources
102 LangPrimSource/WiiMote_OSX/wiiremote.c
103 LangPrimSource/SC_HID.cpp
104 LangPrimSource/${HID_UTIL_DIR}/HID_Utilities.c
105 LangPrimSource/${HID_UTIL_DIR}/HID_Name_Lookup.c
106 LangPrimSource/${HID_UTIL_DIR}/HID_Queue_Utilities.c
107 LangPrimSource/${HID_UTIL_DIR}/HID_Error_Handler.c
108 LangPrimSource/SC_CoreMIDI.cpp
109 LangPrimSource/SC_CoreAudioPrim.cpp
110 LangPrimSource/SC_Speech.M
112 add_definitions(-DHAVE_SPEECH)
113 if (CMAKE_COMPILER_IS_GNUCXX)
114 set_source_files_properties(LangPrimSource/SC_Speech.M
115 PROPERTIES COMPILE_FLAGS "-x objective-c++ -fobjc-exceptions")
117 if(NOT (HID_UTIL_DIR MATCHES "HID_Utilities_10_4"))
118 list(APPEND sclang_sources
119 LangPrimSource/${HID_UTIL_DIR}/IOHIDElement_.c
120 LangPrimSource/${HID_UTIL_DIR}/IOHIDDevice_.c
125 list(APPEND sclang_sources LangPrimSource/SC_AlsaMIDI.cpp)
127 list(APPEND sclang_sources LangPrimSource/SC_LID.cpp)
128 add_definitions(-DHAVE_LID)
134 include_directories (../platform/windows/compat_stuff)
135 list(APPEND sclang_sources ../platform/windows/compat_stuff/getopt.c)
139 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
141 find_package(Bluetooth)
143 if (BLUETOOTH_FOUND AND CWIID_FOUND)
144 add_definitions(-DHAVE_WII)
145 include_directories(${CWIID_INCLUDE_DIRS} ${BLUETOOTH_INCLUDE_DIRS})
146 message(STATUS "Compiling with WiiMote support")
148 message(SEND_ERROR "Cannot find libcwiid or libbluetooth")
151 add_definitions(-DHAVE_WII)
152 list(APPEND sclang_sources LangPrimSource/WiiMote_OSX/wiiremote.c)
153 include_directories(LangPrimSource/WiiMote_OSX)
158 set(QT_COLLIDER_LANG_CLIENT ON)
159 include(../QtCollider/CMakeLists.txt)
160 list(APPEND sclang_sources ${QT_COLLIDER_SRCS})
163 if(0 AND FINAL_BUILD) # sclang final-builds are broken
164 CREATE_FINAL_FILE(libsclang_final.cpp ${sclang_sources})
165 add_library(libsclang SHARED libsclang_final.cpp ${sclang_parser_source})
167 add_library(libsclang STATIC ${sclang_sources} ${sclang_parser_source})
170 set_property(TARGET libsclang
172 PROPERTY COMPILE_DEFINITIONS BUILDING_SUPERCOLLIDER)
175 if (BLUETOOTH_FOUND AND CWIID_FOUND)
176 target_link_libraries(libsclang ${BLUETOOTH_LIBRARIES} ${CWIID_LIBRARIES})
178 target_link_libraries(libsclang "-framework IOBluetooth")
183 target_link_libraries(libsclang libscsynth)
185 set_property(TARGET libsclang
187 PROPERTY COMPILE_DEFINITIONS NO_INTERNAL_SERVER
192 set_property(TARGET libsclang
193 PROPERTY OUTPUT_NAME sclang)
196 ## external libraries
198 message(STATUS "Compiling with Readline support")
199 set_property(TARGET libsclang
201 PROPERTY COMPILE_DEFINITIONS HAVE_READLINE)
202 target_link_libraries(libsclang ${READLINE_LIBRARY})
203 endif(READLINE_FOUND)
206 target_link_libraries(libsclang "-framework Carbon")
207 target_link_libraries(libsclang "-framework CoreAudio")
208 target_link_libraries(libsclang "-framework CoreMIDI")
209 target_link_libraries(libsclang "-framework IOKit")
210 target_link_libraries(libsclang "-framework CoreServices")
214 message(STATUS "Compiling with ALSA midi support")
215 set_property(TARGET libsclang
217 PROPERTY COMPILE_DEFINITIONS HAVE_ALSA=1)
218 target_link_libraries(libsclang ${ALSA_LIBRARY})
222 include_directories(${SNDFILE_INCLUDE_DIR})
223 target_link_libraries(libsclang ${SNDFILE_LIBRARIES})
224 elseif(NOT NO_LIBSNDFILE)
225 message(SEND_ERROR "Cannot find libsndfile")
229 include_directories (${FFTW3F_INCLUDE_DIR})
230 target_link_libraries(libsclang ${FFTW3F_LIBRARY})
234 target_link_libraries(libsclang wsock32 ws2_32)
238 add_definitions(-DGC_SANITYCHECK)
241 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
242 target_link_libraries(libsclang rt)
245 target_link_libraries(libsclang ${PTHREADS_LIBRARY} supercollider_boost_thread)
248 target_link_libraries(libsclang ${QT_COLLIDER_LIBS})
251 add_executable(sclang LangSource/cmdLineFuncs.cpp)
252 target_link_libraries(sclang libsclang boost_thread)
254 set_property(TARGET sclang
256 PROPERTY COMPILE_DEFINITIONS USE_SC_TERMINAL_CLIENT)
259 set_property(TARGET sclang libsclang
260 APPEND PROPERTY COMPILE_FLAGS "-flto -flto-report")
262 set_property(TARGET sclang libsclang
263 APPEND PROPERTY LINK_FLAGS "-flto -flto-report -fwhole-program")
267 # determines the app name and app install location (scappbundlename, scappdir):
268 include (${CMAKE_SOURCE_DIR}/cmake_modules/MacAppFolder.cmake)
270 install(TARGETS sclang
271 DESTINATION "${scappauxresourcesdir}"
272 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
274 install(TARGETS sclang
275 DESTINATION "SuperCollider"
276 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
278 install(TARGETS sclang
279 LIBRARY DESTINATION "lib"
280 RUNTIME DESTINATION "bin"
281 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)