Skip to content
This repository was archived by the owner on Dec 3, 2025. It is now read-only.

Commit 4cf4e2e

Browse files
committed
Add Win32xx find module
1 parent 06ea620 commit 4cf4e2e

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

cmake/Modules/FindWin32xx.cmake

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Author: Grinlex
2+
#
3+
# Imported targets:
4+
# ``Win32xx::Win32xx``
5+
#
6+
# Result variables:
7+
# ``Win32xx_FOUND``
8+
# ``Win32xx_INCLUDE_DIR``
9+
# ``Win32xx_DEFAULT_RC``
10+
#
11+
# Searches for such folder structure:
12+
# Win32xx/
13+
# └── include
14+
# ├── ...
15+
# ├── default_resource.rc
16+
# ├── wxx_appcore.h
17+
# └── ...
18+
19+
include(FindPackageHandleStandardArgs)
20+
21+
find_path(Win32xx_INCLUDE_DIR
22+
NAMES
23+
wxx_appcore.h
24+
PATH_SUFFIXES
25+
include
26+
Win32xx/include
27+
)
28+
29+
find_file(Win32xx_DEFAULT_RC
30+
NAMES
31+
default_resource.rc
32+
PATH_SUFFIXES
33+
include
34+
Win32xx/include
35+
)
36+
37+
if(Win32xx_INCLUDE_DIR AND NOT TARGET Win32xx::Win32xx)
38+
add_library(Win32xx::Win32xx INTERFACE IMPORTED)
39+
set_target_properties(Win32xx::Win32xx PROPERTIES
40+
INTERFACE_INCLUDE_DIRECTORIES "${Win32xx_INCLUDE_DIR}"
41+
)
42+
endif()
43+
44+
find_package_handle_standard_args(Win32xx DEFAULT_MSG
45+
Win32xx_INCLUDE_DIR
46+
)
47+
48+
if(Win32xx_FOUND)
49+
mark_as_advanced(Win32xx_INCLUDE_DIR)
50+
endif()

0 commit comments

Comments
 (0)