Skip to content

Commit

Permalink
Changed the FL parser mechanism from download-binary to download-source
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStahL committed Feb 5, 2022
1 parent e72352c commit 50bbae7
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 12 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Vst3.x/*
!Vst3.x/README
Data/data.aps
Vsts/*/*.def
WaveSabreConvert/FLParser/Monad.FLParser.dll

# Ignore VS 2017 IDE fluff
.vs/
19 changes: 15 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ cmake_policy(SET CMP0057 NEW)
include(CSharpUtilities)
set(CMAKE_CSharp_FLAGS ${CMAKE_CSharp_FLAGS} "/langversion:6")

find_package(Git REQUIRED)
include(ExternalProject)

cmake_minimum_required(VERSION 3.11)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

Expand All @@ -19,7 +22,7 @@ set(BUILD_WAVESABRE_CONVERT_TESTS ON CACHE BOOL "Do not build the WaveSabreConve
set(BUILD_CONVERT_THE_FUCK ON CACHE BOOL "Do not build ConvertTheFuck.")
set(BUILD_PROJECT_MANAGER ON CACHE BOOL "Do not build the project manager.")
set(VSTSDK3_DIR "${PROJECT_SOURCE_DIR}/Vst3.x/" CACHE PATH "VSTSDK location.")
set(MONAD_FL_PARSER_DIR "${PROJECT_SOURCE_DIR}/WaveSabreConvert/FLParser/" CACHE PATH "Monad FL parser location.")
set(MONAD_FL_PARSER_DIR "${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser.Source" CACHE PATH "Monad FL parser location.")

# Download and unpack VST3 SDK
set(DOWNLOAD_VST3SDK OFF CACHE BOOL "Download and unpack VST3 SDK automatically.")
Expand All @@ -36,14 +39,22 @@ endif()

# Download and unpack the Monad FL Parser
set(DOWNLOAD_MONAD_FL_PARSER OFF CACHE BOOL "Download the Monad FL parser binary automatically.")
set(MONAD_FL_PARSER_BINARY ${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser/Release/Monad.FLParser.dll)
if(${BUILD_WAVESABRE_CONVERT} AND ${DOWNLOAD_MONAD_FL_PARSER})
find_file(MONAD_FL_PARSER_TEST name Monad.FLParser.dll HINTS ${MONAD_FL_PARSER_DIR})
find_file(MONAD_FL_PARSER_TEST NAME Project.cs HINTS ${MONAD_FL_PARSER_DIR})
if(${MONAD_FL_PARSER_TEST} MATCHES MONAD_FL_PARSER_TEST-NOTFOUND)
message(STATUS "Monad FL parser not found. Will download.")
file(DOWNLOAD https://github.com/LeStahL/FLParser/releases/download/compatibility-20.9/Monad.FLParser.dll Monad.FLParser.dll SHOW_PROGRESS)
file(COPY "${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser.dll" DESTINATION "${MONAD_FL_PARSER_DIR}")
ExternalProject_Add(FLParser
SOURCE_DIR ${MONAD_FL_PARSER_DIR}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser
GIT_REPOSITORY https://github.com/Kwarf/FLParser.git
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/WaveSabreConvert/FLParser/CMakeLists.txt ${MONAD_FL_PARSER_DIR}/CMakeLists.txt && ${CMAKE_COMMAND} ${MONAD_FL_PARSER_DIR} -DMONAD_FL_PARSER_DIR=${MONAD_FL_PARSER_DIR}
BUILD_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/Monad.FLParser --config Release -- -m
INSTALL_COMMAND ""
)
endif()
endif()
# add_subdirectory(${MONAD_FL_PARSER_DIR})

# shared code
add_subdirectory(MSVCRT)
Expand Down
7 changes: 5 additions & 2 deletions WaveSabreConvert/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ set(WAVESABRE_CONVERT_SOURCES
)

add_library(WaveSabreConvert SHARED ${WAVESABRE_CONVERT_SOURCES})

# target_link_libraries(WaveSabreConvert Monad.FLParser)
message(STATUS "${MONAD_FL_PARSER_BINARY}")
csharp_set_designer_cs_properties(${WAVESABRE_CONVERT_SOURCES})
csharp_set_windows_forms_properties(${WAVESABRE_CONVERT_SOURCES})
set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_REFERENCE_Monad.FLParser "${MONAD_FL_PARSER_DIR}/Monad.FLParser.dll")
set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_REFERENCE_Monad.FLParser "${MONAD_FL_PARSER_BINARY}")
set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.1")
set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_REFERENCES
"System"
Expand All @@ -49,3 +50,5 @@ set_property(TARGET WaveSabreConvert PROPERTY VS_DOTNET_REFERENCES
"System.ComponentModel"
)
set_target_properties(WaveSabreConvert PROPERTIES VS_GLOBAL_ROOTNAMESPACE WaveSabreConvert)

# add_dependencies(WaveSabreConvert Monad.FLParser)
37 changes: 37 additions & 0 deletions WaveSabreConvert/FLParser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
cmake_minimum_required(VERSION 3.11)

project(Monad.FLParser LANGUAGES CSharp)

include(CSharpUtilities)
set(CMAKE_CSharp_FLAGS ${CMAKE_CSharp_FLAGS} "/langversion:6")

set(MONAD_FL_PARSER_SOURCES
${MONAD_FL_PARSER_DIR}/Properties/AssemblyInfo.cs

${MONAD_FL_PARSER_DIR}/AutomationData.cs
${MONAD_FL_PARSER_DIR}/AutomationKeyframe.cs
${MONAD_FL_PARSER_DIR}/Channel.cs
${MONAD_FL_PARSER_DIR}/ChannelPlaylistItem.cs
${MONAD_FL_PARSER_DIR}/Enums.cs
${MONAD_FL_PARSER_DIR}/FlParseException.cs
${MONAD_FL_PARSER_DIR}/GeneratorData.cs
${MONAD_FL_PARSER_DIR}/IChannelData.cs
${MONAD_FL_PARSER_DIR}/Insert.cs
${MONAD_FL_PARSER_DIR}/InsertSlot.cs
${MONAD_FL_PARSER_DIR}/IPlaylistItem.cs
${MONAD_FL_PARSER_DIR}/Note.cs
${MONAD_FL_PARSER_DIR}/Pattern.cs
${MONAD_FL_PARSER_DIR}/PatternPlaylistItem.cs
${MONAD_FL_PARSER_DIR}/Plugin.cs
${MONAD_FL_PARSER_DIR}/PluginIoInfo.cs
${MONAD_FL_PARSER_DIR}/Project.cs
${MONAD_FL_PARSER_DIR}/ProjectParser.cs
${MONAD_FL_PARSER_DIR}/Track.cs
)

add_library(Monad.FLParser SHARED ${MONAD_FL_PARSER_SOURCES})
set_property(TARGET Monad.FLParser PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.1")
set_property(TARGET Monad.FLParser PROPERTY VS_DOTNET_REFERENCES
"System"
"System.Core"
)
5 changes: 0 additions & 5 deletions WaveSabreConvert/FLParser/README

This file was deleted.

0 comments on commit 50bbae7

Please sign in to comment.