Skip to content

Commit

Permalink
Merge pull request #57 from Demonese/master
Browse files Browse the repository at this point in the history
improved cmake: more modern target-based style
  • Loading branch information
adam-sawicki-a authored Aug 24, 2023
2 parents a89a347 + 9207a3e commit 3b949bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 8 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down

0 comments on commit 3b949bf

Please sign in to comment.