From c48eb1aae43321cf980a7a97f88cc7a2d1cc03ae Mon Sep 17 00:00:00 2001 From: "Khanh H." Date: Tue, 14 Jan 2025 22:41:55 -0800 Subject: [PATCH 1/2] Add property to export all symbols to create shared library on MSVC. --- src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3c00150f..e4bce824 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -42,6 +42,10 @@ foreach(TARGET ${AV_TARGETS}) target_link_libraries(${TARGET} PRIVATE ws2_32) endif() + if(MSVC AND TYPE STREQUAL "SHARED") + set_target_properties(${TARGET} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + endif() + add_library(${AV_NAMESPACE}::${TARGET} ALIAS ${TARGET}) endforeach() From a9ecdd2137ba83a4eb1dc12506cc72514f4dbc43 Mon Sep 17 00:00:00 2001 From: "Khanh H." Date: Tue, 14 Jan 2025 22:43:04 -0800 Subject: [PATCH 2/2] Set pkgconfig to correct install directory so vcpkg doesn't require a patch --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e4bce824..5d3ffacb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -137,7 +137,7 @@ if (AVCPP_NOT_SUBPROJECT) ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libavcpp.pc" - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig") + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") endif() endif()