From 71e0945ee00a16775f50f295b997894c87f945f1 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 14 Aug 2020 17:40:56 +0000 Subject: [PATCH] build: collect the build artifacts in a central location This structures the build for Foundation similar to LLVM and most of the other libraries. Having a regular structure makes it easier to find the artifacts and makes it easier to automate builds. --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e1d0e5fcf..d8e19d9429 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,16 @@ if(CMAKE_VERSION VERSION_LESS 3.16.0) set(CMAKE_LINK_LIBRARY_FLAG "-l") endif() +if(CMAKE_VERSION VERSION_LESS 3.16 AND CMAKE_SYSTEM_NAME STREQUAL Windows) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +else() + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +endif() +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) +set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift) + option(BUILD_SHARED_LIBS "build shared libraries" ON) option(NS_CURL_ASSUME_FEATURES_MISSING "Assume that optional libcurl features are missing rather than test the library's version, for build debugging" NO)