Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23747 from fuzzard/cmake_win_detours
[cmake] Add FindDetours for windows
- Loading branch information
Showing
3 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#.rst: | ||
# FindDetours | ||
# -------- | ||
# Finds the Detours library | ||
# | ||
# This will define the following target: | ||
# | ||
# windows::Detours - The Detours library | ||
|
||
if(NOT TARGET windows::Detours) | ||
find_path(DETOURS_INCLUDE_DIR NAMES detours.h | ||
NO_CACHE) | ||
|
||
find_library(DETOURS_LIBRARY_RELEASE NAMES detours | ||
NO_CACHE) | ||
find_library(DETOURS_LIBRARY_DEBUG NAMES detoursd | ||
NO_CACHE) | ||
|
||
include(SelectLibraryConfigurations) | ||
select_library_configurations(DETOURS) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Detours | ||
REQUIRED_VARS DETOURS_LIBRARY DETOURS_INCLUDE_DIR) | ||
|
||
if(DETOURS_FOUND) | ||
add_library(windows::Detours UNKNOWN IMPORTED) | ||
set_target_properties(windows::Detours PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${DETOURS_INCLUDE_DIR}" | ||
IMPORTED_LOCATION "${DETOURS_LIBRARY_RELEASE}") | ||
if(DETOURS_LIBRARY_DEBUG) | ||
set_target_properties(windows::Detours PROPERTIES | ||
IMPORTED_LOCATION_DEBUG "${DETOURS_LIBRARY_DEBUG}") | ||
endif() | ||
set_property(GLOBAL APPEND PROPERTY INTERNAL_DEPS_PROP windows::Detours) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
set(PLATFORM_REQUIRED_DEPS D3DX11Effects) | ||
set(PLATFORM_REQUIRED_DEPS D3DX11Effects Detours) | ||
set(APP_RENDER_SYSTEM dx11) | ||
list(APPEND PLATFORM_DEFINES -DNTDDI_VERSION=NTDDI_WINBLUE -D_WIN32_WINNT=_WIN32_WINNT_WINBLUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters