4

我在用着:

  • 崇高的文字 3
  • 制作
  • 在 Mac 上制作和在 Windows 上制作 mingw-make

到目前为止,我能够使用 cmake 和 make 编译和运行 hello world。我希望能够从崇高的文本中编译、链接和运行。默认情况下,我没有找到允许我执行此操作的构建系统。

另外,我知道 sublime text 只是一个编辑器,但它也提供了构建系统的概念,人们可以在其中插入自己的插件。

如果我运行:

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

它生成崇高的文本项目文件。当我在 sublime 中打开这个项目文件时,它会使用生成的 make 文件中的选项(使用 cmake)填充构建系统。它构建可执行文件,但没有一个构建选项允许我运行它。

有人可以帮我理解如何让 sublime 运行项目可执行文件吗?

如果我需要在此处添加更多详细信息,请告诉我。

我的目录结构是这样的:

    • 包括
      • 链表.h
    • 源代码
      • 链表.cpp
    • CMakeLists.txt
    • 主文件

我的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

0 回答 0