mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Improve CMake macro's
Allow setting custom runtime output directories using the 'end_sources' macro. If parameter is empty, it will use "game/" (default).
This commit is contained in:
parent
59d8f970da
commit
ede19e0472
@ -31,11 +31,14 @@ macro( add_sources )
|
||||
endmacro()
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# End the source file list
|
||||
# End the source file list ( optional parameter sets the runtime output dir )
|
||||
# -----------------------------------------------------------------------------
|
||||
macro( end_sources )
|
||||
get_property( SRCS_LIST GLOBAL PROPERTY SRCS_LIST )
|
||||
set_target_output_dirs( ${PROJECT_NAME} )
|
||||
if( NOT "${ARGN}" STREQUAL "" ) # Check if an output directory is passed
|
||||
set_target_output_dirs( ${PROJECT_NAME} ${ARGN} )
|
||||
else()
|
||||
set_target_output_dirs( ${PROJECT_NAME} "game/" )
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
@ -67,13 +67,13 @@ endmacro()
|
||||
# -----------------------------------------------------------------------------
|
||||
# Setup build output directories for target
|
||||
# -----------------------------------------------------------------------------
|
||||
macro( set_target_output_dirs TARGET )
|
||||
macro( set_target_output_dirs TARGET RUNTIME_DIR )
|
||||
# Set output directories
|
||||
set_target_properties( ${TARGET} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/game/"
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_SOURCE_DIR}/game/"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_SOURCE_DIR}/game/"
|
||||
RUNTIME_OUTPUT_DIRECTORY_PROFILE "${CMAKE_SOURCE_DIR}/game/"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/${RUNTIME_DIR}"
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_SOURCE_DIR}/${RUNTIME_DIR}"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_SOURCE_DIR}/${RUNTIME_DIR}"
|
||||
RUNTIME_OUTPUT_DIRECTORY_PROFILE "${CMAKE_SOURCE_DIR}/${RUNTIME_DIR}"
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib/${TARGET}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib/${TARGET}"
|
||||
)
|
||||
@ -81,7 +81,7 @@ macro( set_target_output_dirs TARGET )
|
||||
# Set output directories for each configuration
|
||||
foreach( CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES} )
|
||||
set_target_properties( ${TARGET} PROPERTIES
|
||||
"RUNTIME_OUTPUT_DIRECTORY_${CONFIG_TYPE}" "${CMAKE_SOURCE_DIR}/game/"
|
||||
"RUNTIME_OUTPUT_DIRECTORY_${CONFIG_TYPE}" "${CMAKE_SOURCE_DIR}/${RUNTIME_DIR}"
|
||||
"ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_TYPE}" "${CMAKE_SOURCE_DIR}/lib/${TARGET}/${CONFIG_TYPE}"
|
||||
"LIBRARY_OUTPUT_DIRECTORY_${CONFIG_TYPE}" "${CMAKE_SOURCE_DIR}/lib/${TARGET}/${CONFIG_TYPE}"
|
||||
"LINK_FLAGS_${CONFIG_TYPE}" "/PDB:${PDB_FULL_PATH}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user