C++ projects and SublimeText

238 views
Skip to first unread message

Justin Israel

unread,
Apr 18, 2016, 7:01:32 AM4/18/16
to python_in...@googlegroups.com
In case anyone likes using SublimeText as their editor and working on C++ projects, I threw together a high level overview of the setup I am using:

If you have any addition to this, please let me know!

Justin

Marcus Ottosson

unread,
Apr 18, 2016, 7:15:59 AM4/18/16
to python_in...@googlegroups.com

I can also vouch for Clang on Windows. I also build from Sublime, with “variants” set up for cleaning, fully rebuilding and build & run. For debugging, I run devenv on the resulting binary and step through code in Visual Studio, inspired by the handmadehero series.

Here’s one of my build scripts.

@echo off

:: Set working directory
pushd %1

:: Prepare build directory
mkdir ..\build
pushd ..\build

:: Compile
cl^
  -Zi^
  -MTd^
  -EHsc^
  -I "..\include"^
  -I "%CINDER%\include"^
  ..\src\main.cpp^
  cinder-v120_d.lib^
  user32.lib^
  gdi32.lib^
  comdlg32.lib^
  advapi32.lib^
  shell32.lib^
  ole32.lib^
  oleaut32.lib^
  -link^
    /LIBPATH:"%CINDER%\lib\msw\x86"^
    /NODEFAULTLIB:LIBCMT

popd
popd

And here’s how I use it in Sublime.

{
    "build_systems":
    [
        {
            "cmd":
            [
                "build.bat",
                "$file_path"
            ],
            "name": "Cinder for Windows",
            "syntax": "Packages/ANSIescape/ANSI.tmLanguage",
            "target": "ansi_color_build",
            "variants":
            [
                {
                    "cmd":
                    [
                        "build.bat",
                        "$file_path",
                        "&&",
                        "$file_path/../build/main.exe"
                    ],
                    "name": "Build & Run"
                },
                {
                    "cmd":
                    [
                        "rmdir",
                        "/S",
                        "/Q",
                        "build",
                        "&&",
                        "build.bat",
                        "$file_path"
                    ],
                    "name": "Full Rebuild"
                }
            ],
            "working_dir": "$file_path/../../windows"
        }
    ]
}

The ANSIescape package is optional, but makes for console-like output in the Sublime output.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2mo7k_NpcjvOgWLUXyzw%3DZTzt9e7O5LiYKvYHkWVjmYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Fredrik Averpil

unread,
Apr 18, 2016, 9:07:38 AM4/18/16
to python_in...@googlegroups.com
Very cool stuff, thanks for sharing!

fruity

unread,
Apr 18, 2016, 4:01:44 PM4/18/16
to Python Programming for Autodesk Maya
Indeed, thanks for sharing =]
Lots of interesting stuff !
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
--
Marcus Ottosson
konstr...@gmail.com

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

Justin Israel

unread,
Apr 18, 2016, 5:44:41 PM4/18/16
to Python Programming for Autodesk Maya
@marcus, thanks for reminding me about the build system again. I forgot I had a project at work that was using a build system, so I added my own information to the blog post. And thanks for sharing your own setup!

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.



--
Marcus Ottosson
konstr...@gmail.com

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ce957d18-24b3-4f59-ae7c-4c50fc5b86d5%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages