blob: 263fce32b8a1023bb553e9d85e275d501682b024 (
plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a5870f8..1553513 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,9 @@ cmake_minimum_required(VERSION 3.11)
include(FetchContent)
project(EASTL CXX)
+include(GNUInstallDirs)
+include(CMakePackageConfigHelpers)
+
#-------------------------------------------------------------------------------------------
# Options
#-------------------------------------------------------------------------------------------
@@ -17,6 +20,8 @@ option(EASTL_DISABLE_APRIL_2024_DEPRECATIONS "Enable use of API marked for remov
option(EASTL_DISABLE_SEPT_2024_DEPRECATIONS "Enable use of API marked for removal in September 2024." OFF)
option(EASTL_DISABLE_APRIL_2025_DEPRECATIONS "Enable use of API marked for removal in April 2025." OFF)
+find_package(EABase CONFIG REQUIRED)
+
#-------------------------------------------------------------------------------------------
# Compiler Flags
#-------------------------------------------------------------------------------------------
@@ -65,21 +70,49 @@ endif()
#-------------------------------------------------------------------------------------------
# Include dirs
#-------------------------------------------------------------------------------------------
-target_include_directories(EASTL PUBLIC include)
+target_include_directories(EASTL PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+ )
#-------------------------------------------------------------------------------------------
# Dependencies
#-------------------------------------------------------------------------------------------
-FetchContent_Declare(
- EABase
- GIT_REPOSITORY https://github.com/electronicarts/EABase.git
- GIT_TAG 123363eb82e132c0181ac53e43226d8ee76dea12
- GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EABase.
+
+target_link_libraries(EASTL PUBLIC EABase)
+
+# create and install an export set for eabase target as EABase::EABase
+set(EASTL_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/EASTL")
+
+configure_package_config_file(
+ EASTLConfig.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/EASTLConfig.cmake
+ INSTALL_DESTINATION ${EASTL_CMAKE_CONFIG_DESTINATION}
)
-FetchContent_MakeAvailable(EABase)
+# create and install an export set for Terra target as Terra
+install(
+ TARGETS EASTL EXPORT EASTLTargets
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)
+
+install(EXPORT EASTLTargets DESTINATION ${EASTL_CMAKE_CONFIG_DESTINATION})
+
+write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/EASTLConfigVersion.cmake"
+ VERSION 3.16.05
+ COMPATIBILITY SameMajorVersion
+)
+
+install(TARGETS EASTL LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+install(DIRECTORY "include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
-target_link_libraries(EASTL EABase)
+install(
+ FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/EASTLConfig.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/EASTLConfigVersion.cmake"
+ DESTINATION ${EASTL_CMAKE_CONFIG_DESTINATION}
+)
#-------------------------------------------------------------------------------------------
# Deprecations
|