Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we'd hide these details in a FindSndFile.cmake script and only call FIND_PACKAGE(SndFile) here, but I guess that's out of scope for this PR so it's fine this way for now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

I'm a bit relaxed about coding standards because this is only a proof of concept. If it works, I'll implement those changes. If it doesn't, I'll look for other package managers in windows (scoop?) and see if I can implement those.

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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -700,4 +719,5 @@ MESSAGE(
"-----------------------------------------------------------------\n"
"\n\n")

SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${BIN_DIR}")
INCLUDE(InstallRequiredSystemLibraries)
4 changes: 2 additions & 2 deletions cmake/linux/package_linux.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion cmake/nsis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion data/locale/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
4 changes: 3 additions & 1 deletion include/stdshims.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
#include <memory>
#include <utility>

#if (__cplusplus >= 201402L)
#if (__cplusplus >= 201402L || _MSC_VER)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VS 2012(_MSC_VER == 1700) doesn't have std::make_unique while 2013 (_MSC_VER == 1800) has. This will cause compile errors when using VS 2012.

#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
Expand Down
2 changes: 1 addition & 1 deletion plugins/carlabase/carla.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
#define CARLA_H

#include <QtCore/QMutex>
#include "plugin_export.h"

#include "CarlaNative.h"

#include "Instrument.h"
#include "InstrumentView.h"

Expand Down
36 changes: 19 additions & 17 deletions plugins/vst_base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
Expand All @@ -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)
Expand All @@ -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}"
Expand All @@ -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()
2 changes: 1 addition & 1 deletion plugins/vst_base/RemoteVstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,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 );

Expand Down
5 changes: 5 additions & 0 deletions plugins/vst_base/RemoteVstPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading