diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-13 00:47:44 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-13 00:47:44 +0200 |
| commit | 4d04d2ade8d7e24c6eb943da8ab1d8aee406753c (patch) | |
| tree | dcaf35005bfbabf0dfbf7415bd3e6c278f150540 | |
| parent | add scripts to setup git hooks (diff) | |
| download | privilege-check-4d04d2ade8d7e24c6eb943da8ab1d8aee406753c.tar.gz privilege-check-4d04d2ade8d7e24c6eb943da8ab1d8aee406753c.zip | |
cmake: move main binary code to src/
| -rw-r--r-- | CMakeLists.txt | 31 | ||||
| -rw-r--r-- | src/CMakeLists.txt | 30 |
2 files changed, 31 insertions, 30 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f8761f0..72a54a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,35 +12,6 @@ endif() add_compile_definitions(WIN32_LEAN_AND_MEAN NOMINMAX) -file(GLOB cpp_files CONFIGURE_DEPENDS "src/*.cpp") -file(GLOB header_files CONFIGURE_DEPENDS "src/*.h" "src/*.hpp") -file(GLOB rc_files CONFIGURE_DEPENDS "src/*.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() +add_subdirectory(src) install(FILES README.md LICENSE.txt DESTINATION share) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..483494a --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,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() |
