[CMake] how to place all executables in /build/bin directory
Michael Hertling
mhertling at online.de
Tue Mar 22 18:53:15 EDT 2011
On 03/22/2011 11:33 PM, Jean-Christophe Fillion-Robin wrote:
> Hi Arvind,
>
> As documented here<http://www.cmake.org/cmake/help/cmake2.6docs.html#variable:CMAKE_RUNTIME_OUTPUT_DIRECTORY>,
> set the variable CMAKE_RUNTIME_OUTPUT_DIRECTORY instead.
>
> Usually I set this one just after I invoke PROJECT() command.
In fact, these variables have the usual directory scope, so they don't
affect directories entered by ADD_SUBDIRECTORY() before they've been
set. Hence, set CMAKE_RUNTIME_OUTPUT_DIRECTORY before calling the
ADD_SUBDIRECTORY(Exec) command.
Regards,
Michael
> Indeed, as specified
> here<http://www.cmake.org/cmake/help/cmake2.6docs.html#variable:EXECUTABLE_OUTPUT_PATH>,
> EXECUTABLE_OUTPUT_PATH has been deprecated since cmake 2.6.
>
> Jc
>
> On Tue, Mar 22, 2011 at 6:12 PM, Arvind Rao <arvind.sbia at gmail.com> wrote:
>
>> Hi All,
>>
>> I have what should be a simple issue. I have successfully built a project
>> using CMAKE(out of source build). The executables are all placed in the
>> Project/build/Exec. But I want them placed in Project/build/bin/ instead.
>> Toward this end, I set the EXECUTABLE_OUTPUT_PATH, in the top-level
>> CMakeList file, like so:
>>
>> cmake_minimum_required(VERSION 2.6)
>> project(EXAMPLE)
>>
>> set(CMAKE_CXX_FLAGS "-Wall")
>> add_subdirectory(Exec)
>>
>> set( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin )
>>
>> The result is that the executables are all placed in /Project/build/Exec,
>> whether Project/build/bin exists or not. Does anyone have ideas?
>>
>> Best wishes,
>> Arvind
More information about the CMake
mailing list