5 add_definitions("-DNO_LIBSNDFILE")
8 include_directories(${CMAKE_SOURCE_DIR}/include/common
9 ${CMAKE_SOURCE_DIR}/include/plugin_interface)
12 include_directories(${CMAKE_SOURCE_DIR}/external_libraries/nova-simd)
13 add_definitions("-DNOVA_SIMD")
17 if (CMAKE_SIZEOF_VOID_P MATCHES "4")
18 execute_process(COMMAND getconf LFS_CFLAGS
19 OUTPUT_VARIABLE LFS_CFLAGS
21 OUTPUT_STRIP_TRAILING_WHITESPACE)
22 elseif(CMAKE_SIZEOF_VOID_P MATCHES "8")
23 execute_process(COMMAND getconf LFS64_CFLAGS
24 OUTPUT_VARIABLE LFS_CFLAGS
26 OUTPUT_STRIP_TRAILING_WHITESPACE)
29 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LFS_CFLAGS}")
46 PhysicalModelingUGens.cpp
57 set(supernova_plugins "")
59 set(CMAKE_SHARED_MODULE_PREFIX "")
61 set(CMAKE_SHARED_MODULE_SUFFIX ".scx")
64 if (${CMAKE_COMPILER_IS_GNUCXX})
65 add_definitions(-fno-finite-math-only)
66 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions")
68 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
72 foreach(plugin ${plugin_sources})
73 string(REPLACE .cpp "" plugin_name ${plugin} )
74 add_library(${plugin_name} MODULE ${plugin})
75 list(APPEND plugins ${plugin_name})
82 include_directories (../../platform/windows/compat_stuff) # for stdbool.h
86 add_library(FFT_UGens MODULE
90 PartitionedConvolution.cpp
91 ${scplugin_common_sources}
94 add_library(PV_ThirdParty MODULE
96 FFT2InterfaceTable.cpp
99 ${scplugin_common_sources}
102 add_library(ML_UGens MODULE
112 ${scplugin_common_sources}
115 if(NOT NO_LIBSNDFILE)
116 set(diskio_sources DiskIO_UGens.cpp)
118 add_library(DiskIO_UGens MODULE ${diskio_sources})
121 include_directories(${SNDFILE_INCLUDE_DIR})
122 target_link_libraries(DiskIO_UGens ${SNDFILE_LIBRARIES} ${MATH_LIBRARY} ${PTHREADS_LIBRARY})
124 list(APPEND plugins DiskIO_UGens)
126 message(SEND_ERROR "Cannot find libsndfile")
130 set(fft_ugens FFT_UGens PV_ThirdParty ML_UGens)
131 list(APPEND plugins FFT_UGens PV_ThirdParty ML_UGens)
134 include_directories (${FFTW3F_INCLUDE_DIR})
138 foreach(plugin ${plugin_sources})
139 string(REPLACE .cpp "_supernova" plugin_name ${plugin} )
140 add_library(${plugin_name} MODULE ${plugin})
141 list(APPEND supernova_plugins ${plugin_name})
142 set_property(TARGET ${plugin_name}
143 APPEND PROPERTY COMPILE_DEFINITIONS "SUPERNOVA")
146 list(APPEND uiugens UIUGens_supernova)
148 add_library(FFT_UGens_supernova MODULE
149 FFTInterfaceTable.cpp
152 PartitionedConvolution.cpp
153 ${scplugin_common_sources}
156 add_library(PV_ThirdParty_supernova MODULE
158 FFT2InterfaceTable.cpp
161 ${scplugin_common_sources}
164 add_library(ML_UGens_supernova MODULE
174 ${scplugin_common_sources}
177 set_property(TARGET FFT_UGens_supernova PV_ThirdParty_supernova ML_UGens_supernova
178 APPEND PROPERTY COMPILE_DEFINITIONS "SUPERNOVA")
180 list(APPEND fft_ugens FFT_UGens_supernova PV_ThirdParty_supernova ML_UGens_supernova)
181 list(APPEND supernova_plugins FFT_UGens_supernova PV_ThirdParty_supernova ML_UGens_supernova)
183 if(NOT NO_LIBSNDFILE)
184 add_library(DiskIO_UGens_supernova MODULE
186 set_property(TARGET DiskIO_UGens_supernova
187 APPEND PROPERTY COMPILE_DEFINITIONS "SUPERNOVA")
190 include_directories(${SNDFILE_INCLUDE_DIR})
191 target_link_libraries(DiskIO_UGens_supernova ${SNDFILE_LIBRARIES} ${MATH_LIBRARY} ${PTHREADS_LIBRARY})
192 list(APPEND supernova_plugins DiskIO_UGens_supernova)
194 message(SEND_ERROR "Cannot find libsndfile")
199 foreach(ugen ${fft_ugens})
200 target_link_libraries(${ugen} ${MATH_LIBRARY})
203 target_link_libraries(${ugen} "-framework vecLib")
207 foreach (ugen ${uiugens})
208 target_link_libraries(${ugen} ${PTHREADS_LIBRARY})
211 foreach (plugin ${plugins})
213 target_link_libraries(${plugin} wsock32 ws2_32)
217 foreach (plugin ${supernova_plugins})
219 target_link_libraries(${plugin} ws2_32)
223 if (CMAKE_SYSTEM_NAME MATCHES "Linux")
224 find_package(X11 REQUIRED)
226 if (NOT X11_Xt_FOUND)
227 message(FATAL_ERROR "libxt not found")
230 include_directories(X11_Xt_INCLUDE_PATH)
232 foreach (ugen ${uiugens})
233 target_link_libraries(${ugen} ${X11_X11_LIB})
236 foreach (ugen ${uiugens})
237 target_link_libraries(${ugen} "-framework CoreServices -framework Carbon")
240 if(NOT NO_LIBSNDFILE)
241 target_link_libraries(DiskIO_UGens "-framework CoreServices")
244 add_definitions("-DSC_DARWIN")
248 # determines the app name and app install location (scappbundlename, scappdir):
249 include (${CMAKE_SOURCE_DIR}/cmake_modules/MacAppFolder.cmake)
251 install(TARGETS ${plugins}
252 DESTINATION "${scappauxresourcesdir}/plugins"
253 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
256 install(TARGETS ${plugins}
257 DESTINATION "SuperCollider/plugins"
258 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
260 install(TARGETS ${plugins}
261 DESTINATION "lib/SuperCollider/plugins"
262 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
265 install(TARGETS ${supernova_plugins}
266 DESTINATION "lib/supernova/plugins"
267 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)