使用 Ubuntu LTS 14.04。
尝试按照本教程 TheChernoProject How to Setup C++ on Linux 设置 codelite 以在 C++ 中进行开发

CMakeLists.txt:

cmake_minimum_required (VERSION 3.5)

project (HelloWorld)

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++14")
set (source_dir "${PROJECT_SOURCE_DIR}/src/")

file (GLOB source_files "${source_dir}/*.cpp")

add_executable (HelloWorld ${source_files})

构建.sh:
#!/bin/sh

cmake -G "CodeLite - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug

编辑:
在查阅文档 https://github.com/eranif/codelite 后,我将 build.sh 修改为:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug

它奏效了。并给出了输出:
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done

但是没有生成 HelloWorld 工作区

最佳答案

我完全使用 CodeLite 从头开始​​创建了一个新项目,它为我生成了 CMake 文件。一切都完美无缺。

关于c++ - CMake 错误 : Could not create named generator CodeLite - Unix Makefiles,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46913561/

10-11 21:51