Skip to content

Commit

Permalink
Add cross-platform CMake build system
Browse files Browse the repository at this point in the history
  • Loading branch information
sagamusix committed Aug 2, 2022
1 parent b2229d5 commit 3e2efa5
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.vs
Debug
Release
x64
out
*.user
*.aps
40 changes: 40 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
75 changes: 75 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -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": []
}
]
}
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 3e2efa5

Please sign in to comment.