6 include_directories(${CMAKE_SOURCE_DIR}/include/common
7 ${CMAKE_SOURCE_DIR}/include/plugin_interface)
10 include_directories(${CMAKE_SOURCE_DIR}/external_libraries/nova-simd)
11 add_definitions("-DNOVA_SIMD")
15 if (CMAKE_SIZEOF_VOID_P MATCHES "4")
16 execute_process(COMMAND getconf LFS_CFLAGS
17 OUTPUT_VARIABLE LFS_CFLAGS
19 OUTPUT_STRIP_TRAILING_WHITESPACE)
20 elseif(CMAKE_SIZEOF_VOID_P MATCHES "8")
21 execute_process(COMMAND getconf LFS64_CFLAGS
22 OUTPUT_VARIABLE LFS_CFLAGS
24 OUTPUT_STRIP_TRAILING_WHITESPACE)
27 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LFS_CFLAGS}")
44 PhysicalModelingUGens.cpp
56 set(supernova_plugins "")
58 set(CMAKE_SHARED_MODULE_PREFIX "")
60 set(CMAKE_SHARED_MODULE_SUFFIX ".scx")
63 if (${CMAKE_COMPILER_IS_GNUCXX})
64 add_definitions(-fno-finite-math-only)
65 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions")
67 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
71 foreach(plugin ${plugin_sources})
72 string(REPLACE .cpp "" plugin_name ${plugin} )
73 add_library(${plugin_name} MODULE ${plugin})
74 list(APPEND plugins ${plugin_name})
77 set(uiugens MouseUGens KeyboardUGens)
81 include_directories (../../platform/windows/compat_stuff) # for stdbool.h
85 add_library(FFT_UGens MODULE
89 PartitionedConvolution.cpp
90 ${scplugin_common_sources}
93 add_library(PV_ThirdParty MODULE
95 FFT2InterfaceTable.cpp
98 ${scplugin_common_sources}
101 add_library(ML_UGens MODULE
111 ${scplugin_common_sources}
114 if(NOT NO_LIBSNDFILE)
115 set(diskio_sources DiskIO_UGens.cpp)
117 add_library(DiskIO_UGens MODULE ${diskio_sources})
120 include_directories(${SNDFILE_INCLUDE_DIR})
121 target_link_libraries(DiskIO_UGens ${SNDFILE_LIBRARIES} ${MATH_LIBRARY} ${PTHREADS_LIBRARY})
123 list(APPEND plugins DiskIO_UGens)
125 message(SEND_ERROR "Cannot find libsndfile")
129 set(fft_ugens FFT_UGens PV_ThirdParty ML_UGens)
130 list(APPEND plugins FFT_UGens PV_ThirdParty ML_UGens)
133 include_directories (${FFTW3F_INCLUDE_DIR})
137 foreach(plugin ${plugin_sources})
138 string(REPLACE .cpp "_supernova" plugin_name ${plugin} )
139 add_library(${plugin_name} MODULE ${plugin})
140 list(APPEND supernova_plugins ${plugin_name})
141 set_property(TARGET ${plugin_name}
142 APPEND PROPERTY COMPILE_DEFINITIONS "SUPERNOVA")
145 list(APPEND uiugens KeyboardUGens_supernova MouseUGens_supernova)
147 add_library(FFT_UGens_supernova MODULE
148 FFTInterfaceTable.cpp
151 PartitionedConvolution.cpp
152 ${scplugin_common_sources}
155 add_library(PV_ThirdParty_supernova MODULE
157 FFT2InterfaceTable.cpp
160 ${scplugin_common_sources}
163 add_library(ML_UGens_supernova MODULE
173 ${scplugin_common_sources}
176 set_property(TARGET FFT_UGens_supernova PV_ThirdParty_supernova ML_UGens_supernova
177 APPEND PROPERTY COMPILE_DEFINITIONS "SUPERNOVA")
179 list(APPEND fft_ugens FFT_UGens_supernova PV_ThirdParty_supernova ML_UGens_supernova)
180 list(APPEND supernova_plugins FFT_UGens_supernova PV_ThirdParty_supernova ML_UGens_supernova)
182 if(NOT NO_LIBSNDFILE)
183 add_library(DiskIO_UGens_supernova MODULE
185 set_property(TARGET DiskIO_UGens_supernova
186 APPEND PROPERTY COMPILE_DEFINITIONS "SUPERNOVA")
189 include_directories(${SNDFILE_INCLUDE_DIR})
190 target_link_libraries(DiskIO_UGens_supernova ${SNDFILE_LIBRARIES} ${MATH_LIBRARY} ${PTHREADS_LIBRARY})
191 list(APPEND supernova_plugins DiskIO_UGens_supernova)
193 message(SEND_ERROR "Cannot find libsndfile")
198 foreach(ugen ${fft_ugens})
199 target_link_libraries(${ugen} ${MATH_LIBRARY})
202 target_link_libraries(${ugen} "-framework vecLib")
206 foreach (ugen ${uiugens})
207 target_link_libraries(${ugen} ${PTHREADS_LIBRARY})
210 foreach (plugin ${plugins})
212 target_link_libraries(${plugin} wsock32 ws2_32)
217 if (CMAKE_SYSTEM_NAME MATCHES "Linux")
218 find_package(X11 REQUIRED)
220 if (NOT X11_Xt_FOUND)
221 message(FATAL_ERROR "libxt not found")
224 include_directories(X11_Xt_INCLUDE_PATH)
226 foreach (ugen ${uiugens})
227 target_link_libraries(${ugen} ${X11_X11_LIB})
230 foreach (ugen ${uiugens})
231 target_link_libraries(${ugen} "-framework CoreServices -framework Carbon")
234 if(NOT NO_LIBSNDFILE)
235 target_link_libraries(DiskIO_UGens "-framework CoreServices")
238 add_definitions("-DSC_DARWIN")
242 # determines the app name and app install location (scappbundlename, scappdir):
243 include (${CMAKE_SOURCE_DIR}/cmake_modules/MacAppFolder.cmake)
245 install(TARGETS ${plugins}
246 DESTINATION "${scappauxresourcesdir}/plugins"
247 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
250 install(TARGETS ${plugins}
251 DESTINATION "SuperCollider/plugins"
252 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
254 install(TARGETS ${plugins}
255 DESTINATION "lib/SuperCollider/plugins"
256 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
259 install(TARGETS ${supernova_plugins}
260 DESTINATION "lib/supernova/plugins"
261 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)