diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c8d413c..42add9aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -310,7 +310,11 @@ endif() if(MINGW) find_package(directxmath CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectXMath) + find_package(directx-headers CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectX-Headers) + target_compile_definitions(${PROJECT_NAME} PUBLIC USING_DIRECTX_HEADERS) else() find_package(directxmath CONFIG QUIET) find_package(directx-headers CONFIG QUIET) @@ -318,13 +322,13 @@ endif() if(directxmath_FOUND) message(STATUS "Using DirectXMath package") - target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectXMath) + target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectXMath) endif() if(directx-headers_FOUND) message(STATUS "Using DirectX-Headers package") - target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectX-Headers) - target_compile_definitions(${PROJECT_NAME} PUBLIC USING_DIRECTX_HEADERS) + target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectX-Headers) + target_compile_definitions(${PROJECT_NAME} PRIVATE USING_DIRECTX_HEADERS) endif() if(BUILD_XAUDIO_REDIST