2 add_definitions("-DSC_FFT_GREEN")
4 add_definitions("-DSC_FFT_VDSP")
6 find_package(FFTW3f 3.3)
8 add_definitions("-DSC_FFT_FFTW")
10 message(SEND_ERROR "Cannot find libfftw3f")
14 if(CMAKE_COMPILER_IS_GNUCXX)
15 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-4096")
16 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer")
19 if (CMAKE_SIZEOF_VOID_P MATCHES "4")
20 # cmpxchg8b is available on all intel apples
21 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686 -msse -msse2 -mfpmath=sse")
24 endif(CMAKE_COMPILER_IS_GNUCXX)
27 if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_INTEL OR CMAKE_COMPILER_IS_CLANG)
28 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
30 message(FATAL_ERROR "unknown compiler. supernova cannot be compiled")
34 set_property(DIRECTORY .
36 PROPERTY COMPILE_DEFINITIONS_DEBUG NOVA_MEMORY_DEBUGGING)
40 add_definitions(-DNOVA_SIMD)
44 include_directories(${CMAKE_SOURCE_DIR}/external_libraries/boost_endian
45 ${CMAKE_SOURCE_DIR}/external_libraries/oscpack
46 ${CMAKE_SOURCE_DIR}/external_libraries/TLSF-2.4.6/src
50 include_directories(${CMAKE_SOURCE_DIR}/external_libraries/libsndfile)
53 include_directories(${CMAKE_SOURCE_DIR}/include/plugin_interface
54 ${CMAKE_SOURCE_DIR}/include/server
55 ${CMAKE_SOURCE_DIR}/include/common
60 sc/sc_synth_prototype.cpp
62 sc/sc_plugin_interface.cpp
65 sc/sc_ugen_factory.cpp
67 ${CMAKE_SOURCE_DIR}/common/SC_fftlib.cpp
68 ${CMAKE_SOURCE_DIR}/common/SC_DirUtils.cpp
69 ${CMAKE_SOURCE_DIR}/common/SC_StandAloneInfo_Darwin.cpp
70 server/buffer_manager.cpp
71 server/dsp_context.cpp
72 server/memory_pool.cpp
75 server/server_args.cpp
79 list(APPEND libsupernova_src ../../common/fftlib.c)
82 file(GLOB_RECURSE supernova_headers *hpp)
85 CREATE_FINAL_FILE(libsupernova_final.cpp ${libsupernova_src})
86 add_library (libsupernova STATIC libsupernova_final.cpp)
88 add_library (libsupernova STATIC ${libsupernova_src})
91 set_property(TARGET libsupernova
92 PROPERTY OUTPUT_NAME supernova)
94 add_executable(supernova server/main.cpp ${supernova_headers})
96 set_property(TARGET libsupernova supernova
98 PROPERTY COMPILE_DEFINITIONS SUPERNOVA)
100 find_library(DL NAMES dl)
102 set_property(TARGET libsupernova
104 PROPERTY COMPILE_DEFINITIONS DLOPEN)
105 target_link_libraries(libsupernova ${DL})
109 find_package(Portaudio)
110 if(NOT PORTAUDIO_FOUND)
111 message(FATAL_ERROR "Portaudio missing")
113 add_definitions(-DPORTAUDIO_BACKEND ${PORTAUDIO_DEFINITIONS})
114 include_directories(${PORTAUDIO_INCLUDE_DIRS})
115 target_link_libraries(libsupernova ${PORTAUDIO_LIBRARIES})
117 find_library(JACK NAMES jack)
119 set_property(TARGET libsupernova supernova
121 PROPERTY COMPILE_DEFINITIONS JACK_BACKEND)
122 target_link_libraries(libsupernova ${JACK})
123 include_directories(${JACK_INCLUDE_DIRS})
127 find_package(Sndfile)
128 if (NOT SNDFILE_FOUND)
129 message(SEND_ERROR "Cannot find libsndfile")
131 target_link_libraries(libsupernova ${SNDFILE_LIBRARIES})
132 include_directories(${SNDFILE_INCLUDE_DIR})
136 target_link_libraries(libsupernova ${FFTW3F_LIBRARY})
139 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
140 target_link_libraries(libsupernova rt)
143 target_link_libraries(libsupernova oscpack tlsf ${PTHREADS_LIBRARIES})
146 target_link_libraries(libsupernova ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
148 target_link_libraries(libsupernova boost_system boost_filesystem boost_program_options)
151 target_link_libraries(supernova libsupernova)
154 # determines the app name and app install location (scappbundlename, scappdir):
155 include (${CMAKE_SOURCE_DIR}/cmake_modules/MacAppFolder.cmake)
157 install(TARGETS supernova
158 DESTINATION ${sclangauxresourcesdir}
159 PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE OWNER_WRITE)
162 install(TARGETS supernova
164 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
168 set_property(TARGET supernova libsupernova
169 APPEND PROPERTY COMPILE_FLAGS "-flto -flto-report")
171 set_property(TARGET supernova libsupernova
172 APPEND PROPERTY LINK_FLAGS "-flto -flto-report -fwhole-program")
176 target_link_libraries(libsupernova "-framework vecLib")
177 target_link_libraries(libsupernova "-framework CoreAudio -framework CoreServices")