updated Plotter.schelp for plot2 -> plot changes
[supercollider.git] / external_libraries / CMakeLists.txt
blob8d83be32136e9d7e90e05200bb634690bb7c3ffe
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         include (${CMAKE_SOURCE_DIR}/cmake_modules/MacAppFolder.cmake)
70         install(TARGETS supercollider_boost_thread
71                         LIBRARY DESTINATION "${scappauxresourcesdir}/../MacOS"
72                         PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
73 elseif(WIN32)
74         install(TARGETS supercollider_boost_thread
75                         DESTINATION "SuperCollider"
76                         PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
77 else()
78         install(TARGETS supercollider_boost_thread
79                         LIBRARY DESTINATION "lib"
80                         RUNTIME DESTINATION "bin"
81                         PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
82 endif()