blob: 483494a4c07844d6f9611d1856305a6fc70374c8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
file(GLOB cpp_files CONFIGURE_DEPENDS "*.cpp")
file(GLOB header_files CONFIGURE_DEPENDS "*.h" "*.hpp")
file(GLOB rc_files CONFIGURE_DEPENDS "*.rc")
add_executable(privilege_check WIN32 ${cpp_files} ${header_files} ${rc_files})
if(MSVC)
target_compile_definitions(privilege_check PRIVATE _UNICODE UNICODE)
endif()
# MinGW-w64 is assumed when MINGW is triggered.
# Not sure if that matters a great deal.
if(MINGW)
target_compile_options(privilege_check PRIVATE -municode)
target_link_libraries(privilege_check PRIVATE -municode)
endif()
# NTDDI_VERSION & _WIN32_WINNT have to be defined in order to use the UAC
# features (available on Vista and later):
# https://msdn.microsoft.com/en-us/library/aa383745.aspx
if(MINGW)
target_compile_definitions(privilege_check PRIVATE
NTDDI_VERSION=NTDDI_VISTA
_WIN32_WINNT=_WIN32_WINNT_VISTA)
endif()
install(TARGETS privilege_check RUNTIME DESTINATION bin)
if(MSVC)
install(FILES $<TARGET_PDB_FILE:privilege_check> DESTINATION bin OPTIONAL)
endif()
|