From 029c19099201f610ee4b0c13a8f55d946fa9ad10 Mon Sep 17 00:00:00 2001 From: SunderB Date: Fri, 8 Jul 2022 23:01:55 +0100 Subject: [PATCH 1/3] CMake: Add installation target --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b13b6e12f2..549858405e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,3 +75,5 @@ elseif(UNIX) include_directories(${ERLANG_INCLUDE_PATH}) target_link_libraries(libsp_link Ableton::Link) endif(MSVC) + +install(TARGETS libsp_link LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}) From f4402c06dee39b2098689d15dd5af1e82ebe0061 Mon Sep 17 00:00:00 2001 From: SunderB Date: Tue, 12 Jul 2022 10:50:31 +0100 Subject: [PATCH 2/3] CMake: Fix file extension on macOS upon installation The default file extension for dynamic libs on macOS is '.dylib'. However, Erlang expects '.so' on all UNIX-based platforms, so it needs to be renamed to be found by Erlang. --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 549858405e..1f517ad1d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,4 +76,8 @@ elseif(UNIX) target_link_libraries(libsp_link Ableton::Link) endif(MSVC) -install(TARGETS libsp_link LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}) +if(APPLE) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libsp_link.dylib DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME libsp_link.so) +else() + install(TARGETS libsp_link LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}) +endif() From c38bd1e0f7a87084963a7b19b1d6c0eff654c0ba Mon Sep 17 00:00:00 2001 From: SunderB Date: Wed, 20 Jul 2022 19:52:18 +0100 Subject: [PATCH 3/3] CMake: Fix .dll output location on Windows Implements fix from sonic-pi-net/sonic-pi@890865b --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f517ad1d7..d635773369 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,8 @@ endif(MSVC) if(APPLE) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libsp_link.dylib DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME libsp_link.so) +elseif(MSVC) + install(TARGETS libsp_link RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) else() install(TARGETS libsp_link LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}) endif()