Skip to content

Commit d8cbc2a

Browse files
authored
Merge pull request #2852 from compnerd/build-artifacts
build: collect the build artifacts in a central location
2 parents 20ee0e1 + 71e0945 commit d8cbc2a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ if(CMAKE_VERSION VERSION_LESS 3.16.0)
2727
set(CMAKE_LINK_LIBRARY_FLAG "-l")
2828
endif()
2929

30+
if(CMAKE_VERSION VERSION_LESS 3.16 AND CMAKE_SYSTEM_NAME STREQUAL Windows)
31+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
32+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
33+
else()
34+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
35+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
36+
endif()
37+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
38+
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
39+
3040
option(BUILD_SHARED_LIBS "build shared libraries" ON)
3141
option(NS_CURL_ASSUME_FEATURES_MISSING "Assume that optional libcurl features are missing rather than test the library's version, for build debugging" NO)
3242

0 commit comments

Comments
 (0)