Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to not add Release or Debug to output path?

Tags:

cmake

Here is my current settings for output :

set( EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/bin")
set( LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/bin")
set( RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")

But for some reason I do not want (MSVS) put out files to bin/Release or Debug folders in my bin folder. Can I realize it using CMake somehow?

thank you

like image 226
cnd Avatar asked Jan 13 '12 09:01

cnd


People also ask

What does Copy to Output Directory do?

"Copy to Output Directory" is the property of the files within a Visual Studio project, which defines if the file will be copied to the project's built path as it is. Coping the file as it is allows us to use relative path to files within the project.

What is an output directory?

output directory. [ESRI software] In ArcIMS, the folder designated during installation to hold files being served to users for display in a browser.


1 Answers

A similar question was asked a few months ago, where I advised the use of target properties and also referred to another answer. For MSVC you can completely specify the locations of executables, libraries, archives, etc. on a per-configuration basis.

E.g. using something like:

if ( MSVC )
    set_target_properties( ${targetname} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${youroutputdirectory} )
    set_target_properties( ${targetname} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_DEBUG ${youroutputdirectory} )
    set_target_properties( ${targetname} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELEASE ${youroutputdirectory} )
    # etc for the other available configuration types (MinSizeRel, RelWithDebInfo)
endif ( MSVC )

which will put all your libraries in a single output-directory ${youroutputdirectory}, whether it is in Debug or Release config.

like image 56
André Avatar answered Nov 15 '22 10:11

André