How not to add Release or Debug to output the path?

Here are 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) to pull files into bin / Release or Debug folders in bin folder. Can I implement this with CMake?

Thank you

+5
cmake
Jan 13 '12 at 9:20
source share
1 answer

A similar question was asked a few months ago, where I advised using target properties , and also refers to another answer . For MSVC, you can fully specify the location of executable files, libraries, archives, etc. For each configuration.

eg. 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}, regardless of whether it is in the Debug or Release configuration.

+9
Jan 15 '12 at 15:25
source share



All Articles