cmake_minimum_required (VERSION 3.16)

set(LIBRARY_DEBUG_DIR_NAME lib)
set(LIBRARY_RELEASE_DIR_NAME lib-release)
set(RUNTIME_DEBUG_DIR_NAME bin)
set(RUNTIME_RELEASE_DIR_NAME bin-release)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/${LIBRARY_DEBUG_DIR_NAME})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/${LIBRARY_RELEASE_DIR_NAME})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_SOURCE_DIR}/${LIBRARY_RELEASE_DIR_NAME})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_SOURCE_DIR}/${LIBRARY_RELEASE_DIR_NAME})

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
