-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
41 lines (31 loc) · 1.38 KB
/
CMakeLists.txt
File metadata and controls
41 lines (31 loc) · 1.38 KB
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
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.25)
include(FetchContent)
project(UBytesAppPlatform LANGUAGES CXX VERSION 1.3.0)
set(APP_NAME AppPlatform)
set(CMAKE_CXX_STANDARD 20)
file(GLOB_RECURSE PUBLIC_SOURCES "include/*.hpp")
add_library(${APP_NAME} INTERFACE ${PUBLIC_SOURCES})
add_library(${APP_NAME}_Internal INTERFACE ${PUBLIC_SOURCES})
target_include_directories(${APP_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(${APP_NAME}_Internal INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
# Link libraries only for the general target library.
target_link_directories(${APP_NAME} INTERFACE
$<$<CONFIG:Debug>:${CMAKE_CURRENT_SOURCE_DIR}/bin/Debug>
$<$<CONFIG:Release>:${CMAKE_CURRENT_SOURCE_DIR}/bin/Release>
)
target_link_libraries(${APP_NAME} INTERFACE UBytesAppPlatform)
set(HAS_BINARIES FALSE)
if(NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin/Release")
if (WIN32)
set(BINARIES_URL_OS_PREFIX "x64-windows")
else()
message(FATAL_ERROR "AppPlatform doesn't support platforms other than Windows yet.")
endif()
message(STATUS "AppPlatform binaries not found, downloading...")
FetchContent_Declare(
AppPlatformBinaries
URL https://github.com/UnstableBytes/AppPlatform/releases/download/v${CMAKE_PROJECT_VERSION}/${BINARIES_URL_OS_PREFIX}-binaries.zip
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bin
)
FetchContent_MakeAvailable(AppPlatformBinaries)
endif()