2021-02-27 07:17:26 +00:00
|
|
|
# Copyright (c) Microsoft Corporation.
|
2020-12-19 21:18:06 +00:00
|
|
|
# Licensed under the MIT License.
|
|
|
|
|
|
|
|
cmake_minimum_required (VERSION 3.11)
|
|
|
|
|
2022-01-18 08:19:52 +00:00
|
|
|
set(DIRECTXMATH_VERSION 3.1.7)
|
2020-12-19 21:18:06 +00:00
|
|
|
|
|
|
|
project(DirectXMath
|
|
|
|
VERSION ${DIRECTXMATH_VERSION}
|
|
|
|
DESCRIPTION "DirectXMath SIMD C++ math library"
|
|
|
|
HOMEPAGE_URL "https://go.microsoft.com/fwlink/?LinkID=615560"
|
|
|
|
LANGUAGES CXX)
|
|
|
|
|
|
|
|
#--- Library
|
|
|
|
set(LIBRARY_HEADERS
|
|
|
|
Inc/DirectXCollision.h
|
|
|
|
Inc/DirectXCollision.inl
|
|
|
|
Inc/DirectXColors.h
|
|
|
|
Inc/DirectXMath.h
|
|
|
|
Inc/DirectXMathConvert.inl
|
|
|
|
Inc/DirectXMathMatrix.inl
|
|
|
|
Inc/DirectXMathMisc.inl
|
|
|
|
Inc/DirectXMathVector.inl
|
|
|
|
Inc/DirectXPackedVector.h
|
|
|
|
Inc/DirectXPackedVector.inl)
|
|
|
|
|
|
|
|
add_library(${PROJECT_NAME} INTERFACE)
|
|
|
|
|
|
|
|
target_include_directories(${PROJECT_NAME} INTERFACE
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Inc>
|
2020-12-29 07:01:04 +00:00
|
|
|
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>)
|
2020-12-19 21:18:06 +00:00
|
|
|
|
|
|
|
#--- Package
|
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
|
2020-12-29 07:01:04 +00:00
|
|
|
string(TOLOWER ${PROJECT_NAME} PACKAGE_NAME)
|
|
|
|
|
2020-12-19 21:18:06 +00:00
|
|
|
write_basic_package_version_file(
|
2020-12-29 07:01:04 +00:00
|
|
|
${PROJECT_BINARY_DIR}/cmake/${PACKAGE_NAME}-config-version.cmake
|
2020-12-19 21:18:06 +00:00
|
|
|
VERSION ${DIRECTXMATH_VERSION}
|
|
|
|
COMPATIBILITY AnyNewerVersion)
|
|
|
|
|
|
|
|
install(TARGETS ${PROJECT_NAME}
|
|
|
|
EXPORT ${PROJECT_NAME}-targets
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
RUNTIME DESTINATION bin)
|
|
|
|
|
|
|
|
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/.nuget/${PROJECT_NAME}-config.cmake.in
|
2020-12-29 07:01:04 +00:00
|
|
|
${PROJECT_BINARY_DIR}/cmake/${PACKAGE_NAME}-config.cmake
|
2020-12-19 21:18:06 +00:00
|
|
|
INSTALL_DESTINATION cmake/})
|
|
|
|
|
|
|
|
install(EXPORT ${PROJECT_NAME}-targets
|
|
|
|
FILE ${PROJECT_NAME}-targets.cmake
|
|
|
|
NAMESPACE Microsoft::
|
|
|
|
DESTINATION cmake/)
|
|
|
|
|
|
|
|
install(FILES ${LIBRARY_HEADERS}
|
2020-12-29 07:01:04 +00:00
|
|
|
DESTINATION include/${PROJECT_NAME})
|
2020-12-19 21:18:06 +00:00
|
|
|
|
|
|
|
install(
|
|
|
|
FILES
|
2020-12-29 07:01:04 +00:00
|
|
|
${PROJECT_BINARY_DIR}/cmake/${PACKAGE_NAME}-config.cmake
|
|
|
|
${PROJECT_BINARY_DIR}/cmake/${PACKAGE_NAME}-config-version.cmake
|
2020-12-19 21:18:06 +00:00
|
|
|
DESTINATION cmake/)
|