Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linux support #5

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
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
35 changes: 28 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ endif (WIN32)

if (WIN32)
set (COMPILE_SYS_DEF "WIN32=1")
set (COPY_COMMAND "copy")
elseif (UNIX AND NOT APPLE)
set (COMPILE_SYS_DEF "LINUX=1")
set (COPY_COMMAND "cp")
elseif (APPLE)
set (COMPILE_SYS_DEF "DARWIN=1")
set (COPY_COMMAND "cp")
endif ()

# Packages
Expand All @@ -34,6 +37,9 @@ find_package (Lua REQUIRED)
find_package (cmake-lame CONFIG REQUIRED)
find_package (vsp4 CONFIG REQUIRED)
find_package (flowui CONFIG REQUIRED)
if (UNIX AND NOT APPLE)
find_package (Fontconfig REQUIRED)
endif ()

set (OUTPUT_DIR "${CMAKE_BINARY_DIR}/bin")
set (ENGINES_DIR "${OUTPUT_DIR}/synth-engines")
Expand All @@ -50,7 +56,7 @@ foreach (ITEM ${APP_CONFIG_SRC})

add_custom_command (
OUTPUT ${ITEM_TARGET}
COMMAND copy ${ITEM_INPUT} ${ITEM_OUTPUT}
COMMAND ${COPY_COMMAND} ${ITEM_INPUT} ${ITEM_OUTPUT}
DEPENDS ${ITEM}
COMMENT "Copying application config file: ${ITEM}"
VERBATIM)
Expand All @@ -72,7 +78,7 @@ foreach (ITEM ${REMIXICON_SRC})

add_custom_command (
OUTPUT ${ITEM_TARGET}
COMMAND copy ${ITEM_INPUT} ${ITEM_OUTPUT}
COMMAND ${COPY_COMMAND} ${ITEM_INPUT} ${ITEM_OUTPUT}
DEPENDS ${ITEM}
COMMENT "Copying icon file: ${ITEM}"
VERBATIM)
Expand Down Expand Up @@ -112,7 +118,7 @@ foreach (ITEM ${ENGINE_LIST})

add_custom_command (
OUTPUT ${ITEM_TARGET}
COMMAND copy ${ITEM_INPUT} ${ITEM_OUTPUT}
COMMAND ${COPY_COMMAND} ${ITEM_INPUT} ${ITEM_OUTPUT}
DEPENDS ${ITEM}
COMMENT "Copying engine file: ${ITEM}"
VERBATIM)
Expand Down Expand Up @@ -155,7 +161,7 @@ foreach (ITEM ${LAME_LIST})

add_custom_command (
OUTPUT ${ITEM_TARGET}
COMMAND copy ${ITEM_INPUT} ${ITEM_OUTPUT}
COMMAND ${COPY_COMMAND} ${ITEM_INPUT} ${ITEM_OUTPUT}
DEPENDS ${ITEM}
COMMENT "Copying lame executable file: ${ITEM}"
VERBATIM)
Expand Down Expand Up @@ -185,7 +191,12 @@ if (NOT MSVC)
target_compile_options (PluginSearcher PRIVATE -g)
endif (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
endif (NOT MSVC)
target_link_libraries (PluginSearcher PRIVATE juce-host-dev-kit::juce-full)
if (WIN32)
target_link_libraries (PluginSearcher PRIVATE juce-host-dev-kit::juce-full)
else ()
target_link_libraries (PluginSearcher PRIVATE Fontconfig::Fontconfig)
target_link_libraries (PluginSearcher PRIVATE juce-host-dev-kit::juce-full)
endif ()
if (MSVC)
target_link_options (PluginSearcher PRIVATE /SUBSYSTEM:WINDOWS)
elseif (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") AND WIN32)
Expand All @@ -212,6 +223,9 @@ if (NOT MSVC)
endif (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
endif (NOT MSVC)
target_link_libraries (FileRegistrar PRIVATE juce-host-dev-kit::juce-core)
if (UNIX AND NOT APPLE)
target_link_libraries (FileRegistrar PRIVATE Fontconfig::Fontconfig)
endif ()
if (MSVC)
target_link_options (FileRegistrar PRIVATE /SUBSYSTEM:WINDOWS)
elseif (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") AND WIN32)
Expand All @@ -235,6 +249,9 @@ target_link_libraries (VocalShaper PRIVATE
${LUA_LIBRARIES}
vsp4::vsp4
)
if (UNIX AND NOT APPLE)
target_link_libraries (VocalShaper PRIVATE Fontconfig::Fontconfig)
endif ()
if (NOT MSVC)
target_compile_options (VocalShaper PRIVATE -pthread)
if (NOT (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") AND WIN32))
Expand All @@ -244,10 +261,14 @@ if (NOT MSVC)
target_compile_options (VocalShaper PRIVATE -g)
endif (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
endif (NOT MSVC)
target_link_libraries (VocalShaper PRIVATE juce-host-dev-kit::juce-full)
if (WIN32)
target_link_libraries (VocalShaper PRIVATE Dbghelp ntdll)
target_link_libraries (VocalShaper PRIVATE juce-host-dev-kit::juce-full)
target_link_libraries (VocalShaper PRIVATE Dbghelp ntdll)
else ()
target_link_libraries (VocalShaper PRIVATE juce-host-dev-kit::juce-full)
target_link_libraries (VocalShaper PRIVATE Fontconfig::Fontconfig)
endif (WIN32)

if (MSVC)
target_link_options (VocalShaper PRIVATE /SUBSYSTEM:WINDOWS)
elseif (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") AND WIN32)
Expand Down
44 changes: 44 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,36 @@
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_RC_COMPILER": "llvm-rc"
}
},
{
"name": "Ninja Debug Linux LLVM",
"displayName": "Ninja Debug Linux LLVM",
"description": "Ninja Debug Linux LLVM",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/ninja-debug-linux-llvm",
"installDir": "${sourceDir}/install/ninja-debug-linux-llvm",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake",
"VCPKG_TARGET_TRIPLET": "x64-linux-llvm",
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++"
}
},
{
"name": "Ninja Release Linux LLVM",
"displayName": "Ninja Release Linux LLVM",
"description": "Ninja Release Linux LLVM",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/ninja-release-linux-llvm",
"installDir": "${sourceDir}/install/ninja-release-linux-llvm",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake",
"VCPKG_TARGET_TRIPLET": "x64-linux-llvm",
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++"
}
}
],
"buildPresets": [
Expand Down Expand Up @@ -99,6 +129,20 @@
"description": "Ninja Release Win64 LLVM",
"configurePreset": "Ninja Release Win64 LLVM",
"jobs": 16
},
{
"name": "Ninja Debug Linux LLVM",
"displayName": "Ninja Debug Linux LLVM",
"description": "Ninja Debug Linux LLVM",
"configurePreset": "Ninja Debug Linux LLVM",
"jobs": 16
},
{
"name": "Ninja Release Linux LLVM",
"displayName": "Ninja Release Linux LLVM",
"description": "Ninja Release Linux LLVM",
"configurePreset": "Ninja Release Linux LLVM",
"jobs": 16
}
]
}