1
0
mirror of https://github.com/microsoft/DirectXMath synced 2024-11-08 21:50:09 +00:00
DirectXMath/CMakeLists.txt

70 lines
2.0 KiB
CMake
Raw Normal View History

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.
2022-06-03 07:43:12 +00:00
cmake_minimum_required (VERSION 3.14)
2020-12-19 21:18:06 +00:00
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)
2022-05-02 10:40:03 +00:00
include(GNUInstallDirs)
2020-12-19 21:18:06 +00:00
#--- 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>
2022-06-03 07:43:12 +00:00
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/directxmath>)
2020-12-19 21:18:06 +00:00
2022-05-31 00:13:34 +00:00
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_11)
2020-12-19 21:18:06 +00:00
#--- Package
include(CMakePackageConfigHelpers)
string(TOLOWER ${PROJECT_NAME} PACKAGE_NAME)
2020-12-19 21:18:06 +00:00
write_basic_package_version_file(
2022-05-02 10:40:03 +00:00
${PACKAGE_NAME}-config-version.cmake
2020-12-19 21:18:06 +00:00
VERSION ${DIRECTXMATH_VERSION}
2022-06-03 07:43:12 +00:00
COMPATIBILITY AnyNewerVersion
ARCH_INDEPENDENT)
2020-12-19 21:18:06 +00:00
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
2022-05-02 10:40:03 +00:00
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
2020-12-19 21:18:06 +00:00
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/.nuget/${PROJECT_NAME}-config.cmake.in
2022-05-02 10:40:03 +00:00
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-config.cmake
2022-06-03 07:43:12 +00:00
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME})
2020-12-19 21:18:06 +00:00
install(EXPORT ${PROJECT_NAME}-targets
FILE ${PROJECT_NAME}-targets.cmake
NAMESPACE Microsoft::
2022-06-03 07:43:12 +00:00
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME})
2020-12-19 21:18:06 +00:00
install(FILES ${LIBRARY_HEADERS}
2022-06-03 07:43:12 +00:00
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/directxmath)
2020-12-19 21:18:06 +00:00
2022-05-02 10:40:03 +00:00
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake
2022-06-03 07:43:12 +00:00
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME})