sclang: ServerShmInterface - avoid object duplication in deepCopy
[supercollider.git] / external_libraries / CMakeLists.txt
bloba89f490c59b843b8806509bd7153a97a461ad262
1 if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/nova-simd/vec.hpp)
2     message(FATAL_ERROR "nova-simd submodule is missing: please run `git submodule init && git submodule update' from the toplevel of your git working tree")
3 endif()
5 # boost thread
6 aux_source_directory(boost/libs/thread/src/ boost_thread_src )
8 include_directories(boost)
10 if(WIN32)
11         aux_source_directory(boost/libs/thread/src/win32/ boost_thread_platform )
12         add_definitions(-DBOOST_THREAD_BUILD_DLL)
13 elseif(PTHREADS_FOUND)
14         aux_source_directory(boost/libs/thread/src/pthread/ boost_thread_platform )
15 else()
16         message(SEND_ERROR "we need to implement boost_thread")
17 endif()
19 include_directories(${PTHREADS_INCLUDE_DIR})
21 if (SUPERNOVA)
22         aux_source_directory(boost/libs/program_options/src/ boost_program_options )
23         add_library(boost_program_options STATIC ${boost_program_options})
25         aux_source_directory(boost/libs/system/src/ boost_system )
26         add_library(boost_system STATIC ${boost_system})
28         aux_source_directory(boost/libs/filesystem/v3/src boost_filesystem_v3)
29         add_library(boost_filesystem STATIC ${boost_filesystem_v2} ${boost_filesystem_v3})
32         #oscpack
33         add_library(oscpack STATIC "oscpack_build.cpp")
35         #tlsf
36         add_library(tlsf STATIC "TLSF-2.4.6/src/tlsf.c")
37         set_target_properties(tlsf
38                                                 PROPERTIES COMPILE_DEFINITIONS TLSF_STATISTIC=1)
41         if(LTO)
42                 set_property(TARGET boost_program_options boost_system boost_filesystem oscpack tlsf
43                                         APPEND PROPERTY COMPILE_FLAGS "-flto -flto-report")
45                 set_property(TARGET boost_program_options boost_system boost_filesystem oscpack tlsf
46                                         APPEND PROPERTY LINK_FLAGS "-flto -flto-report")
47         endif()
48 endif()
50 if (${DSO_VISIBILITY})
51         remove_definitions(-fvisibility=hidden)
52 endif()
54 add_library(boost_thread STATIC ${boost_thread_src} ${boost_thread_platform})
56 add_library(supercollider_boost_thread SHARED ${boost_thread_src} ${boost_thread_platform})
57 target_link_libraries(supercollider_boost_thread ${PTHREADS_LIBRARY})
59 if(LTO)
60         set_property(TARGET boost_thread supercollider_boost_thread
61                                 APPEND PROPERTY COMPILE_FLAGS "-flto -flto-report")
63         set_property(TARGET boost_thread supercollider_boost_thread
64                                 APPEND PROPERTY LINK_FLAGS "-flto -flto-report")
65 endif()
68 if(APPLE)
69         # determines the app name and app install location (scappbundlename, scappdir):
70         include (${CMAKE_SOURCE_DIR}/cmake_modules/MacAppFolder.cmake)
72         install(TARGETS supercollider_boost_thread
73                         DESTINATION "${scappauxresourcesdir}"
74                         PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
75                         COMPONENT app)
76 elseif(WIN32)
77         install(TARGETS supercollider_boost_thread
78                         DESTINATION "SuperCollider"
79                         PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
80 else()
81         install(TARGETS supercollider_boost_thread
82                         LIBRARY DESTINATION "lib"
83                         RUNTIME DESTINATION "bin"
84                         PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
85 endif()