Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the executable name in CMake?

Tags:

I tried using set(EXECUTABLE_OUTPUT_PATH "..."), but that only specifies the directory where the executable is created. I also need to change the name of the executable itself. How can I do this?

like image 206
becko Avatar asked Jun 24 '14 20:06

becko


People also ask

What does add executable to CMake?

add_executable is used to add all files used for this executable. If you add stuff that doesn't belong to this executable then that is a mistake as it will compile and link extra files into the executable. Now, you can put any kind of file in add_execuable and CMake will categorize these files.

Where is my CMake executable?

Running CMake for Windows / Microsoft Visual C++ (MSVC) Run cmake-gui.exe, which should be in your Start menu under Program Files, there may also be a shortcut on your desktop, or if you built from source, it will be in the build directory.

What is a CMake executable?

The cmake executable is the command-line interface of the cross-platform buildsystem generator CMake. The above Synopsis lists various actions the tool can perform as described in sections below. To build a software project with CMake, Generate a Project Buildsystem.


2 Answers

set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "your name") 

documentation

like image 121
ManuelSchneid3r Avatar answered Sep 22 '22 08:09

ManuelSchneid3r


Have you tried using SET_TARGET_PROPERTIES and using the OUTPUT_NAME property?

like image 43
Crazy Avatar answered Sep 22 '22 08:09

Crazy