Merge pull request #57 from Demonese/master

improved cmake: more modern target-based style
This commit is contained in:
Adam Sawicki 2023-08-24 14:22:01 +02:00 committed by GitHub
commit 3b949bfe92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -32,5 +32,4 @@ option(D3D12MA_BUILD_SAMPLE "Build D3D12MemoryAllocator sample application" OFF)
message(STATUS "D3D12MA_BUILD_SAMPLE = ${D3D12MA_BUILD_SAMPLE}")
include_directories(include)
add_subdirectory(src)

View File

@ -7,10 +7,6 @@ if(WIN32 AND ${CMAKE_GENERATOR} MATCHES "Visual Studio.*")
set(D3D12MA_LIBRARY_SOURCE_FILES ${D3D12MA_LIBRARY_SOURCE_FILES} D3D12MemAlloc.natvis)
endif()
set(CMAKE_DEBUG_POSTFIX d)
set(CMAKE_RELWITHDEBINFO_POSTFIX rd)
set(CMAKE_MINSIZEREL_POSTFIX s)
add_library(D3D12MemoryAllocator ${D3D12MA_LIBRARY_SOURCE_FILES})
set_target_properties(
@ -22,6 +18,14 @@ set_target_properties(
CXX_STANDARD_REQUIRED ON
OUTPUT_NAME "D3D12MA"
# Postfix for different profiles
DEBUG_POSTFIX "d"
RELWITHDEBINFO_POSTFIX "rd"
MINSIZEREL_POSTFIX "s"
)
target_include_directories(D3D12MemoryAllocator PUBLIC
"${PROJECT_SOURCE_DIR}/include"
)
target_link_libraries(D3D12MemoryAllocator PUBLIC