MYNT-EYE-S-SDK/cmake/Common.cmake
2018-03-22 12:57:35 +08:00

27 lines
967 B
CMake
Executable File

include(CMakeParseArguments)
if(MSVC OR MSYS OR MINGW)
set(OS_WIN TRUE)
elseif(APPLE)
set(OS_MAC TRUE)
elseif(UNIX)
set(OS_LINUX TRUE)
else()
message(FATAL_ERROR "Unsupported OS.")
endif()
# set_outdir(ARCHIVE_OUTPUT_DIRECTORY
# LIBRARY_OUTPUT_DIRECTORY
# RUNTIME_OUTPUT_DIRECTORY)
macro(set_outdir ARCHIVE_OUTPUT_DIRECTORY LIBRARY_OUTPUT_DIRECTORY RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ARCHIVE_OUTPUT_DIRECTORY})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${RUNTIME_OUTPUT_DIRECTORY})
foreach(CONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${CONFIG} CONFIG)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONFIG} ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONFIG} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONFIG} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endforeach()
endmacro()