Skip to content

Commit

Permalink
CMake: Enable DPI awareness options for demos
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartenBent committed Mar 27, 2020
1 parent 8202343 commit 3978733
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions build/cmake/demos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,28 @@ function(wx_add_demo name)
if(WIN32)
list(APPEND src_files ${wxSOURCE_DIR}/demos/${name}/${DEMO_NAME}.rc)
endif()

if (WXMSW AND DEFINED wxUSE_DPI_AWARE_MANIFEST)
set(wxDPI_MANIFEST_PRFIX "wx")
if (wxARCH_SUFFIX)
set(wxDPI_MANIFEST_PRFIX "amd64")
endif()
set(wxUSE_DPI_AWARE_MANIFEST_VALUE 0)
if (${wxUSE_DPI_AWARE_MANIFEST} MATCHES "system")
set(wxUSE_DPI_AWARE_MANIFEST_VALUE 1)
list(APPEND src_files "${wxSOURCE_DIR}/include/wx/msw/${wxDPI_MANIFEST_PRFIX}_dpi_aware.manifest")
elseif(${wxUSE_DPI_AWARE_MANIFEST} MATCHES "per-monitor")
set(wxUSE_DPI_AWARE_MANIFEST_VALUE 2)
list(APPEND src_files "${wxSOURCE_DIR}/include/wx/msw/${wxDPI_MANIFEST_PRFIX}_dpi_aware_pmv2.manifest")
endif()
endif()

add_executable(${DEMO_NAME} WIN32 MACOSX_BUNDLE ${src_files})

if (DEFINED wxUSE_DPI_AWARE_MANIFEST_VALUE)
target_compile_definitions(${DEMO_NAME} PRIVATE wxUSE_DPI_AWARE_MANIFEST=${wxUSE_DPI_AWARE_MANIFEST_VALUE})
endif()

if(DEMO_DATA)
# TODO: unify with data handling for samples
# TODO: handle data files differently for OS X bundles
Expand Down

0 comments on commit 3978733

Please sign in to comment.