Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specifying build directory within CMakeLists file

Tags:

cmake

Is it possible to specify build directory within CMakeLists file? If yes, how.

My aim is to be able to call "cmake" within top level source directory and have cmake figure out the build directory.

like image 816
Amani Avatar asked Dec 30 '13 06:12

Amani


1 Answers

Afaik, with CMake the build directory is always the directory from where you invoke the cmake or ccmake command. So if you want to change the build directory, you have to change directories before running CMake.

To control the location where executables, static and shared libraries are placed once finished, you can modifiy CMAKE_RUNTIME_OUTPUT_DIRECTORY, CMAKE_ARCHIVE_OUTPUT_DIRECTORY, and CMAKE_LIBRARY_OUTPUT_DIRECTORY respectively.

like image 110
Michael Schlottke-Lakemper Avatar answered Nov 15 '22 11:11

Michael Schlottke-Lakemper