Skip to content

Fix git push error for protected CLA branch #835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 52 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
dc94275
updates for linux project config
Oct 30, 2018
05f9506
merge from master
Oct 31, 2018
ad0f7a1
more edits
Nov 7, 2018
ad5687f
initial reorg of topic content
Nov 8, 2018
f9649e4
moved debug and config sections to new topics per PM
Nov 8, 2018
392044b
more edits
Nov 9, 2018
23e8db6
fixed merge conflict
Nov 9, 2018
a7e3013
renamed file and adjusted toc
Nov 9, 2018
7cac39f
fixed link
Nov 9, 2018
d6374da
Merge branch 'mb-linux-cmake' of github.com:mikeblome/cpp-docs-pr int…
Nov 9, 2018
c88f27e
new images
Nov 9, 2018
1019abc
restoring branch with new images
Nov 9, 2018
95b0987
added new info from blog
Nov 9, 2018
a12506a
new image
Nov 9, 2018
66c0a1b
more edits
Nov 12, 2018
b163473
Merge branch 'mb-linux-cmake' of github.com:mikeblome/cpp-docs-pr int…
Nov 12, 2018
cc64cdf
created ref topics for json files
Nov 12, 2018
aa3921e
more edits
Nov 13, 2018
e68abf4
Merge branch 'master' into mb-linux-cmake
Nov 14, 2018
6224ab4
more updates
Nov 15, 2018
e681f35
updates to cppproperties topic
Nov 16, 2018
a852e9b
code examples and art for cppproperties
Nov 16, 2018
47f50b5
fixed art
Nov 16, 2018
4a7a145
new tutorial and other tweaks for cmake
Jan 17, 2019
969ae2e
fixed merge conflict
Jan 18, 2019
f50fbfe
added new topic to temp position in tocs
Jan 18, 2019
9e6f62d
additional images and acrolinx fixes
Jan 18, 2019
e8a1123
Merge branch 'master' into mb-linux-cmake
Jan 18, 2019
2ad47d2
more improvements to tutorial topic
Jan 18, 2019
fa6f614
fixed images and heading in open folder topic
Jan 18, 2019
5f16ebd
tweaked a heading and some wording in tutorial
Jan 18, 2019
b937b96
updated new ref topics and removed versioning info
Jan 22, 2019
bd167ae
changes per tech review
Feb 6, 2019
6469571
fixed up see alsos and broken links
Feb 7, 2019
f5b1437
fixed links
Feb 7, 2019
e70763f
new section on CMakeSettings
Feb 9, 2019
9eea580
a few more updates
Feb 11, 2019
16b4019
Merge branch 'master' into mb-linux-cmake
Feb 11, 2019
f38fd0c
Merge branch 'master' into mb-linux-cmake
Feb 28, 2019
d64aeb7
acrolinx fixes
Feb 28, 2019
635db92
resource file revision pr4
Mar 1, 2019
d781c20
image editor
Mar 4, 2019
ee7efc9
revisions per edit pass
Mar 5, 2019
c76f25b
touchups part 1
Mar 5, 2019
3de2347
last revision
Mar 6, 2019
c9a9eb6
fixed code block indents
Mar 6, 2019
dbc7510
Merge pull request #1803 from msebolt/resource-file-revision-pr4
v-shils Mar 6, 2019
c45d53b
adjust format
GitHubber17 Mar 7, 2019
ef23948
adjust format
GitHubber17 Mar 7, 2019
bdd0ad5
Merge pull request #1563 from mikeblome/mb-linux-cmake
GitHubber17 Mar 7, 2019
b464576
Merge pull request #1808 from MicrosoftDocs/master
Taojunshen Mar 7, 2019
856b9b0
Merging changes synced from https://github.com/MicrosoftDocs/cpp-docs…
opbld16 Mar 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/ide/TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
## [Rename](refactoring/rename.md)
# [Visual C++ Tools and Features in Visual Studio Editions](visual-cpp-tools-and-features-in-visual-studio-editions.md)
# [Open Folder projects](non-msbuild-projects.md)
## [CppProperties.json schema reference](cppproperties-schema-reference.md)
## [Tasks.vs.json schema reference (C++)](tasks-vs-json-schema-reference-cpp.md)
# [CMake projects](cmake-tools-for-visual-cpp.md)
## [Tutorial: Create C++ cross-platform projects in Visual Studio](get-started-linux-cmake.md)
## [Configure a Linux CMake project](../linux/cmake-linux-project.md)
## [Customize CMake build settings](customize-cmake-settings.md)
## [Configure CMake debugging sessions](configure-cmake-debugging-sessions.md)
## [CMakeSettings.json reference](cmakesettings-reference.md)
## [CMake predefined configuration schema reference](cmake-predefined-configuration-reference.md)
# [MSBuild Projects](creating-and-managing-visual-cpp-projects.md)
## [Project Types in Visual C++](visual-cpp-project-types.md)
## [Add New Item Templates in Visual C++](using-visual-cpp-add-new-item-templates.md)
Expand Down
348 changes: 348 additions & 0 deletions docs/ide/cmake-predefined-configuration-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,348 @@
---
title: "CMake predefined configuration reference"
ms.description: "Visual Studio provides several predefined build configurations for CMake projects on Linux, Windows, ARM, and IoT."
ms.date: "03/05/2019"
helpviewer_keywords: ["CMake redefined configurations"]
---

# CMake predefined build configurations

In a CMake project, build configurations are stored in a CMakeSettings.json file. When you choose **Manage Configurations** from the build configuration dropdown in the main toolbar, a dialog appears that shows the default CMake configurations available in Visual Studio:
- x86 Debug
- x86 Release
- x64 Debug
- x64 Release
- Linux-Debug
- Linux-Release
- IoT Debug
- IoT Release
- MinGW Debug
- MinGW Release

When you choose a configuration, it is added to the CMakeSettings.json file in the project's root folder. You can then use it to build your project.


## Linux predefined build configurations:

```json
{
"name": "Linux-Debug",
"generator": "Unix Makefiles",
"remoteMachineName": "user@host",
"configurationType": "Debug",
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
"cmakeExecutable": "/usr/local/bin/cmake",
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
"remoteCopySources": true,
"remoteCopySourcesOutputVerbosity": "Normal",
"remoteCopySourcesConcurrentCopies": "10",
"remoteCopySourcesMethod": "rsync",
"remoteCopySourcesExclusionList": [
".vs",
".git"
],
"rsyncCommandArgs": "-t --delete --delete-excluded",
"remoteCopyBuildOutput": false,
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [
"linux_x64"
]
}

{
"name": "Linux-Release",
"generator": "Unix Makefiles",
"remoteMachineName": "${defaultRemoteMachineName}",
"configurationType": "RelWithDebInfo",
"remoteCMakeListsRoot": "/var/tmp/src/${workspaceHash}/${name}",
"cmakeExecutable": "/usr/local/bin/cmake",
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"remoteBuildRoot": "/var/tmp/build/${workspaceHash}/build/${name}",
"remoteInstallRoot": "/var/tmp/build/${workspaceHash}/install/${name}",
"remoteCopySources": true,
"remoteCopySourcesOutputVerbosity": "Normal",
"remoteCopySourcesConcurrentCopies": "10",
"remoteCopySourcesMethod": "rsync",
"remoteCopySourcesExclusionList": [
".vs",
".git"
],
"rsyncCommandArgs": "-t --delete --delete-excluded",
"remoteCopyBuildOutput": false,
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [
"linux_x64"
]
},
```


You can use these optional settings for more control:

```json
{
"remotePreBuildCommand": "",
"remotePreGenerateCommand": "",
"remotePostBuildCommand": "",
}
```

These options allow you to run commands on the remote system before and after building, and before CMake generation. The values can be any command that is valid on the remote system. The output is piped back to Visual Studio.

## IoT predefined build configurations

```json
{
"name": "IoT-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"gcc-arm"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"intelliSenseMode": "linux-gcc-arm",
"variables": [
{
"name": "CMAKE_C_COMPILER",
"value": "arm-none-eabi-gcc.exe"
},
{
"name": "CMAKE_CXX_COMPILER",
"value": "arm-none-eabi-g++.exe"
},
{
"name": "CMAKE_C_FLAGS",
"value": "-nostartfiles"
},
{
"name": "CMAKE_CXX_FLAGS",
"value": "-nostartfiles -fno-rtti -fno-exceptions"
},
{
"name": "CMAKE_CXX_STANDARD",
"value": "14"
},
{
"name": "CMAKE_SYSTEM_NAME",
"value": "Generic"
},
{
"name": "CMAKE_SYSTEM_PROCESSOR",
"value": "arm"
}
]
},
{
"name": "IoT-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [
"gcc-arm"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"intelliSenseMode": "linux-gcc-arm",
"variables": [
{
"name": "CMAKE_C_COMPILER",
"value": "arm-none-eabi-gcc.exe"
},
{
"name": "CMAKE_CXX_COMPILER",
"value": "arm-none-eabi-g++.exe"
},
{
"name": "CMAKE_C_FLAGS",
"value": "-nostartfiles"
},
{
"name": "CMAKE_CXX_FLAGS",
"value": "-nostartfiles -fno-rtti -fno-exceptions"
},
{
"name": "CMAKE_CXX_STANDARD",
"value": "14"
},
{
"name": "CMAKE_SYSTEM_NAME",
"value": "Generic"
},
{
"name": "CMAKE_SYSTEM_PROCESSOR",
"value": "arm"
}
]
}
```

## MinGW predefined build configurations

```json
{
"environments": [
{
"MINGW64_ROOT": "C:\\msys64\\mingw64",
"BIN_ROOT": "${env.MINGW64_ROOT}\\bin",
"FLAVOR": "x86_64-w64-mingw32",
"TOOLSET_VERSION": "7.3.0",
"PATH": "${env.MINGW64_ROOT}\\bin;${env.MINGW64_ROOT}\\..\\usr\\local\\bin;${env.MINGW64_ROOT}\\..\\usr\\bin;${env.MINGW64_ROOT}\\..\\bin;${env.PATH}",
"INCLUDE": "${env.INCLUDE};${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION};${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION}\\tr1;${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION}\\${env.FLAVOR}",
"environment": "mingw_64"
}
],
"name": "Mingw64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"mingw_64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"intelliSenseMode": "linux-gcc-x64",
"variables": [
{
"name": "CMAKE_C_COMPILER",
"value": "${env.BIN_ROOT}\\gcc.exe"
},
{
"name": "CMAKE_CXX_COMPILER",
"value": "${env.BIN_ROOT}\\g++.exe"
}
]
}

{
"environments": [
{
"MINGW64_ROOT": "C:\\msys64\\mingw64",
"BIN_ROOT": "${env.MINGW64_ROOT}\\bin",
"FLAVOR": "x86_64-w64-mingw32",
"TOOLSET_VERSION": "7.3.0",
"PATH": "${env.MINGW64_ROOT}\\bin;${env.MINGW64_ROOT}\\..\\usr\\local\\bin;${env.MINGW64_ROOT}\\..\\usr\\bin;${env.MINGW64_ROOT}\\..\\bin;${env.PATH}",
"INCLUDE": "${env.INCLUDE};${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION};${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION}\\tr1;${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION}\\${env.FLAVOR}",
"environment": "mingw_64"
}
],
"name": "Mingw64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [
"mingw_64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"intelliSenseMode": "linux-gcc-x64",
"variables": [
{
"name": "CMAKE_C_COMPILER",
"value": "${env.BIN_ROOT}\\gcc.exe"
},
{
"name": "CMAKE_CXX_COMPILER",
"value": "${env.BIN_ROOT}\\g++.exe"
}
]
}
```

## x86-64 predefined build configurations

```json
{
"name": "x86-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x86"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
},
{
"name": "x86-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [
"msvc_x86"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
},
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x64_x64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
},
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [
"msvc_x64_x64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
},
{
"name": "x86-Release2",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [
"msvc_x86"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
}
]
}
```

## See Also

[CMake Tools for Visual C++](../ide/cmake-tools-for-visual-cpp.md)<br/>
[Configure a Linux CMake project](../linux/cmake-linux-project.md)<br/>
[Connect to your remote Linux computer](../linux/connect-to-your-remote-linux-computer.md)<br/>
[Configure CMake debugging sessions](configure-cmake-debugging-sessions.md)<br/>
[Deploy, run, and debug your Linux project](../linux/deploy-run-and-debug-your-linux-project.md)<br/>
[CMake predefined configuration reference](cmake-predefined-configuration-reference.md)<br/>
Loading