Skip to content

Instantly share code, notes, and snippets.

@TheBurnDoc
Last active December 26, 2015 03:19
Show Gist options
  • Save TheBurnDoc/7085582 to your computer and use it in GitHub Desktop.
Save TheBurnDoc/7085582 to your computer and use it in GitHub Desktop.
Template Sublime Text 3 C++ project configuration, with supporting script files. The custom build system depends on CMake 2.8 and assumes GCC 4.8+ or Visual Studio 2012 Nov 2012 CTP for the best C++11 support available at the time. Also these files only build 64-bit debug configurations at present.
{
"folders":
[
{
"path": "src",
"name": "Source",
},
{
"path": ".",
"name": "Miscelaneous",
"folder_exclude_patterns": ["*"]
}
],
"build_systems":
[
{
"name": "build.sh",
"shell": true,
"cmd": [ "${project_path}/build.sh" ],
"file_regex": "^(..[^:\n]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${project_path}",
"osx":
{
"env":
{
"PATH": "/usr/local/bin:/opt/local/bin:$PATH",
}
},
"windows":
{
"cmd": [ "${project_path}\\build.cmd" ],
"file_regex": "^\\.?\\.?\\\\?(.*)\\(([0-9]+)\\):() (.*)$"
}
},
],
"settings":
{
"rulers": [80, 100],
"tab_size": 4,
"default_line_ending": "unix",
"translate_tabs_to_spaces": true
},
}
@echo off
:: Depends on VS2012 Update 3 with Nov 2012 CTP and CMake 2.8
call "%VS110COMNTOOLS%\vsvars32.bat"
call "%VCINSTALLDIR%\vcvarsall.bat" x86_amd64
if not exist build mkdir build
cd build
"%ProgramFiles(x86)%\CMake 2.8\bin\cmake" -G "Visual Studio 11 Win64" -T "v120_CTP_Nov2012" ..
msbuild /nologo /clp:NoSummary ALL_BUILD.vcxproj
cd ..
#!/bin/bash
if [[ $OSTYPE == cygwin* ]]; then
./build.cmd
else
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=DEBUG
make
status=$?
fi
cd ..
exit $status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment