Skip to content

Commit

Permalink
CMake targets fixes for optional vs. required packages (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn authored Jun 16, 2023
1 parent 70a4576 commit b720fc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,12 @@ if(BUILD_TOOLS AND WIN32)
Meshconvert/Mesh.h
Meshconvert/Mesh.cpp
Meshconvert/SDKMesh.h)
target_include_directories(meshconvert PUBLIC MeshConvert Utilities)
target_link_libraries(meshconvert ${PROJECT_NAME} version.lib)
target_include_directories(meshconvert PRIVATE MeshConvert Utilities)
target_link_libraries(meshconvert PRIVATE ${PROJECT_NAME} version.lib)
source_group(meshconvert REGULAR_EXPRESSION meshconvert/*.*)

if(directxmath_FOUND)
target_link_libraries(meshconvert Microsoft::DirectXMath)
target_link_libraries(meshconvert PRIVATE Microsoft::DirectXMath)
endif()
endif()

Expand Down
7 changes: 5 additions & 2 deletions build/DirectXMesh-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ endif()
include(CMakeFindDependencyMacro)

if(MINGW OR (NOT WIN32))
find_dependency(directx-headers CONFIG)
find_dependency(directxmath CONFIG)
find_dependency(directx-headers)
find_dependency(directxmath)
else()
find_package(directx-headers CONFIG QUIET)
find_package(directxmath CONFIG QUIET)
endif()

check_required_components("@PROJECT_NAME@")

0 comments on commit b720fc5

Please sign in to comment.