5 add_definitions("-DSC_FFT_FFTW")
6 include_directories (${FFTW3F_INCLUDE_DIR})
8 message(SEND_ERROR "Cannot find libfftw3f")
13 if(CMAKE_COMPILER_IS_GNUCXX)
14 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-4096")
15 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer")
18 if (CMAKE_SIZEOF_VOID_P MATCHES "4")
19 # cmpxchg8b is available on all intel apples
20 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686 -msse -msse2 -mfpmath=sse")
23 endif(CMAKE_COMPILER_IS_GNUCXX)
26 set_property(DIRECTORY .
28 PROPERTY COMPILE_DEFINITIONS_DEBUG NOVA_MEMORY_DEBUGGING)
33 include_directories(${CMAKE_SOURCE_DIR}/external_libraries/boost_endian
34 ${CMAKE_SOURCE_DIR}/external_libraries/oscpack
35 ${CMAKE_SOURCE_DIR}/external_libraries/TLSF-2.4.6/src
39 include_directories(${CMAKE_SOURCE_DIR}/external_libraries/libsndfile)
42 include_directories(${CMAKE_SOURCE_DIR}/include/plugin_interface
43 ${CMAKE_SOURCE_DIR}/include/server
44 ${CMAKE_SOURCE_DIR}/include/common
49 sc/sc_synth_prototype.cpp
51 sc/sc_plugin_interface.cpp
54 sc/sc_ugen_factory.cpp
56 ${CMAKE_SOURCE_DIR}/common/SC_fftlib.cpp
57 ${CMAKE_SOURCE_DIR}/common/SC_DirUtils.cpp
58 ${CMAKE_SOURCE_DIR}/common/SC_StandAloneInfo_Darwin.cpp
59 server/buffer_manager.cpp
60 server/dsp_context.cpp
61 server/memory_pool.cpp
64 server/server_args.cpp
67 file(GLOB_RECURSE supernova_headers *hpp)
70 CREATE_FINAL_FILE(libsupernova_final.cpp ${libsupernova_src})
71 add_library (libsupernova STATIC libsupernova_final.cpp)
73 add_library (libsupernova STATIC ${libsupernova_src})
76 set_property(TARGET libsupernova
77 PROPERTY OUTPUT_NAME supernova)
79 add_executable(supernova server/main.cpp ${supernova_headers})
81 set_property(TARGET libsupernova supernova
83 PROPERTY COMPILE_DEFINITIONS SUPERNOVA)
85 find_library(DL NAMES dl)
87 set_property(TARGET libsupernova
89 PROPERTY COMPILE_DEFINITIONS DLOPEN)
90 target_link_libraries(libsupernova ${DL})
94 find_package(Portaudio)
95 if(NOT PORTAUDIO_FOUND)
96 message(FATAL_ERROR "Portaudio missing")
98 add_definitions(-DPORTAUDIO_BACKEND ${PORTAUDIO_DEFINITIONS})
99 include_directories(${PORTAUDIO_INCLUDE_DIRS})
100 target_link_libraries(libsupernova ${PORTAUDIO_LIBRARIES})
102 find_library(JACK NAMES jack)
104 set_property(TARGET libsupernova supernova
106 PROPERTY COMPILE_DEFINITIONS JACK_BACKEND)
107 target_link_libraries(libsupernova ${JACK})
108 include_directories(${JACK_INCLUDE_DIRS})
112 find_package(Sndfile)
113 if (NOT SNDFILE_FOUND)
114 message(SEND_ERROR "Cannot find libsndfile")
116 target_link_libraries(libsupernova ${SNDFILE_LIBRARIES})
117 include_directories(${SNDFILE_INCLUDE_DIR})
121 target_link_libraries(libsupernova ${FFTW3F_LIBRARY})
124 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
125 target_link_libraries(libsupernova rt)
128 target_link_libraries(libsupernova oscpack tlsf ${PTHREADS_LIBRARIES})
131 target_link_libraries(libsupernova ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
133 target_link_libraries(libsupernova boost_thread boost_system boost_filesystem boost_program_options)
136 target_link_libraries(supernova libsupernova)
139 # determines the app name and app install location (scappbundlename, scappdir):
140 include (${CMAKE_SOURCE_DIR}/cmake_modules/MacAppFolder.cmake)
142 install(TARGETS supernova
143 DESTINATION ${scappauxresourcesdir}
144 PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE OWNER_WRITE)
147 install(TARGETS supernova
149 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
153 set_property(TARGET supernova libsupernova
154 APPEND PROPERTY COMPILE_FLAGS "-flto -flto-report")
156 set_property(TARGET supernova libsupernova
157 APPEND PROPERTY LINK_FLAGS "-flto -flto-report -fwhole-program")
161 target_link_libraries(libsupernova "-framework vecLib")
162 target_link_libraries(libsupernova "-framework CoreAudio -framework CoreServices")