From 1ce329e7dd26c69c9cad70dd8de1138cba6c9e97 Mon Sep 17 00:00:00 2001 From: Rui Abreu Ferreira Date: Sat, 9 Jan 2016 02:40:57 +0000 Subject: [PATCH] Fix build output paths for Visual Studio generator The Visual Studio cmake generator creates subdirectories inside the build path for different build configuration. But this breaks some of our cmake scripts, like the help tags installer, that assume the targets are built in that location. Updated CMakeLists.txt to remove extra paths. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ecc8689cf8..3c12486d4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -332,9 +332,16 @@ endif() set(CMAKE_THREAD_PREFER_PTHREAD ON) find_package(Threads REQUIRED) +# Place targets in bin/ or lib/ for all build configurations set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +foreach(CFGNAME ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER ${CFGNAME} CFGNAME) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/bin) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib) +endforeach() # Find Lua interpreter include(LuaHelpers)