add:添加vs配置。
This commit is contained in:
parent
55cf6eb471
commit
cdfebd9741
95
CMakeSettings.json
Normal file
95
CMakeSettings.json
Normal file
@ -0,0 +1,95 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x64 Local Debug",
|
||||
"generator": "Visual Studio 17 2022 Win64",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"environments": [
|
||||
{
|
||||
"PATH": "C:\\Qt\\Qt5.14.2\\5.14.2\\msvc2017_64\\bin;${env.PATH}",
|
||||
"VCPKG_ROOT": "D:/vcpkg"
|
||||
}
|
||||
],
|
||||
"variables": [
|
||||
{
|
||||
"name": "CMAKE_PREFIX_PATH",
|
||||
"value": "C:\\Qt\\Qt5.14.2\\5.14.2\\msvc2017_64"
|
||||
},
|
||||
{
|
||||
"name": "CMAKE_TOOLCHAIN_FILE",
|
||||
"value": "${env.VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64 Local Release",
|
||||
"generator": "Visual Studio 17 2022 Win64",
|
||||
"configurationType": "Release",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"environments": [
|
||||
{
|
||||
"PATH": "C:\\Qt\\Qt5.14.2\\5.14.2\\msvc2017_64\\bin;${env.PATH}",
|
||||
"VCPKG_ROOT": "D:/vcpkg"
|
||||
}
|
||||
],
|
||||
"variables": [
|
||||
{
|
||||
"name": "CMAKE_PREFIX_PATH",
|
||||
"value": "C:\\Qt\\Qt5.14.2\\5.14.2\\msvc2017_64"
|
||||
},
|
||||
{
|
||||
"name": "CMAKE_TOOLCHAIN_FILE",
|
||||
"value": "${env.VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64 Linux Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"cmakeExecutable": "cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", "out" ],
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x64" ],
|
||||
"remoteMachineName": "${defaultRemoteMachineName}",
|
||||
"remoteCMakeListsRoot": "$HOME/vs/${projectDirName}/${workspaceHash}/src",
|
||||
"remoteBuildRoot": "$HOME/vs/${projectDirName}/${workspaceHash}/out/build/${name}",
|
||||
"remoteInstallRoot": "$HOME/vs/${projectDirName}/${workspaceHash}/out/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete",
|
||||
"remoteCopyBuildOutput": false,
|
||||
"remoteCopySourcesMethod": "rsync",
|
||||
"variables": []
|
||||
},
|
||||
{
|
||||
"name": "x64 Linux Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Release",
|
||||
"cmakeExecutable": "cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", "out" ],
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x64" ],
|
||||
"remoteMachineName": "${defaultRemoteMachineName}",
|
||||
"remoteCMakeListsRoot": "$HOME/vs/${projectDirName}/${workspaceHash}/src",
|
||||
"remoteBuildRoot": "$HOME/vs/${projectDirName}/${workspaceHash}/out/build/${name}",
|
||||
"remoteInstallRoot": "$HOME/vs/${projectDirName}/${workspaceHash}/out/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete",
|
||||
"remoteCopyBuildOutput": false,
|
||||
"remoteCopySourcesMethod": "rsync",
|
||||
"variables": []
|
||||
}
|
||||
]
|
||||
}
|
1
main.cpp
1
main.cpp
@ -81,6 +81,7 @@ bool handle_work(const std::string& source_dir, const std::string& purpose)
|
||||
ret[1] = static_cast<int>(cp("main.cpp"));
|
||||
ret[2] = static_cast<int>(cp(".clang-format"));
|
||||
ret[3] = static_cast<int>(cp(".gitignore"));
|
||||
ret[4] = static_cast<int>(cp("CMakeSettings.json"));
|
||||
|
||||
fs::path vscodeConfig(source_dir);
|
||||
vscodeConfig.append(".vscode/settings.json");
|
||||
|
43
template/.gitignore
vendored
43
template/.gitignore
vendored
@ -1,4 +1,45 @@
|
||||
# Prerequisites
|
||||
*.d
|
||||
.idea
|
||||
cmake-build-*
|
||||
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
*.smod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
!lebo_motor.lib
|
||||
!lebo_motor.dll
|
||||
!liblebo_motor.so
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
build
|
||||
*.user
|
||||
compile_commands.json
|
||||
.vs
|
||||
out
|
||||
.cache
|
||||
cmake-*
|
||||
CMakeLists.txt.*
|
95
template/CMakeSettings.json
Normal file
95
template/CMakeSettings.json
Normal file
@ -0,0 +1,95 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x64 Local Debug",
|
||||
"generator": "Visual Studio 17 2022 Win64",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"environments": [
|
||||
{
|
||||
"PATH": "C:\\Qt\\Qt5.14.2\\5.14.2\\msvc2017_64\\bin;${env.PATH}",
|
||||
"VCPKG_ROOT": "D:/vcpkg"
|
||||
}
|
||||
],
|
||||
"variables": [
|
||||
{
|
||||
"name": "CMAKE_PREFIX_PATH",
|
||||
"value": "C:\\Qt\\Qt5.14.2\\5.14.2\\msvc2017_64"
|
||||
},
|
||||
{
|
||||
"name": "CMAKE_TOOLCHAIN_FILE",
|
||||
"value": "${env.VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64 Local Release",
|
||||
"generator": "Visual Studio 17 2022 Win64",
|
||||
"configurationType": "Release",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"environments": [
|
||||
{
|
||||
"PATH": "C:\\Qt\\Qt5.14.2\\5.14.2\\msvc2017_64\\bin;${env.PATH}",
|
||||
"VCPKG_ROOT": "D:/vcpkg"
|
||||
}
|
||||
],
|
||||
"variables": [
|
||||
{
|
||||
"name": "CMAKE_PREFIX_PATH",
|
||||
"value": "C:\\Qt\\Qt5.14.2\\5.14.2\\msvc2017_64"
|
||||
},
|
||||
{
|
||||
"name": "CMAKE_TOOLCHAIN_FILE",
|
||||
"value": "${env.VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64 Linux Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"cmakeExecutable": "cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", "out" ],
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x64" ],
|
||||
"remoteMachineName": "${defaultRemoteMachineName}",
|
||||
"remoteCMakeListsRoot": "$HOME/vs/${projectDirName}/${workspaceHash}/src",
|
||||
"remoteBuildRoot": "$HOME/vs/${projectDirName}/${workspaceHash}/out/build/${name}",
|
||||
"remoteInstallRoot": "$HOME/vs/${projectDirName}/${workspaceHash}/out/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete",
|
||||
"remoteCopyBuildOutput": false,
|
||||
"remoteCopySourcesMethod": "rsync",
|
||||
"variables": []
|
||||
},
|
||||
{
|
||||
"name": "x64 Linux Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Release",
|
||||
"cmakeExecutable": "cmake",
|
||||
"remoteCopySourcesExclusionList": [ ".vs", "out" ],
|
||||
"cmakeCommandArgs": "",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "linux_x64" ],
|
||||
"remoteMachineName": "${defaultRemoteMachineName}",
|
||||
"remoteCMakeListsRoot": "$HOME/vs/${projectDirName}/${workspaceHash}/src",
|
||||
"remoteBuildRoot": "$HOME/vs/${projectDirName}/${workspaceHash}/out/build/${name}",
|
||||
"remoteInstallRoot": "$HOME/vs/${projectDirName}/${workspaceHash}/out/install/${name}",
|
||||
"remoteCopySources": true,
|
||||
"rsyncCommandArgs": "-t --delete",
|
||||
"remoteCopyBuildOutput": false,
|
||||
"remoteCopySourcesMethod": "rsync",
|
||||
"variables": []
|
||||
}
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user