From 3888f6372413846b4a6d5c379757861868b8bc0c Mon Sep 17 00:00:00 2001 From: SunderB Date: Fri, 8 Jul 2022 23:06:28 +0100 Subject: [PATCH 1/3] CMake: Add install target --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ad7c4e96..484145436 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,3 +92,4 @@ elseif(UNIX) endif(USE_SYSTEM_RTMIDI) endif(MSVC) +install(TARGETS libsp_midi LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}) From 3c1f1568aa223ce04c9ae43316b1643ddfc14d8c Mon Sep 17 00:00:00 2001 From: SunderB Date: Tue, 12 Jul 2022 10:48:59 +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 484145436..e06260978 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,4 +92,8 @@ elseif(UNIX) endif(USE_SYSTEM_RTMIDI) endif(MSVC) -install(TARGETS libsp_midi LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}) +if(APPLE) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libsp_midi.dylib DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME libsp_midi.so) +else() + install(TARGETS libsp_midi LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}) +endif() From a2a98e83f866748b1b69855ceb6091ce81ccfd37 Mon Sep 17 00:00:00 2001 From: SunderB Date: Wed, 20 Jul 2022 19:50:06 +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 e06260978..edf19a835 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,8 @@ endif(MSVC) if(APPLE) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libsp_midi.dylib DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME libsp_midi.so) +elseif(MSVC) + install(TARGETS libsp_midi RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) else() install(TARGETS libsp_midi LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}) endif()