From 0e36f0c08cdbd5bd28239ae53102e93df039a295 Mon Sep 17 00:00:00 2001 From: Andreas Viborg Date: Thu, 16 Feb 2023 19:16:26 +0100 Subject: [PATCH 1/9] wip --- CMakeLists.txt | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..47f9b9d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,58 @@ +cmake_minimum_required(VERSION 3.15) +project(libvideo-encode VERSION 1.0) + +option(BUILD_SHARED_LIBS "Build using shared libraries" ON) + +# video-encode +set(LIB_SOURCES + src/venc.c +) + +add_library(video-encode ${LIB_SOURCES}) + +target_include_directories(video-encode PUBLIC + $ + $ +) + +target_compile_definitions(video-encode PRIVATE "VENC_API_EXPORTS") +target_compile_options(video-encode PRIVATE "-fvisibility=hidden") +target_compile_options(video-encode PRIVATE "-std=gnu99") + +target_link_libraries(video-encode pomp ulog video-defs video-encode-core) + +# video-encode-core +set(LIB_SOURCES + core/src/venc_core.c + core/src/venc_h264.c + core/src/venc_h265.c +) + +add_library(video-encode-core ${LIB_SOURCES}) + +target_include_directories(video-encode-core PUBLIC + $ + $ +) + +target_compile_definitions(video-encode-core PRIVATE "VENC_API_EXPORTS") +target_compile_options(video-encode-core PRIVATE "-fvisibility=hidden") +target_compile_options(video-encode-core PRIVATE "-std=gnu99") + +if(WIN32) + target_link_libraries(video-encode-core ws2_32) +endif() + +target_link_libraries(video-encode-core + futils + h264 + h265 + media-buffers + media-buffers-memory + media-buffers-memory-generic + pomp + ulog + video-defs + video-metadata + video-streaming +) \ No newline at end of file From ebe122e7e48dc5005e8c4b2a05ba04a351a0e1a4 Mon Sep 17 00:00:00 2001 From: Andreas Viborg Date: Sun, 26 Feb 2023 12:48:05 +0100 Subject: [PATCH 2/9] wip --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47f9b9d..ca236eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,10 @@ set(LIB_SOURCES ) add_library(video-encode ${LIB_SOURCES}) +set_target_properties(video-encode PROPERTIES + POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} +) + target_include_directories(video-encode PUBLIC $ @@ -30,6 +34,10 @@ set(LIB_SOURCES add_library(video-encode-core ${LIB_SOURCES}) +set_target_properties(video-encode-core PROPERTIES + POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} +) + target_include_directories(video-encode-core PUBLIC $ $ From 0f6ba0abd02ac1c9284812478bcd5a1708b5d782 Mon Sep 17 00:00:00 2001 From: Oscar Sjoberg Date: Tue, 28 Feb 2023 10:05:36 +0100 Subject: [PATCH 3/9] updating the local CMakeLists.txt file --- CMakeLists.txt | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47f9b9d..ed65fc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.15) -project(libvideo-encode VERSION 1.0) +project(video-encode VERSION 1.0) option(BUILD_SHARED_LIBS "Build using shared libraries" ON) @@ -8,16 +8,16 @@ set(LIB_SOURCES src/venc.c ) -add_library(video-encode ${LIB_SOURCES}) +add_library(${PROJECT_NAME} ${LIB_SOURCES}) -target_include_directories(video-encode PUBLIC +target_include_directories(${PROJECT_NAME} PUBLIC $ $ ) -target_compile_definitions(video-encode PRIVATE "VENC_API_EXPORTS") -target_compile_options(video-encode PRIVATE "-fvisibility=hidden") -target_compile_options(video-encode PRIVATE "-std=gnu99") +target_compile_definitions(${PROJECT_NAME} PRIVATE "VENC_API_EXPORTS") +target_compile_options(${PROJECT_NAME} PRIVATE "-fvisibility=hidden") +target_compile_options(${PROJECT_NAME} PRIVATE "-std=gnu99") target_link_libraries(video-encode pomp ulog video-defs video-encode-core) @@ -28,22 +28,22 @@ set(LIB_SOURCES core/src/venc_h265.c ) -add_library(video-encode-core ${LIB_SOURCES}) +add_library(${PROJECT_NAME}-core ${LIB_SOURCES}) -target_include_directories(video-encode-core PUBLIC +target_include_directories(${PROJECT_NAME}-core PUBLIC $ $ ) -target_compile_definitions(video-encode-core PRIVATE "VENC_API_EXPORTS") -target_compile_options(video-encode-core PRIVATE "-fvisibility=hidden") -target_compile_options(video-encode-core PRIVATE "-std=gnu99") +target_compile_definitions(${PROJECT_NAME}-core PRIVATE "VENC_API_EXPORTS") +target_compile_options(${PROJECT_NAME}-core PRIVATE "-fvisibility=hidden") +target_compile_options(${PROJECT_NAME}-core PRIVATE "-std=gnu99") if(WIN32) - target_link_libraries(video-encode-core ws2_32) -endif() + target_link_libraries(${PROJECT_NAME}-core ws2_32) +endif() -target_link_libraries(video-encode-core +target_link_libraries(${PROJECT_NAME}-core futils h264 h265 @@ -55,4 +55,12 @@ target_link_libraries(video-encode-core video-defs video-metadata video-streaming -) \ No newline at end of file +) + +install(TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME}-targets + PUBLIC_HEADER DESTINATION include + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) From f05b94af47ceeb93501daf884afbc05b4cbafdcb Mon Sep 17 00:00:00 2001 From: Oscar Sjoberg Date: Wed, 1 Mar 2023 17:33:40 +0100 Subject: [PATCH 4/9] able to do correct install --- CMakeLists.txt | 74 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed65fc8..535d633 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,43 +19,85 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE "VENC_API_EXPORTS") target_compile_options(${PROJECT_NAME} PRIVATE "-fvisibility=hidden") target_compile_options(${PROJECT_NAME} PRIVATE "-std=gnu99") -target_link_libraries(video-encode pomp ulog video-defs video-encode-core) +target_link_libraries(${PROJECT_NAME} + + PRIVATE + futils + pomp + ulog + video-defs + h264 + h265 + media-buffers + media-buffers-memory + media-buffers-memory-generic + video-defs + video-metadata + video-streaming + video-encode-core + transport-packet + ) # video-encode-core set(LIB_SOURCES - core/src/venc_core.c - core/src/venc_h264.c - core/src/venc_h265.c -) + core/src/venc_core.c + core/src/venc_h264.c + core/src/venc_h265.c + ) add_library(${PROJECT_NAME}-core ${LIB_SOURCES}) target_include_directories(${PROJECT_NAME}-core PUBLIC - $ - $ -) + $ + $ + ) target_compile_definitions(${PROJECT_NAME}-core PRIVATE "VENC_API_EXPORTS") target_compile_options(${PROJECT_NAME}-core PRIVATE "-fvisibility=hidden") target_compile_options(${PROJECT_NAME}-core PRIVATE "-std=gnu99") if(WIN32) - target_link_libraries(${PROJECT_NAME}-core ws2_32) -endif() + target_link_libraries(${PROJECT_NAME}-core + # PUBLIC -target_link_libraries(${PROJECT_NAME}-core + PRIVATE + ws2_32 futils + pomp + ulog h264 h265 media-buffers media-buffers-memory media-buffers-memory-generic + video-defs + video-metadata + video-streaming + transport-packet + + ) +else() + + target_link_libraries(${PROJECT_NAME}-core + # PUBLIC + + PRIVATE + futils pomp ulog + h264 + h265 + media-buffers + media-buffers-memory + media-buffers-memory-generic video-defs video-metadata video-streaming -) + transport-packet + + ) +endif() + install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-targets @@ -64,3 +106,11 @@ install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) + +install(TARGETS ${PROJECT_NAME}-core + EXPORT ${PROJECT_NAME}-core-targets + PUBLIC_HEADER DESTINATION include + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) From 5728592331fefa73448bb688ee61d5d9cc1668b9 Mon Sep 17 00:00:00 2001 From: Oscar Sjoberg Date: Wed, 1 Mar 2023 17:34:51 +0100 Subject: [PATCH 5/9] wip From 2bc43dd6fa16b0b3e16a6935f2e1975c3a898aa5 Mon Sep 17 00:00:00 2001 From: Oscar Sjoberg Date: Thu, 2 Mar 2023 16:05:31 +0100 Subject: [PATCH 6/9] correcting cmake From c0f31cb4a70dc52da82cdf2c300e66d40a585b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Sj=C3=B6berg?= Date: Fri, 3 Mar 2023 11:22:42 +0100 Subject: [PATCH 7/9] pulling correct dll when installing windows From 089d009fe41b241f35ac8dd54549a029130a6999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Sj=C3=B6berg?= Date: Fri, 3 Mar 2023 11:59:53 +0100 Subject: [PATCH 8/9] pulling correct dll when installing windows From e06672f92f3bbe65abdb1558a1a78c8cb3d544c2 Mon Sep 17 00:00:00 2001 From: Andreas Viborg Date: Tue, 14 Mar 2023 09:26:11 +0100 Subject: [PATCH 9/9] use shared libs --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c9cc9a..d97cd32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set(LIB_SOURCES src/venc.c ) -add_library(${PROJECT_NAME} ${LIB_SOURCES}) +add_library(${PROJECT_NAME} SHARED ${LIB_SOURCES}) set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} @@ -49,7 +49,7 @@ set(LIB_SOURCES core/src/venc_h264.c core/src/venc_h265.c ) -add_library(${PROJECT_NAME}-core ${LIB_SOURCES}) +add_library(${PROJECT_NAME}-core SHARED ${LIB_SOURCES}) target_include_directories(${PROJECT_NAME}-core PUBLIC $ $