-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
47 lines (43 loc) · 1.75 KB
/
Copy pathCMakeLists.txt
File metadata and controls
47 lines (43 loc) · 1.75 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
42
43
44
45
46
47
cmake_minimum_required(VERSION 3.24)
project(homeworldz VERSION 0.1.0 LANGUAGES CXX)
if(NOT DEFINED HOMEWORLDZ_VERSION OR HOMEWORLDZ_VERSION STREQUAL "")
file(STRINGS "${CMAKE_SOURCE_DIR}/VERSION" HOMEWORLDZ_VERSION LIMIT_COUNT 1)
endif()
string(STRIP "${HOMEWORLDZ_VERSION}" HOMEWORLDZ_VERSION)
if(NOT HOMEWORLDZ_VERSION MATCHES "^[A-Za-z0-9._-]+$")
message(FATAL_ERROR "VERSION must contain a release-safe version string")
endif()
find_package(unofficial-sqlite3 CONFIG QUIET)
find_package(Jolt CONFIG QUIET)
find_package(unofficial-omniverse-physx-sdk CONFIG QUIET)
find_package(OpenJPEG CONFIG QUIET)
option(HOMEWORLDZ_REQUIRE_JOLT "Fail configuration when Jolt is unavailable" OFF)
set(HOMEWORLDZ_JOLT_AVAILABLE OFF)
set(HOMEWORLDZ_PHYSX_AVAILABLE OFF)
if(TARGET Jolt::Jolt)
set(HOMEWORLDZ_JOLT_AVAILABLE ON)
endif()
if(HOMEWORLDZ_REQUIRE_JOLT AND NOT HOMEWORLDZ_JOLT_AVAILABLE)
message(FATAL_ERROR "Jolt is required for a production Homeworldz region build")
endif()
if(TARGET unofficial::omniverse-physx-sdk::sdk)
set(HOMEWORLDZ_PHYSX_AVAILABLE ON)
endif()
add_library(homeworldz-sqlite INTERFACE)
if(TARGET unofficial::sqlite3::sqlite3)
target_link_libraries(homeworldz-sqlite INTERFACE unofficial::sqlite3::sqlite3)
else()
find_package(SQLite3 REQUIRED)
target_link_libraries(homeworldz-sqlite INTERFACE SQLite::SQLite3)
endif()
# JPEG2000 (OpenJPEG) for server-side appearance baking (ADR 0029).
set(HOMEWORLDZ_OPENJPEG_AVAILABLE OFF)
add_library(homeworldz-openjpeg INTERFACE)
if(TARGET openjp2)
set(HOMEWORLDZ_OPENJPEG_AVAILABLE ON)
target_link_libraries(homeworldz-openjpeg INTERFACE openjp2)
target_compile_definitions(homeworldz-openjpeg INTERFACE HOMEWORLDZ_OPENJPEG=1)
endif()
enable_testing()
add_subdirectory(script)
add_subdirectory(region)