-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
35 lines (31 loc) · 1.34 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cmake_minimum_required (VERSION 3.8)
project ("smol-atlas")
add_executable (smol-atlas)
target_compile_definitions(smol-atlas PRIVATE _CRT_SECURE_NO_WARNINGS)
target_sources(smol-atlas PRIVATE
src/smol-atlas.cpp
src/smol-atlas.h
test/main.cpp
test/smol-atlas-test.cpp
external/stb_rect_pack.h
external/mapbox-shelf-pack-cpp/include/mapbox/shelf-pack.hpp
external/andrewwillmott_rectallocator/RectAllocator.cpp
external/andrewwillmott_rectallocator/RectAllocator.h
)
target_compile_features(smol-atlas PRIVATE cxx_std_17)
if (MSVC)
target_compile_options(smol-atlas PRIVATE "/Zc:__cplusplus") # make __cplusplus have correct value on MSVC
endif()
if (WIN32 AND CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64")
target_link_libraries(smol-atlas "${CMAKE_SOURCE_DIR}/external/etagere/etagere.dll.lib")
add_custom_command(TARGET smol-atlas POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/external/etagere/etagere.dll" $<TARGET_FILE_DIR:smol-atlas>)
target_compile_definitions(smol-atlas PRIVATE HAVE_ETAGERE=1)
elseif (APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
set_target_properties(smol-atlas PROPERTIES
BUILD_RPATH "@rpath"
INSTALL_RPATH "@rpath"
)
target_link_libraries(smol-atlas "${CMAKE_SOURCE_DIR}/external/etagere/libetagere.dylib")
target_compile_definitions(smol-atlas PRIVATE HAVE_ETAGERE=1)
endif()