How to change the name of the output binary to not be a.out with CMake?

前端 未结 2 1495

Where would I go within CMakeLists.txt in order to change the name of the generated file?

2条回答
  •  臣服心动
    2020-12-11 20:54

    Here's a simple CMakeLists.txt

    cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
    project(demo)
    
    add_executable(hello hello.cpp)
    

    This CMakeLists.txt compiles a hello.cpp file to an executable named hello. You can name the executable anything by using the add_executable statement.

    add_executable(   ...)
    

提交回复
热议问题