diff --git a/CMakeLists.txt b/CMakeLists.txt index 270187d..013f5c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,9 +3,17 @@ PROJECT (libevp C CXX) ENABLE_TESTING() -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}") -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}") -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}") +IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + SET(OUTPUT_DIR "bin/linux/${CMAKE_CXX_COMPILER_ID}/${CMAKE_BUILD_TYPE}") + STRING(TOLOWER ${OUTPUT_DIR} OUTPUT_DIR_LOWER) +ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + SET(OUTPUT_DIR "bin/windows/${CMAKE_CXX_COMPILER_ID}/${CMAKE_BUILD_TYPE}") + STRING(TOLOWER ${OUTPUT_DIR} OUTPUT_DIR_LOWER) +ENDIF() + +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/${OUTPUT_DIR_LOWER}") +SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/${OUTPUT_DIR_LOWER}") +SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/${OUTPUT_DIR_LOWER}") ADD_SUBDIRECTORY("src") ADD_SUBDIRECTORY("test")