Hello,

I have noticed an annoying difference between Xcode and make as far as the 
output directory is concerned.

I have added the following to my CMakeLists.txt:
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

When I run the makefiles generated by CMake with CMAKE_BUILD_TYPE=Debug, I can 
find all of my executables and libraries in build_dir/bin.
However, if I generate an Xcode project with CMake and build my binaries, 
they'll end up partly in build_dir/bin and partly in build_dir/bin/Debug.

With Xcode, the binaries that end up in build_dir/bin/Debug are those generated 
by add_executable/library CMake rules. And the binaries that end up in 
build_dir/bin are those generated by my add_custom_command to which I told to 
put the binaries in ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}.

But if I tell my custom command to put the binaries in 
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}, then it'll be ok with 
Xcode but not make. So what should I do?
Is it an expected behavior?

Thanks,
Lucas
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to