diff --git a/.gitignore b/.gitignore index fb50bed..6b11399 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .vs Debug Release +x64 +out *.user *.aps diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..53d9735 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.16) + +project(JDTools) +add_executable(JDTools + JDTools/Convert800to990.cpp + JDTools/Convert800toVST.cpp + JDTools/Convert990to800.cpp + JDTools/ConvertVSTto800.cpp + JDTools/InputFile.cpp + JDTools/JDTools.cpp + JDTools/SVZ.cpp + JDTools/InputFile.hpp + JDTools/JD-08.hpp + JDTools/JD-800.hpp + JDTools/JD-990.hpp + JDTools/JDTools.hpp + JDTools/PrecomputedTablesVST.hpp + JDTools/SVZ.hpp + JDTools/Utils.hpp + JDTools/miniz.c + JDTools/miniz.h + JDTools/resource.h) + +if(WIN32) + target_sources(JDTools PRIVATE + JDTools/JDTools.manifest + JDTools/JDTools.rc) +endif() + +if(MSVC) + if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + endif() +elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +endif() + +set_property(TARGET JDTools PROPERTY CXX_STANDARD 20) diff --git a/CMakeSettings.json b/CMakeSettings.json new file mode 100644 index 0000000..512723d --- /dev/null +++ b/CMakeSettings.json @@ -0,0 +1,75 @@ +{ + "configurations": [ + { + "name": "x64-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ "msvc_x64_x64" ], + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "" + }, + { + "name": "x86-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x86" ], + "variables": [] + }, + { + "name": "x64-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x64_x64" ], + "variables": [] + }, + { + "name": "x86-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x86" ], + "variables": [] + }, + { + "name": "arm64-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_arm64_x64" ], + "variables": [] + }, + { + "name": "arm64-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_arm64_x64" ], + "variables": [] + } + ] +} \ No newline at end of file diff --git a/readme.md b/readme.md index d2282fa..fe19a1a 100644 --- a/readme.md +++ b/readme.md @@ -114,5 +114,5 @@ JDTools is provided under the BSD 3-clause license. JDTools makes use of miniz, # Building -This project is written in C++20. Currently only Visual Studio 2019 project is provided, but the code is platform-independent and should be trivial to convert to any other build system. +This project is written in C++ 20. For building, the cross-platform CMake project, or alternatively the Visual Studio 2019 solution for Windows can be used.