CMake build system
This commit is contained in:
1 parent
4fed624cff
commit
4c6f3f81eb
40 files changed
+1641
No files matched your search
@@ -0,0 +1,27 @@
|
||||
include_guard(GLOBAL)
|
||||
|
||||
function(set_output_dirs TARGET)
|
||||
list(REMOVE_AT ARGV 0)
|
||||
cmake_parse_arguments(ARG "" "" "SUBDIRECTORY" ${ARGV})
|
||||
|
||||
if(CMAKE_CONFIGURATION_TYPES) # Multi-config
|
||||
set(CONFIGS ${CMAKE_CONFIGURATION_TYPES})
|
||||
else() # Single-config
|
||||
set(CONFIGS ${CMAKE_BUILD_TYPE})
|
||||
endif()
|
||||
|
||||
foreach(CONFIG ${CONFIGS})
|
||||
string(TOUPPER ${CONFIG} CONFIG_UPPER)
|
||||
|
||||
if(ARG_SUBDIRECTORY)
|
||||
set(OUT_DIR ${CMAKE_BINARY_DIR}/${CONFIG}/${ARG_SUBDIRECTORY})
|
||||
else()
|
||||
set(OUT_DIR ${CMAKE_BINARY_DIR}/${CONFIG})
|
||||
endif()
|
||||
|
||||
set_target_properties(${TARGET} PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY_${CONFIG_UPPER} ${OUT_DIR}
|
||||
RUNTIME_OUTPUT_DIRECTORY_${CONFIG_UPPER} ${OUT_DIR}
|
||||
ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_UPPER} ${OUT_DIR})
|
||||
endforeach()
|
||||
endfunction()
|
||||
Reference in new issue
Block a user