Skip to content

Commit

Permalink
Add UTF-8 resource manifest to app and samples
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilos committed Sep 27, 2024
1 parent f55ddfc commit f7cf18a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
set(APP_SOURCES
exiv2.cpp
exiv2app.hpp
actions.cpp
actions.hpp
getopt.cpp
getopt.hpp
app_utils.cpp
app_utils.hpp
)

add_executable(exiv2 ${APP_SOURCES})

# Make app use UTF-8 code page in Windows
if(WIN32)
if(MSVC)
target_sources(exiv2 PRIVATE utf8.manifest)
else()
# Must wrap manifest in .rc w/ other toolchains
target_sources(exiv2 PRIVATE utf8.rc)
endif()
endif()

target_include_directories(exiv2 PRIVATE ${PROJECT_SOURCE_DIR}/src) # To find i18n.hpp

set_target_properties(exiv2 PROPERTIES COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS} XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Debug] "YES")
Expand Down
8 changes: 8 additions & 0 deletions app/utf8.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<application>
<windowsSettings>
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
</windowsSettings>
</application>
</assembly>
3 changes: 3 additions & 0 deletions app/utf8.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <winuser.rh>

CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "utf8.manifest"
9 changes: 9 additions & 0 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ list(APPEND APPLICATIONS remotetest)

# ******************************************************************************
foreach(application ${APPLICATIONS})
# Make app use UTF-8 code page in Windows
if(WIN32)
if(MSVC)
target_sources(${application} PRIVATE ${PROJECT_SOURCE_DIR}/app/utf8.manifest)
else()
# Must wrap manifest in .rc w/ other toolchains
target_sources(${application} PRIVATE ${PROJECT_SOURCE_DIR}/app/utf8.rc)
endif()
endif()
target_link_libraries(${application} PRIVATE exiv2lib std::filesystem)
if(EXIV2_ENABLE_PNG)
target_link_libraries(${application} PRIVATE ${ZLIB_LIBRARIES})
Expand Down

0 comments on commit f7cf18a

Please sign in to comment.