-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
112 lines (87 loc) · 3.29 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
cmake_minimum_required (VERSION 3.13)
set(PROYECTO "DWGReverb")
project (${PROYECTO})
include_directories(${SC_PATH}/include/plugin_interface)
include_directories(${SC_PATH}/include/common)
include_directories(${SC_PATH}/common)
include_directories(${SC_PATH}/external_libraries/libsndfile/)
include_directories(external_libraries/nova-simd)
add_definitions(-DNOVA_SIMD)
set(CMAKE_SHARED_MODULE_PREFIX "")
if(APPLE OR WIN32)
set(CMAKE_SHARED_MODULE_SUFFIX ".scx")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(CMAKE_COMPILER_IS_CLANG 1)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
#add_definitions(-fvisibility=hidden)
include (CheckCCompilerFlag)
include (CheckCXXCompilerFlag)
CHECK_C_COMPILER_FLAG(-msse HAS_SSE)
CHECK_CXX_COMPILER_FLAG(-msse HAS_CXX_SSE)
if (HAS_SSE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse")
endif()
if (HAS_CXX_SSE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
endif()
CHECK_C_COMPILER_FLAG(-msse2 HAS_SSE2)
CHECK_CXX_COMPILER_FLAG(-msse2 HAS_CXX_SSE2)
if (HAS_SSE2)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
endif()
if (HAS_CXX_SSE2)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
endif()
CHECK_C_COMPILER_FLAG(-mfpmath=sse HAS_FPMATH_SSE)
CHECK_CXX_COMPILER_FLAG(-mfpmath=sse HAS_CXX_FPMATH_SSE)
if (HAS_FPMATH_SSE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse")
endif()
if (HAS_CXX_FPMATH_SSE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse")
endif()
#if(CPP11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if(CMAKE_COMPILER_IS_CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
#endif()
endif()
if(MINGW)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mstackrealign")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mstackrealign")
endif()
aux_source_directory(. src)
add_library(${PROYECTO} MODULE ${src})
if (SUPERNOVA)
include_directories(${SC_PATH}/external_libraries/nova-tt)
# actually just boost.atomic
include_directories(${SC_PATH}/external_libraries/boost)
include_directories(${SC_PATH}/external_libraries/boost_lockfree)
include_directories(${SC_PATH}/external_libraries/boost-lockfree)
add_library(${PROYECTO}_supernova MODULE ${src})
set_property(TARGET ${PROYECTO}_supernova APPEND PROPERTY COMPILE_DEFINITIONS "SUPERNOVA")
endif()
#install
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(INSTALL_DESTINATION "lib/SuperCollider/plugins")
set(INSTALL_DESTINATION_DISTRO "share/SuperCollider/Extensions/Myplugins")
else()
set(INSTALL_DESTINATION "Myplugins")
set(INSTALL_DESTINATION_DISTRO "Myplugins")
endif()
if (NOT APPLE)
install(TARGETS ${PROYECTO} DESTINATION ${INSTALL_DESTINATION})
if(SUPERNOVA)
install(TARGETS ${PROYECTO}_supernova DESTINATION ${INSTALL_DESTINATION})
endif()
else()
install(TARGETS ${PROYECTO} DESTINATION ${INSTALL_DESTINATION}/${PROYECTO})
if(SUPERNOVA)
install(TARGETS ${PROYECTO}_supernova DESTINATION ${INSTALL_DESTINATION}/${PROYECTO})
endif()
endif()
install(DIRECTORY "sc/" DESTINATION ${INSTALL_DESTINATION_DISTRO}/${PROYECTO} PATTERN "*")
install(FILES lua/${PROYECTO}.lua DESTINATION ${INSTALL_DESTINATION_DISTRO}/lua )