Lines 1-18
Link Here
|
1 |
--- CMakeLists.txt.orig 2020-09-11 12:10:25 UTC |
1 |
--- CMakeLists.txt.orig 2021-05-09 14:57:33 UTC |
2 |
+++ CMakeLists.txt |
2 |
+++ CMakeLists.txt |
3 |
@@ -218,8 +218,14 @@ if(UNIX AND NOT APPLE) |
3 |
@@ -170,6 +170,13 @@ set_target_properties(openshot-audio PROPERTIES |
|
|
4 |
EXPORT_NAME Audio # Exports as OpenShot::Audio target |
5 |
) |
6 |
|
7 |
+if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") |
8 |
+ find_package(Threads REQUIRED) |
9 |
+ if(Threads_FOUND) |
10 |
+ target_link_libraries(openshot-audio PRIVATE ${CMAKE_THREAD_LIBS_INIT}) |
11 |
+ endif(Threads_FOUND) |
12 |
+endif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") |
13 |
+ |
14 |
# Require language features we use |
15 |
if(CMAKE_VERSION VERSION_GREATER 3.8) |
16 |
target_compile_features(openshot-audio PUBLIC |
17 |
@@ -188,7 +195,8 @@ endif() |
18 |
# Enable stack-unwinding support in c objects on gcc-based platforms. |
19 |
# Failing to do so will cause your program to be terminated when a png |
20 |
# or a jpeg exception is thrown on linux or macosx. |
21 |
-if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") |
22 |
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR |
23 |
+ CMAKE_CXX_COMPILER_ID STREQUAL "Clang") |
24 |
target_compile_options(openshot-audio PRIVATE -fexceptions) |
25 |
endif() |
26 |
|
27 |
@@ -249,8 +257,8 @@ if(UNIX AND NOT APPLE) |
4 |
INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIR} |
28 |
INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIR} |
5 |
INTERFACE_LINK_LIBRARIES ${ALSA_LIBRARIES}) |
29 |
INTERFACE_LINK_LIBRARIES ${ALSA_LIBRARIES}) |
6 |
endif() |
30 |
endif() |
7 |
- target_compile_definitions(openshot-audio PUBLIC LINUX) |
31 |
- target_compile_definitions(openshot-audio PUBLIC LINUX) |
|
|
32 |
- target_link_libraries(openshot-audio PUBLIC ALSA::ALSA) |
8 |
+ #target_compile_definitions(openshot-audio PUBLIC LINUX) |
33 |
+ #target_compile_definitions(openshot-audio PUBLIC LINUX) |
9 |
target_link_libraries(openshot-audio PUBLIC ALSA::ALSA) |
34 |
+ target_link_libraries(openshot-audio PRIVATE ALSA::ALSA) |
10 |
+ |
35 |
else() |
|
|
36 |
# For EXPORTED Config |
37 |
set(NEED_ALSA FALSE) |
38 |
@@ -258,10 +266,24 @@ endif() |
39 |
|
40 |
# ZLIB -- uses IMPORTED target ZLIB::ZLIB which has existed since CMake 3.1 |
41 |
find_package(ZLIB REQUIRED) |
42 |
-target_link_libraries(openshot-audio PUBLIC ZLIB::ZLIB) |
43 |
+target_link_libraries(openshot-audio PRIVATE ZLIB::ZLIB) |
44 |
|
45 |
+# EXECINFO, SYSINFO |
46 |
+if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") |
11 |
+ find_library(EXECINFO_LIBRARY NAMES execinfo) |
47 |
+ find_library(EXECINFO_LIBRARY NAMES execinfo) |
12 |
+ if(NOT EXECINFO_LIBRARY) |
48 |
+ if(NOT EXECINFO_LIBRARY) |
13 |
+ message(FATAL_ERROR "${EXECINFO_LIBRARY}") |
49 |
+ message(FATAL_ERROR "${EXECINFO_LIBRARY}") |
14 |
+ endif(NOT EXECINFO_LIBRARY) |
50 |
+ endif(NOT EXECINFO_LIBRARY) |
15 |
+ target_link_libraries(openshot-audio PUBLIC ${EXECINFO_LIBRARY}) |
51 |
+ target_link_libraries(openshot-audio PRIVATE ${EXECINFO_LIBRARY}) |
16 |
endif() |
52 |
+ find_library(SYSINFO_LIBRARY NAMES sysinfo) |
|
|
53 |
+ if(NOT SYSINFO_LIBRARY) |
54 |
+ message(FATAL_ERROR "${SYSINFO_LIBRARY}") |
55 |
+ endif(NOT SYSINFO_LIBRARY) |
56 |
+ target_link_libraries(openshot-audio PRIVATE ${SYSINFO_LIBRARY}) |
57 |
+endif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") |
58 |
+ |
59 |
# Link with dynamic loader for platform |
60 |
-target_link_libraries(openshot-audio PUBLIC ${CMAKE_DL_LIBS}) |
61 |
+target_link_libraries(openshot-audio PRIVATE ${CMAKE_DL_LIBS}) |
17 |
|
62 |
|
18 |
# ZLIB -- uses IMPORTED target ZLIB::ZLIB which has existed since CMake 3.1 |
63 |
# Create an alias so our EXPORT target name works internally, as well |
|
|
64 |
add_library(OpenShot::Audio ALIAS openshot-audio) |