DirectXMath/CMakeLists.txt

69 строки
2.0 KiB
CMake
Исходник Обычный вид История

2021-02-27 10:17:26 +03:00
# Copyright (c) Microsoft Corporation.
2020-12-20 00:18:06 +03:00
# Licensed under the MIT License.
cmake_minimum_required (VERSION 3.11)
2022-01-18 11:19:52 +03:00
set(DIRECTXMATH_VERSION 3.1.7)
2020-12-20 00:18:06 +03: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 13:40:03 +03:00
include(GNUInstallDirs)
2020-12-20 00:18:06 +03: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>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}>)
2020-12-20 00:18:06 +03:00
2022-05-31 03:13:34 +03:00
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_11)
2020-12-20 00:18:06 +03:00
#--- Package
include(CMakePackageConfigHelpers)
string(TOLOWER ${PROJECT_NAME} PACKAGE_NAME)
2020-12-20 00:18:06 +03:00
write_basic_package_version_file(
2022-05-02 13:40:03 +03:00
${PACKAGE_NAME}-config-version.cmake
2020-12-20 00:18:06 +03:00
VERSION ${DIRECTXMATH_VERSION}
COMPATIBILITY AnyNewerVersion)
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
2022-05-02 13:40:03 +03:00
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
2020-12-20 00:18:06 +03:00
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/.nuget/${PROJECT_NAME}-config.cmake.in
2022-05-02 13:40:03 +03:00
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}/cmake/})
2020-12-20 00:18:06 +03:00
install(EXPORT ${PROJECT_NAME}-targets
FILE ${PROJECT_NAME}-targets.cmake
NAMESPACE Microsoft::
2022-05-02 13:40:03 +03:00
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}/cmake/)
2020-12-20 00:18:06 +03:00
install(FILES ${LIBRARY_HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
2020-12-20 00:18:06 +03:00
2022-05-02 13:40:03 +03:00
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}-config-version.cmake
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PACKAGE_NAME}/cmake/)