vcpkg/ports/eastl/fix_cmake_install.patch
Oliver John Hitchcock ed863b163c
[EAThread][EASTL] Added EAThread and modified EASTL (#8861)
* [EAThread][EASTL] Added EAThread and modified EASTL

EABase has now also been seperated from EASTL.
EASTL now copies CommonCppFlags.cmake as it is used by EAThread.

* Fix EABase

* Fix EABASE include for EASTL

* Improve EASTL

Still need to fix
The /debug/lib/cmake folder should be merged with /lib/cmake into /share/eastl
Found 3 error(s). Please correct the portfile:
    E:\vcpkg\ports\eastl\portfile.cmake
-- Performing post-build validation done
Error: Building package eastl:x64-windows-static failed with: POST_BUILD_CHECKS_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: eastl:x64-windows-static
  Vcpkg version: 2019.09.12-nohash

* Base pass one Thread

* Fix config errors and add `vcpkg_fixup_cmake_targets`

* Add required changes for fails

* x86-windows should also fail

* Revert adding `vcpkg_fail_port_install(ON_TARGET "Windows" ...)`

* Remove `eastl:arm64-windows=fail` from ci.baseline.txt

* Merge CONTROL descriptions into one line
2020-02-04 14:10:03 -08:00

72 lines
2.7 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b8171cd..44120cc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,12 +4,17 @@
cmake_minimum_required(VERSION 3.1)
project(EASTL CXX)
+include(GNUInstallDirs)
+include(CMakePackageConfigHelpers)
+
#-------------------------------------------------------------------------------------------
# Options
#-------------------------------------------------------------------------------------------
option(EASTL_BUILD_BENCHMARK "Enable generation of build files for benchmark" OFF)
option(EASTL_BUILD_TESTS "Enable generation of build files for tests" OFF)
+find_package(EABase CONFIG REQUIRED)
+
#-------------------------------------------------------------------------------------------
# Compiler Flags
#-------------------------------------------------------------------------------------------
@@ -41,10 +46,46 @@ add_definitions(-DEASTL_OPENSOURCE=1)
#-------------------------------------------------------------------------------------------
# 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
#-------------------------------------------------------------------------------------------
-target_link_libraries(EASTL 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}
+)
+
+# 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.01
+ COMPATIBILITY SameMajorVersion
+)
+
+install(TARGETS EASTL LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+install(DIRECTORY "include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
+install(
+ FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/EASTLConfig.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/EASTLConfigVersion.cmake"
+ DESTINATION ${EASTL_CMAKE_CONFIG_DESTINATION}
+)