How to call cmake from within sublime text?

I use:

  • sublime text 3
  • CMake
  • do on Mac and mingw-make on windows

So far I can compile and run the hi world using cmake and make. I would like to be able to compile, link and run from sublime text. By default, I did not find a build system that allows me to do this.

In addition, I understand that sublime text is just an editor, but it also gives an idea of ​​the build system where you can plug in your own.

If I run:

cmake .. -G "Sublime Text 2 - MinGW Makefiles"

It generates a great project text file. When I open this project file in an elevated form, it populates the build system with options from the created make file (using cmake). It creates an executable file, but none of the build options allows me to run it.

- , ?

, , .

:

      • linkedlist.h
      • linkedlist.cpp
    • CMakeLists.txt
    • main.cpp

CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.9)
project(dataStructures)

#Bring the headers, into the project
include_directories(include)

#Can manually add the sources using the set command as follows:
set(MAINEXEC main.cpp)

#However, the file(GLOB...) allows for wildcard additions:
file(GLOB SOURCES "src/*.cpp")

add_executable(testDS ${SOURCES} ${MAINEXEC})
+4

Source: https://habr.com/ru/post/1607509/


All Articles