From f2a8f56944664b9724dc0370ed5ae0c777506495 Mon Sep 17 00:00:00 2001 From: justnope <39016732+justnope@users.noreply.github.com> Date: Tue, 22 May 2018 15:46:00 +0200 Subject: [PATCH] MSVC fixes (#4352) * locale: using path instead of individual files to reduce command line size * remotevstplugin: changed order return type & calling convention (compiler error) * lmmsobj: removed single quotes for command line defines * added vcpkg support & std::make_unique for MSVC * carla: include exports header * package_linux: corrected RemoteVstPlugin name * vstbase: toolchain file conditional on MSVC * Added install for remotevstplugin * msvc: installer works with vcpkg Remotevst 64bit install removed due to an ApImage problem --- CMakeLists.txt | 34 ++- cmake/linux/package_linux.sh.in | 4 +- cmake/nsis/CMakeLists.txt | 6 +- data/locale/CMakeLists.txt | 2 +- include/stdshims.h | 4 +- plugins/carlabase/carla.h | 2 +- plugins/vst_base/CMakeLists.txt | 36 +-- plugins/vst_base/RemoteVstPlugin.cpp | 2 +- .../vst_base/RemoteVstPlugin/CMakeLists.txt | 5 + src/CMakeLists.txt | 274 ++++++++++++------ 10 files changed, 257 insertions(+), 112 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2f0ecd56b1..49260176982 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,9 @@ ENDIF() INCLUDE(VersionInfo) INCLUDE(DetectMachine) +IF(CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg.cmake$") + SET(USING_VCPKG TRUE) +ENDIF() OPTION(WANT_ALSA "Include ALSA (Advanced Linux Sound Architecture) support" ON) OPTION(WANT_CALF "Include CALF LADSPA plugins" ON) @@ -166,10 +169,15 @@ FIND_PACKAGE(Qt5Test) SET(QT_QTTEST_LIBRARY Qt5::Test) # check for libsndfile -PKG_CHECK_MODULES(SNDFILE REQUIRED sndfile>=1.0.18) -IF(NOT SNDFILE_FOUND) - MESSAGE(FATAL_ERROR "LMMS requires libsndfile1 and libsndfile1-dev >= 1.0.18 - please install, remove CMakeCache.txt and try again!") -ENDIF() +IF(USING_VCPKG) + FIND_PACKAGE(LibSndFile 1.0.18 REQUIRED) + SET(SNDFILE_LIBRARIES sndfile-shared) +ELSE(USING_VCPKG) + PKG_CHECK_MODULES(SNDFILE REQUIRED sndfile>=1.0.18) + IF(NOT SNDFILE_FOUND) + MESSAGE(FATAL_ERROR "LMMS requires libsndfile1 and libsndfile1-dev >= 1.0.18 - please install, remove CMakeCache.txt and try again!") + ENDIF() +ENDIF(USING_VCPKG) # check if we can use SF_SET_COMPRESSION_LEVEL IF(NOT SNDFILE_VERSION VERSION_LESS 1.0.26) SET(LMMS_HAVE_SF_COMPLEVEL TRUE) @@ -394,8 +402,13 @@ ENDIF(WANT_JACK) # check for FFTW3F-library -PKG_CHECK_MODULES(FFTW3F REQUIRED fftw3f>=3.0.0) - +IF(USING_VCPKG) + #currently find_package for fftw is broken in vcpkg. Replace this when fixed + FIND_PATH(FFTW3F_INCLUDE_DIRS fftw3.h) + FIND_LIBRARY(FFTW3F_LIBRARIES fftw3f) +ELSE(USING_VCPKG) + PKG_CHECK_MODULES(FFTW3F REQUIRED fftw3f>=3.0.0) +ENDIF(USING_VCPKG) # check for FLTK FIND_PACKAGE(FLTK) @@ -477,7 +490,13 @@ ELSE() ENDIF(WANT_DEBUG_FPE) # check for libsamplerate -PKG_CHECK_MODULES(SAMPLERATE REQUIRED samplerate>=0.1.8) +IF(USING_VCPKG) + #TODO no cmake config support. Can we check the version some other way? + FIND_FILE(SAMPLERATE_INCLUDE_DIRS samplerate.h) + FIND_LIBRARY(SAMPLERATE_LIBRARIES libsamplerate-0) +ELSE(USING_VCPKG) + PKG_CHECK_MODULES(SAMPLERATE REQUIRED samplerate>=0.1.8) +ENDIF(USING_VCPKG) # set compiler flags IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") @@ -700,4 +719,5 @@ MESSAGE( "-----------------------------------------------------------------\n" "\n\n") +SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${BIN_DIR}") INCLUDE(InstallRequiredSystemLibraries) diff --git a/cmake/linux/package_linux.sh.in b/cmake/linux/package_linux.sh.in index ec6224e3536..16866e4d491 100644 --- a/cmake/linux/package_linux.sh.in +++ b/cmake/linux/package_linux.sh.in @@ -139,10 +139,10 @@ fi # Move executables so linuxdeployqt can find them ZYNLIB="${APPDIR}usr/lib/lmms/RemoteZynAddSubFx" -VSTLIB="${APPDIR}usr/lib/lmms/RemoteVstPlugin.exe.so" +VSTLIB="${APPDIR}usr/lib/lmms/RemoteVstPlugin32.exe.so" ZYNBIN="${APPDIR}usr/bin/RemoteZynAddSubFx" -VSTBIN="${APPDIR}usr/bin/RemoteVstPlugin.exe.so" +VSTBIN="${APPDIR}usr/bin/RemoteVstPlugin32.exe.so" mv "$ZYNLIB" "$ZYNBIN" mv "$VSTLIB" "$VSTBIN" diff --git a/cmake/nsis/CMakeLists.txt b/cmake/nsis/CMakeLists.txt index 065b208195b..a19555a193f 100644 --- a/cmake/nsis/CMakeLists.txt +++ b/cmake/nsis/CMakeLists.txt @@ -1,4 +1,7 @@ SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/nsis_branding.bmp") +IF(MSVC) + STRING(REPLACE "/" "\\\\" CPACK_PACKAGE_ICON ${CPACK_PACKAGE_ICON}) +ENDIF(MSVC) SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/lmms.ico") SET(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe" PARENT_SCOPE) SET(CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME_UCASE} ${VERSION}" PARENT_SCOPE) @@ -8,7 +11,8 @@ SET(CPACK_NSIS_CONTACT "${PROJECT_EMAIL}" PARENT_SCOPE) SET(CPACK_PACKAGE_EXECUTABLES "${CMAKE_PROJECT_NAME}.exe;${PROJECT_NAME_UCASE}" PARENT_SCOPE) SET(CPACK_NSIS_MENU_LINKS "${CMAKE_PROJECT_NAME}.exe;${PROJECT_NAME_UCASE}" PARENT_SCOPE) SET(CPACK_NSIS_DEFINES " - !include ${CMAKE_SOURCE_DIR}/cmake/nsis/FileAssociation.nsh + !addincludedir ${CMAKE_SOURCE_DIR}/cmake/nsis + !include FileAssociation.nsh !include LogicLib.nsh !include WinVer.nsh") SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}-win32") diff --git a/data/locale/CMakeLists.txt b/data/locale/CMakeLists.txt index 3c72e7d787d..9a772640640 100644 --- a/data/locale/CMakeLists.txt +++ b/data/locale/CMakeLists.txt @@ -26,7 +26,7 @@ FOREACH(_ts_file ${lmms_LOCALES}) STRING(REPLACE ".ts" ".qm" _qm_file "${_ts_file}") STRING(REPLACE ".ts" ".qm" _qm_target "${_ts_target}") ADD_CUSTOM_TARGET(${_ts_target} - COMMAND "${QT_LUPDATE_EXECUTABLE}" -locations none -no-obsolete -I ${CMAKE_SOURCE_DIR}/include/ ${LMMS_SRCS} ${LMMS_INCLUDES} ${LMMS_UIS} `find "\"${CMAKE_SOURCE_DIR}/plugins/\"" -type f -name '*.cpp' -or -name '*.h'` -ts "\"${_ts_file}\"" + COMMAND "${QT_LUPDATE_EXECUTABLE}" -locations none -no-obsolete -I ${CMAKE_SOURCE_DIR}/include/ ${LMMS_SRCS} ${LMMS_UIS} ${CMAKE_SOURCE_DIR}/plugins -ts "\"${_ts_file}\"" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) ADD_CUSTOM_TARGET(${_qm_target} COMMAND "${QT_LRELEASE_EXECUTABLE}" "${_ts_file}" -qm "${_qm_file}" diff --git a/include/stdshims.h b/include/stdshims.h index 456d31607dc..85c4f457aab 100644 --- a/include/stdshims.h +++ b/include/stdshims.h @@ -7,8 +7,10 @@ #include #include -#if (__cplusplus >= 201402L) +#if (__cplusplus >= 201402L || _MSC_VER) +#ifndef _MSC_VER #warning "This file should now be removed! The functions it provides are part of the C++14 standard." +#endif using std::make_unique; #else diff --git a/plugins/carlabase/carla.h b/plugins/carlabase/carla.h index 6431e5300de..175a570d6ac 100644 --- a/plugins/carlabase/carla.h +++ b/plugins/carlabase/carla.h @@ -26,9 +26,9 @@ #define CARLA_H #include +#include "plugin_export.h" #include "CarlaNative.h" - #include "Instrument.h" #include "InstrumentView.h" diff --git a/plugins/vst_base/CMakeLists.txt b/plugins/vst_base/CMakeLists.txt index 943631b92a6..42b5930b793 100644 --- a/plugins/vst_base/CMakeLists.txt +++ b/plugins/vst_base/CMakeLists.txt @@ -24,7 +24,6 @@ SET(EXTERNALPROJECT_CMAKE_ARGS "-DLMMS_SOURCE_DIR=${CMAKE_SOURCE_DIR}" "-DLMMS_BINARY_DIR=${CMAKE_BINARY_DIR}" "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" - "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" "-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}" "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" ) @@ -33,29 +32,23 @@ SET(EXTERNALPROJECT_CMAKE_ARGS IF(LMMS_BUILD_WIN32 AND NOT LMMS_BUILD_WIN64) ADD_SUBDIRECTORY(RemoteVstPlugin) ELSEIF(LMMS_BUILD_WIN64 AND MSVC) - SET(MSVC_VER ${CMAKE_CXX_COMPILER_VERSION}) + STRING(REPLACE " Win64" "" GENERATOR ${CMAKE_GENERATOR}) - IF(MSVC_VER VERSION_GREATER 19.0 OR MSVC_VER VERSION_EQUAL 19.0) - SET(GENERATOR "Visual Studio 14 2015") - SET(MSVC_YEAR 2015) - ELSEIF(MSVC_VER VERSION_EQUAL 19.10 OR MSVC_VER VERSION_EQUAL 19.10) - SET(GENERATOR "Visual Studio 15 2017") - SET(MSVC_YEAR 2017) - ELSE() - MESSAGE(SEND_ERROR "Can't build RemoteVstPlugin32, unknown MSVC version ${MSVC_VER}") - ENDIF() - - GET_FILENAME_COMPONENT(QT_BIN_DIR ${QT_QMAKE_EXECUTABLE} DIRECTORY) - SET(QT_32_PREFIX "${QT_BIN_DIR}/../../msvc${MSVC_YEAR}") - IF(NOT (IS_DIRECTORY ${QT_32_PREFIX} AND EXISTS ${QT_32_PREFIX}/bin/qmake.exe)) - MESSAGE(SEND_ERROR "Can't build RemoteVstPlugin32, no Qt 32 bit installation found at ${QT_32_PREFIX}") - ENDIF() + IF(NOT USING_VCPKG) + GET_FILENAME_COMPONENT(QT_BIN_DIR ${QT_QMAKE_EXECUTABLE} DIRECTORY) + SET(QT_32_PREFIX "${QT_BIN_DIR}/../../msvc${MSVC_YEAR}") + IF(NOT (IS_DIRECTORY ${QT_32_PREFIX} AND EXISTS ${QT_32_PREFIX}/bin/qmake.exe)) + MESSAGE(SEND_ERROR "Can't build RemoteVstPlugin32, no Qt 32 bit installation found at ${QT_32_PREFIX}") + ENDIF() + ENDIF(NOT USING_VCPKG) ExternalProject_Add(RemoteVstPlugin32 "${EXTERNALPROJECT_ARGS}" CMAKE_GENERATOR ${GENERATOR} + CMAKE_GENERATOR_TOOLSET ${CMAKE_GENERATOR_TOOLSET} CMAKE_ARGS "${EXTERNALPROJECT_CMAKE_ARGS}" + "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" "-DCMAKE_PREFIX_PATH=${QT_32_PREFIX}" ) ELSEIF(LMMS_BUILD_LINUX) @@ -82,6 +75,7 @@ ENDIF() # build 64 bit version of RemoteVstPlugin IF(LMMS_BUILD_WIN64) ADD_SUBDIRECTORY(RemoteVstPlugin) + INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin64.exe" DESTINATION "${PLUGIN_DIR}") ELSEIF(LMMS_BUILD_LINUX) ExternalProject_Add(RemoteVstPlugin64 "${EXTERNALPROJECT_ARGS}" @@ -91,3 +85,11 @@ ELSEIF(LMMS_BUILD_LINUX) "-DCMAKE_CXX_FLAGS=-m64 -mwindows" ) ENDIF() + +IF(TARGET RemoteVstPlugin32) + IF(LMMS_BUILD_LINUX) + INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin32" "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin32.exe.so" DESTINATION "${PLUGIN_DIR}") + ELSEIF(LMMS_BUILD_WIN32) + INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin32.exe" DESTINATION "${PLUGIN_DIR}") + ENDIF() +ENDIF() \ No newline at end of file diff --git a/plugins/vst_base/RemoteVstPlugin.cpp b/plugins/vst_base/RemoteVstPlugin.cpp index ab3812ed4bc..d2866135783 100644 --- a/plugins/vst_base/RemoteVstPlugin.cpp +++ b/plugins/vst_base/RemoteVstPlugin.cpp @@ -331,7 +331,7 @@ class RemoteVstPlugin : public RemotePluginClient } ; // callback used by plugin for being able to communicate with it's host - static VST_CALL_CONV intptr_t hostCallback( AEffect * _effect, int32_t _opcode, + static intptr_t VST_CALL_CONV hostCallback( AEffect * _effect, int32_t _opcode, int32_t _index, intptr_t _value, void * _ptr, float _opt ); diff --git a/plugins/vst_base/RemoteVstPlugin/CMakeLists.txt b/plugins/vst_base/RemoteVstPlugin/CMakeLists.txt index f6b3e9c4ead..1baf9406493 100644 --- a/plugins/vst_base/RemoteVstPlugin/CMakeLists.txt +++ b/plugins/vst_base/RemoteVstPlugin/CMakeLists.txt @@ -20,6 +20,11 @@ else() set(BITNESS 32) endif() +FOREACH( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} ) + STRING(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) + SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +ENDFOREACH() + set(EXE_NAME RemoteVstPlugin${BITNESS}) add_executable(${EXE_NAME} ../RemoteVstPlugin.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 29a4c47078d..f798881c70f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -51,12 +51,13 @@ ADD_GEN_QRC(LMMS_RCC_OUT lmms.qrc # Paths relative to lmms executable FILE(RELATIVE_PATH LIB_DIR_RELATIVE "/${BIN_DIR}" "/${LIB_DIR}") FILE(RELATIVE_PATH PLUGIN_DIR_RELATIVE "/${BIN_DIR}" "/${PLUGIN_DIR}") -ADD_DEFINITIONS(-D'LIB_DIR="${LIB_DIR_RELATIVE}/"' -D'PLUGIN_DIR="${PLUGIN_DIR_RELATIVE}/"' ${PULSEAUDIO_DEFINITIONS} ${PORTAUDIO_DEFINITIONS}) +ADD_DEFINITIONS(-DLIB_DIR="${LIB_DIR_RELATIVE}" -DPLUGIN_DIR="${PLUGIN_DIR_RELATIVE}" ${PULSEAUDIO_DEFINITIONS} ${PORTAUDIO_DEFINITIONS}) INCLUDE_DIRECTORIES( ${JACK_INCLUDE_DIRS} ${SAMPLERATE_INCLUDE_DIRS} ${SNDFILE_INCLUDE_DIRS} ${SNDIO_INCLUDE_DIRS} + ${FFTW3F_INCLUDE_DIRS} ) IF(NOT ("${SDL2_INCLUDE_DIR}" STREQUAL "")) @@ -189,97 +190,208 @@ IF(LMMS_BUILD_MSYS AND CMAKE_BUILD_TYPE STREQUAL "Debug") ENDIF() # Install -IF(LMMS_BUILD_WIN32) - SET_TARGET_PROPERTIES(lmms PROPERTIES - LINK_FLAGS "${LINK_FLAGS} -mwindows" - ENABLE_EXPORTS ON - ) - - IF(LMMS_BUILD_MSYS) - # ENABLE_EXPORTS property has no effect in some MSYS2 configurations. - # Add the linker flag manually to create liblmms.dll.a import library - SET_PROPERTY(TARGET lmms - APPEND_STRING PROPERTY LINK_FLAGS -Wl,--out-implib,liblmms.dll.a +IF(NOT MSVC) + IF(LMMS_BUILD_WIN32) + SET_TARGET_PROPERTIES(lmms PROPERTIES + LINK_FLAGS "${LINK_FLAGS} -mwindows" + ENABLE_EXPORTS ON ) - ENDIF() - IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - ADD_CUSTOM_COMMAND(TARGET lmms POST_BUILD COMMAND "${STRIP}" "$") - ENDIF() + IF(LMMS_BUILD_MSYS) + # ENABLE_EXPORTS property has no effect in some MSYS2 configurations. + # Add the linker flag manually to create liblmms.dll.a import library + SET_PROPERTY(TARGET lmms + APPEND_STRING PROPERTY LINK_FLAGS -Wl,--out-implib,liblmms.dll.a + ) + ENDIF() - INSTALL(TARGETS lmms RUNTIME DESTINATION "${BIN_DIR}") - - INSTALL(FILES - "${MINGW_PREFIX}/bin/Qt5Core.dll" - "${MINGW_PREFIX}/bin/Qt5Gui.dll" - "${MINGW_PREFIX}/bin/Qt5Widgets.dll" - "${MINGW_PREFIX}/bin/Qt5Xml.dll" - DESTINATION .) - INSTALL(FILES - "${MINGW_PREFIX}/lib/qt5/plugins/platforms/qwindows.dll" - DESTINATION ./platforms) - INSTALL(FILES - "${MINGW_PREFIX}/bin/libsamplerate-0.dll" - "${MINGW_PREFIX}/bin/libsndfile-1.dll" - "${MINGW_PREFIX}/bin/libvorbis-0.dll" - "${MINGW_PREFIX}/bin/libvorbisenc-2.dll" - "${MINGW_PREFIX}/bin/libvorbisfile-3.dll" - "${MINGW_PREFIX}/bin/libjpeg-9.dll" - "${MINGW_PREFIX}/bin/libogg-0.dll" - "${MINGW_PREFIX}/bin/libmp3lame-0.dll" - "${MINGW_PREFIX}/bin/libfftw3f-3.dll" - "${MINGW_PREFIX}/bin/libFLAC-8.dll" - "${MINGW_PREFIX}/bin/libpng16-16.dll" - "${MINGW_PREFIX}/bin/SDL.dll" - "${MINGW_PREFIX}/bin/libglib-2.0-0.dll" - "${MINGW_PREFIX}/bin/libgthread-2.0-0.dll" - "${MINGW_PREFIX}/bin/zlib1.dll" - "${MINGW_PREFIX}/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/bin/libwinpthread-1.dll" - DESTINATION .) - IF(LMMS_BUILD_MSYS) + IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + ADD_CUSTOM_COMMAND(TARGET lmms POST_BUILD COMMAND "${STRIP}" "$") + ENDIF() + + INSTALL(TARGETS lmms RUNTIME DESTINATION "${BIN_DIR}") INSTALL(FILES - "${MINGW_PREFIX}/bin/libwinpthread-1.dll" - "${MINGW_PREFIX}/bin/libgcc_s_seh-1.dll" - "${MINGW_PREFIX}/bin/libstdc++-6.dll" + "${MINGW_PREFIX}/bin/Qt5Core.dll" + "${MINGW_PREFIX}/bin/Qt5Gui.dll" + "${MINGW_PREFIX}/bin/Qt5Widgets.dll" + "${MINGW_PREFIX}/bin/Qt5Xml.dll" DESTINATION .) - ELSE() INSTALL(FILES - "${MINGW_PREFIX}/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/bin/libwinpthread-1.dll" - DESTINATION .) - ENDIF() - IF(FLTK_FOUND) + "${MINGW_PREFIX}/lib/qt5/plugins/platforms/qwindows.dll" + DESTINATION ./platforms) INSTALL(FILES - "${MINGW_PREFIX}/bin/libfltk.dll" - DESTINATION .) - ENDIF() - IF(FLUIDSYNTH_FOUND) + "${MINGW_PREFIX}/bin/libsamplerate-0.dll" + "${MINGW_PREFIX}/bin/libsndfile-1.dll" + "${MINGW_PREFIX}/bin/libvorbis-0.dll" + "${MINGW_PREFIX}/bin/libvorbisenc-2.dll" + "${MINGW_PREFIX}/bin/libvorbisfile-3.dll" + "${MINGW_PREFIX}/bin/libjpeg-9.dll" + "${MINGW_PREFIX}/bin/libogg-0.dll" + "${MINGW_PREFIX}/bin/libmp3lame-0.dll" + "${MINGW_PREFIX}/bin/libfftw3f-3.dll" + "${MINGW_PREFIX}/bin/libFLAC-8.dll" + "${MINGW_PREFIX}/bin/libpng16-16.dll" + "${MINGW_PREFIX}/bin/SDL.dll" + "${MINGW_PREFIX}/bin/libglib-2.0-0.dll" + "${MINGW_PREFIX}/bin/libgthread-2.0-0.dll" + "${MINGW_PREFIX}/bin/zlib1.dll" + "${MINGW_PREFIX}/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/bin/libwinpthread-1.dll" + DESTINATION .) + IF(LMMS_BUILD_MSYS) + INSTALL(FILES + "${MINGW_PREFIX}/bin/libwinpthread-1.dll" + "${MINGW_PREFIX}/bin/libgcc_s_seh-1.dll" + "${MINGW_PREFIX}/bin/libstdc++-6.dll" + DESTINATION .) + ELSE() + INSTALL(FILES + "${MINGW_PREFIX}/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/bin/libwinpthread-1.dll" + DESTINATION .) + ENDIF() + IF(FLTK_FOUND) + INSTALL(FILES + "${MINGW_PREFIX}/bin/libfltk.dll" + DESTINATION .) + ENDIF() + IF(FLUIDSYNTH_FOUND) + INSTALL(FILES + "${MINGW_PREFIX}/bin/libfluidsynth.dll" + DESTINATION .) + ENDIF() + IF(GIG_FOUND) + # Handle libgig-*.dll + FILE(GLOB GIG_LIBRARY "${MINGW_PREFIX}/bin/libgig-*.dll") + INSTALL(FILES + ${GIG_LIBRARY} + DESTINATION .) + ENDIF() + IF(PORTAUDIO_FOUND) + INSTALL(FILES + "${MINGW_PREFIX}/bin/libportaudio-2.dll" + DESTINATION .) + ENDIF() + IF(SOUNDIO_FOUND) + INSTALL(FILES + "${MINGW_PREFIX}/lib/libsoundio.dll" + DESTINATION .) + ENDIF() + + ELSE(LMMS_BUILD_WIN32) + IF(NOT LMMS_BUILD_APPLE) + SET_TARGET_PROPERTIES(lmms PROPERTIES LINK_FLAGS "${LINK_FLAGS} -Wl,-E") + ENDIF(NOT LMMS_BUILD_APPLE) + + INSTALL(TARGETS lmms RUNTIME DESTINATION "${BIN_DIR}") + INSTALL(FILES "${CMAKE_BINARY_DIR}/lmms.1.gz" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1/" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) + + ENDIF(LMMS_BUILD_WIN32) +ELSE(NOT MSVC) + SET_TARGET_PROPERTIES(lmms PROPERTIES + ENABLE_EXPORTS ON + ) + INSTALL(TARGETS lmms RUNTIME DESTINATION "${BIN_DIR}") + + SET_TARGET_PROPERTIES(lmms PROPERTIES + LINK_FLAGS "${LINK_FLAGS} -mwindows" + ENABLE_EXPORTS ON + ) + + #CMAKE_FIND_ROOT_PATH + SET(VCPKG_ROOT ${CMAKE_FIND_ROOT_PATH}) + + INSTALL(TARGETS lmms RUNTIME DESTINATION "${BIN_DIR}") + INSTALL(FILES - "${MINGW_PREFIX}/bin/libfluidsynth.dll" + "${VCPKG_ROOT}/bin/Qt5Core.dll" + "${VCPKG_ROOT}/bin/Qt5Gui.dll" + "${VCPKG_ROOT}/bin/Qt5Widgets.dll" + "${VCPKG_ROOT}/bin/Qt5Xml.dll" + + "${VCPKG_ROOT}/bin/zlib1.dll" + "${VCPKG_ROOT}/bin/jpeg62.dll" + "${VCPKG_ROOT}/bin/libpng16.dll" + "${VCPKG_ROOT}/bin/gthread-2.dll" + "${VCPKG_ROOT}/bin/glib-2.dll" + "${VCPKG_ROOT}/bin/harfbuzz.dll" + "${VCPKG_ROOT}/bin/pcre2-16.dll" + "${VCPKG_ROOT}/bin/double-conversion.dll" + "${VCPKG_ROOT}/bin/freetype.dll" + "${VCPKG_ROOT}/bin/libbz2.dll" + "${VCPKG_ROOT}/bin/pcre.dll" + "${VCPKG_ROOT}/bin/libiconv.dll" + "${VCPKG_ROOT}/bin/libcharset.dll" + "${VCPKG_ROOT}/bin/libintl.dll" DESTINATION .) - ENDIF() - IF(GIG_FOUND) - # Handle libgig-*.dll - FILE(GLOB GIG_LIBRARY "${MINGW_PREFIX}/bin/libgig-*.dll") + INSTALL(FILES - ${GIG_LIBRARY} - DESTINATION .) - ENDIF() - IF(PORTAUDIO_FOUND) + "${VCPKG_ROOT}/plugins/platforms/qwindows.dll" + DESTINATION ./platforms) + INSTALL(FILES - "${MINGW_PREFIX}/bin/libportaudio-2.dll" + "${VCPKG_ROOT}/bin/libsndfile-1.dll" + "${VCPKG_ROOT}/bin/ogg.dll" + "${VCPKG_ROOT}/bin/vorbis.dll" + "${VCPKG_ROOT}/bin/vorbisenc.dll" + "${VCPKG_ROOT}/bin/FLAC.dll" + "${VCPKG_ROOT}/bin/vorbisfile.dll" + + "${VCPKG_ROOT}/bin/libsamplerate-0.dll" + "${VCPKG_ROOT}/bin/SDL2.dll" + "${VCPKG_ROOT}/bin/fftw3f.dll" DESTINATION .) - ENDIF() - IF(SOUNDIO_FOUND) - INSTALL(FILES - "${MINGW_PREFIX}/lib/libsoundio.dll" + + #not yet in vcpkg + #IF(LAME_FOUND) + # INSTALL(FILES + # "${VCPKG_ROOT}/bin/libmp3lame-0.dll" + # DESTINATION .) + #ENDIF(LAME_FOUND) + + IF(FLTK_FOUND) + INSTALL(FILES + "${VCPKG_ROOT}/bin/libfltk_SHARED.dll" + + "${VCPKG_ROOT}/bin/zlib1.dll" + "${VCPKG_ROOT}/bin/jpeg62.dll" DESTINATION .) - ENDIF() -ELSE(LMMS_BUILD_WIN32) - IF(NOT LMMS_BUILD_APPLE) - SET_TARGET_PROPERTIES(lmms PROPERTIES LINK_FLAGS "${LINK_FLAGS} -Wl,-E") - ENDIF(NOT LMMS_BUILD_APPLE) - - INSTALL(TARGETS lmms RUNTIME DESTINATION "${BIN_DIR}") - INSTALL(FILES "${CMAKE_BINARY_DIR}/lmms.1.gz" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1/" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) + ENDIF() + + IF(FLUIDSYNTH_FOUND) + INSTALL(FILES + "${VCPKG_ROOT}/bin/libfluidsynth-1.dll" + "${VCPKG_ROOT}/bin/glib-2.dll" + "${VCPKG_ROOT}/bin/pcre.dll" + "${VCPKG_ROOT}/bin/libiconv.dll" + "${VCPKG_ROOT}/bin/libcharset.dll" + "${VCPKG_ROOT}/bin/libintl.dll" + DESTINATION .) + ENDIF() -ENDIF(LMMS_BUILD_WIN32) + #not yet included in vcpkg + #IF(GIG_FOUND) + # # Handle libgig-*.dll + # FILE(GLOB GIG_LIBRARY "${VCPKG_ROOT}/bin/libgig-*.dll") + # INSTALL(FILES + # ${GIG_LIBRARY} + # DESTINATION .) + #ENDIF() + + IF(PORTAUDIO_FOUND) + IF(LMMS_BUILD_WIN64) + INSTALL(FILES + "${VCPKG_ROOT}/bin/portaudio-x64.dll" + DESTINATION .) + ELSE(LMMS_BUILD_WIN64) + INSTALL(FILES + "${VCPKG_ROOT}/bin/portaudio-x86.dll" + DESTINATION .) + ENDIF(LMMS_BUILD_WIN64) + ENDIF() + + #not yet in vcpkg + #IF(SOUNDIO_FOUND) + # INSTALL(FILES + # "${VCPKG_ROOT}/bin/libsoundio.dll" + # DESTINATION .) + #ENDIF() +ENDIF(NOT MSVC) \ No newline at end of file