diff --git a/.gitmodules b/.gitmodules index 7976dbe..010dba6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "modules/JUCE"] path = modules/JUCE url = https://github.com/juce-framework/JUCE -[submodule "modules/sofa"] - path = modules/sofa - url = https://github.com/vackva/libmysofa +[submodule "modules/libmysofa"] + path = modules/libmysofa + url = https://github.com/hoene/libmysofa.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 9616170..8829a7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,17 +16,14 @@ add_subdirectory(modules/JUCE) # Disable building tests for libmysofa set(BUILD_TESTS OFF CACHE BOOL "Disable building tests" FORCE) + +# Include the libmysofa project +add_subdirectory(modules/libmysofa) + # Disable building shared libraries for libmysofa set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared instead of static libraries." FORCE) -if (MSVC) - link_directories("${CMAKE_CURRENT_SOURCE_DIR}/modules/sofa/windows/third-party/zlib-1.2.11/lib") - add_subdirectory(modules/sofa) -else() - # Include the libmysofa project - add_subdirectory(modules/sofa) -endif () - +add_subdirectory(modules/libmysofa) juce_add_plugin(${TARGET_NAME} # VERSION ... # Set this if the plugin version is different to the project version @@ -89,3 +86,19 @@ target_link_libraries(${TARGET_NAME} juce::juce_recommended_config_flags juce::juce_recommended_lto_flags juce::juce_recommended_warning_flags) + + +if (MSVC) + set(copy_shard_libs + "${CMAKE_CURRENT_SOURCE_DIR}/modules/OpenBLAS-${OPEN_BLAS_VERSION}/bin/libopenblas.dll" + ) + + foreach(FORMAT IN LISTS FORMATS_TO_BUILD) + string(CONCAT CONCATENATED_TARGET ${TARGET_NAME}_${FORMAT}) + add_custom_command(TARGET ${CONCATENATED_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${copy_shard_libs} + $/${FORMAT}) + endforeach() +endif (MSVC) diff --git a/modules/libmysofa b/modules/libmysofa new file mode 160000 index 0000000..da9e4ad --- /dev/null +++ b/modules/libmysofa @@ -0,0 +1 @@ +Subproject commit da9e4adc619ee3d1ae5e68da3ed14aa5e60b3ec1 diff --git a/modules/sofa b/modules/sofa deleted file mode 160000 index 9a92902..0000000 --- a/modules/sofa +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9a92902ce0f4fac6f08fd75b5dde7843223a1866