diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..f015637
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.16)
+
+project(mob)
+add_subdirectory(src)
+
+set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT mob)
diff --git a/bootstrap.ps1 b/bootstrap.ps1
index 9e797d7..69ce93a 100644
--- a/bootstrap.ps1
+++ b/bootstrap.ps1
@@ -1,40 +1,19 @@
$root = $PSScriptRoot
if (!$root) {
- $root = "."
+ $root = "."
}
-$installationPath = & $root\third-party\bin\vswhere.exe -products * -nologo -prerelease -latest -property installationPath
-if (! $?) {
- Write-Error "vswhere returned $LastExitCode"
- exit $LastExitCode
-}
-
-if (! $installationPath) {
- Write-Error "Empty installation path"
- exit 1
-}
-
-$opts = ""
-$opts += " $root\vs\mob.sln"
-$opts += " -m"
-$opts += " -p:Configuration=Release"
-$opts += " -noLogo"
-$opts += " -p:UseMultiToolTask=true"
-$opts += " -p:EnforceProcessCountAcrossBuilds=true"
-$opts += " -clp:ErrorsOnly;Verbosity=minimal"
-
-$vsDevCmd = "$installationPath\Common7\Tools\VsDevCmd.bat"
-if (!(Test-Path "$vsDevCmd")) {
- Write-Error "VdDevCmd.bat not found at $vsDevCmd"
- exit 1
-}
-
-& "${env:COMSPEC}" /c "`"$vsDevCmd`" -no_logo -arch=amd64 -host_arch=amd64 && msbuild $opts"
+cmake -B $root/build $root | Out-Null
+cmake --build $root/build --config Release -- `
+ "-p:UseMultiToolTask=true" `
+ "-noLogo" `
+ "-p:EnforceProcessCountAcrossBuilds=true" `
+ "-clp:ErrorsOnly;Verbosity=minimal"
if (! $?) {
Write-Error "Build failed"
exit $LastExitCode
}
-Copy-Item "$root\build\Release\x64\mob.exe" "$root\mob.exe"
-echo "run ``.\mob -d prefix/path build`` to start building"
\ No newline at end of file
+Copy-Item "$root\build\src\Release\mob.exe" "$root\mob.exe"
+Write-Output "run ``.\mob -d prefix/path build`` to start building"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..f52246c
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 3.16)
+
+file(GLOB_RECURSE source_files *.cpp)
+file(GLOB RECURSE header_files *.h)
+
+add_executable(mob ${source_files})
+set_target_properties(mob PROPERTIES CXX_STANDARD 20)
+
+target_compile_definitions(mob PUBLIC NOMINMAX)
+target_compile_options(mob PUBLIC "/MT")
+target_include_directories(mob PUBLIC ${CMAKE_SOURCE_DIR}/third-party/include)
+target_link_libraries(mob PUBLIC
+ wsock32 ws2_32 crypt32 wldap32 dbghelp shlwapi version
+ optimized ${CMAKE_SOURCE_DIR}/third-party/lib/libcurl.lib
+ debug ${CMAKE_SOURCE_DIR}/third-party/lib/libcurl-d.lib
+ optimized ${CMAKE_SOURCE_DIR}/third-party/lib/zlib.lib
+ debug ${CMAKE_SOURCE_DIR}/third-party/lib/zlibd.lib)
+
+source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}
+ PREFIX src
+ FILES ${source_files} ${header_files})
+set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT mob)
diff --git a/vs/debug.props b/vs/debug.props
deleted file mode 100644
index 745efbe..0000000
--- a/vs/debug.props
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
- libcurl-d.lib;zlibd.lib;%(AdditionalDependencies)
-
-
- MultiThreadedDebug
-
-
-
-
\ No newline at end of file
diff --git a/vs/mob.sln b/vs/mob.sln
deleted file mode 100644
index fe6f3cf..0000000
--- a/vs/mob.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30014.187
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mob", "mob.vcxproj", "{CB2CB683-78DA-44B9-B762-D195041F234E}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x64 = Debug|x64
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {CB2CB683-78DA-44B9-B762-D195041F234E}.Debug|x64.ActiveCfg = Debug|x64
- {CB2CB683-78DA-44B9-B762-D195041F234E}.Debug|x64.Build.0 = Debug|x64
- {CB2CB683-78DA-44B9-B762-D195041F234E}.Release|x64.ActiveCfg = Release|x64
- {CB2CB683-78DA-44B9-B762-D195041F234E}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {84F7C190-1CD8-46DF-9349-05A62C5B02B5}
- EndGlobalSection
-EndGlobal
diff --git a/vs/mob.vcxproj b/vs/mob.vcxproj
deleted file mode 100644
index cafed2a..0000000
--- a/vs/mob.vcxproj
+++ /dev/null
@@ -1,162 +0,0 @@
-
-
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
-
- 16.0
- Win32Proj
- {cb2cb683-78da-44b9-b762-d195041f234e}
- mob
- 10.0
-
-
-
- Application
- true
- v143
- Unicode
-
-
- Application
- false
- v143
- Unicode
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
-
-
-
-
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Create
- Create
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vs/mob.vcxproj.filters b/vs/mob.vcxproj.filters
deleted file mode 100644
index de212c4..0000000
--- a/vs/mob.vcxproj.filters
+++ /dev/null
@@ -1,291 +0,0 @@
-
-
-
-
- {23ea265d-5536-4626-b27a-5403447aec6e}
-
-
- {892d19b8-e898-4c80-be14-e1ee1fb13209}
-
-
- {b0afbfc3-9b49-4768-9077-a8284ced4416}
-
-
- {6e4d31d5-100c-4a4d-8e7d-4c48939819bd}
-
-
- {78dd6066-d407-4450-b520-649454c15ee9}
-
-
- {b9307be3-9ccb-4449-8aed-d9b69f0beda9}
-
-
-
-
- src
-
-
- src
-
-
- src
-
-
- src
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tools
-
-
- src\tools
-
-
- src\tools
-
-
- src\tools
-
-
- src\tools
-
-
- src\tools
-
-
- src\tools
-
-
- src\tools
-
-
- src\tools
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\core
-
-
- src\core
-
-
- src\core
-
-
- src\core
-
-
- src\core
-
-
- src\utility
-
-
- src\utility
-
-
- src\utility
-
-
- src\utility
-
-
- src\utility
-
-
- src\cmd
-
-
- src\cmd
-
-
- src\cmd
-
-
- src\cmd
-
-
- src\cmd
-
-
- src\cmd
-
-
- src\cmd
-
-
- src\cmd
-
-
- src\core
-
-
- src\core
-
-
- src\core
-
-
- src\tools
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tools
-
-
-
-
- src
-
-
- src
-
-
- src
-
-
- src\tasks
-
-
- src\tasks
-
-
- src\tools
-
-
- src\core
-
-
- src\core
-
-
- src\core
-
-
- src\core
-
-
- src\core
-
-
- src\utility
-
-
- src\utility
-
-
- src\utility
-
-
- src\utility
-
-
- src\utility
-
-
- src\utility
-
-
- src\cmd
-
-
- src\utility
-
-
- src\core
-
-
- src\core
-
-
- src\core
-
-
- src\tools
-
-
- src\tools
-
-
- src\tools
-
-
- src\tasks
-
-
-
\ No newline at end of file
diff --git a/vs/props.props b/vs/props.props
deleted file mode 100644
index 046c06c..0000000
--- a/vs/props.props
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
- $(SolutionDir)..\build\$(Configuration)\$(PlatformTarget)\
- $(ProjectDir)obj\$(ProjectName)\$(Configuration)\$(PlatformTarget)\
-
-
-
- EnableAllWarnings
-
-
-
-
- Caret
- true
- stdcpplatest
- Use
- pch.h
- $(IntDir)fake\%(RelativeDir)
- _CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING;CURL_STATICLIB;NOMINMAX;%(PreprocessorDefinitions)
- ..\third-party\include;%(AdditionalIncludeDirectories)
- 4566
-
-
- ..\third-party\lib;%(AdditionalLibraryDirectories)
- Ws2_32.lib;Crypt32.lib;Wldap32.lib;Shlwapi.lib;DbgHelp.lib;Version.lib;%(AdditionalDependencies)
-
-
-
-
\ No newline at end of file
diff --git a/vs/release.props b/vs/release.props
deleted file mode 100644
index 451936a..0000000
--- a/vs/release.props
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
- libcurl.lib;zlib.lib;%(AdditionalDependencies)
- true
- true
- UseLinkTimeCodeGeneration
-
-
- AnySuitable
-
-
- true
- NDEBUG;%(PreprocessorDefinitions)
- true
- true
- true
-
-
-
-
\ No newline at end of file