Skip to content

Commit

Permalink
Fix case-sensitivity issues with CMake package
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Dec 29, 2020
1 parent 88e49b6 commit b8e0ea2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ add_library(${PROJECT_NAME} INTERFACE)

target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Inc>
$<INSTALL_INTERFACE:include>)
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>)

#--- Package
include(CMakePackageConfigHelpers)

string(TOLOWER ${PROJECT_NAME} PACKAGE_NAME)

write_basic_package_version_file(
${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}-config-version.cmake
${PROJECT_BINARY_DIR}/cmake/${PACKAGE_NAME}-config-version.cmake
VERSION ${DIRECTXMATH_VERSION}
COMPATIBILITY AnyNewerVersion)

Expand All @@ -45,7 +47,7 @@ install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin)

configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/.nuget/${PROJECT_NAME}-config.cmake.in
${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}-config.cmake
${PROJECT_BINARY_DIR}/cmake/${PACKAGE_NAME}-config.cmake
INSTALL_DESTINATION cmake/})

install(EXPORT ${PROJECT_NAME}-targets
Expand All @@ -54,10 +56,10 @@ install(EXPORT ${PROJECT_NAME}-targets
DESTINATION cmake/)

install(FILES ${LIBRARY_HEADERS}
DESTINATION include)
DESTINATION include/${PROJECT_NAME})

install(
FILES
${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}-config.cmake
${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}-config-version.cmake
${PROJECT_BINARY_DIR}/cmake/${PACKAGE_NAME}-config.cmake
${PROJECT_BINARY_DIR}/cmake/${PACKAGE_NAME}-config-version.cmake
DESTINATION cmake/)

1 comment on commit b8e0ea2

@walbourn
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installs to a project-specific include subfolder to avoid potential header conflict with Windows SDK.

Please sign in to comment.