Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the taglib character set on Windows to use unicode?

TagLib uses the CMake build system to create the Visual Studio 2010 solution and project files.

The only problem with the generated projects is that the Character Set is set to MBCS, when I'd like it to be Unicode.

Is there a way to set this option via CMake?

I'm currently using this to build taglib on Windows on a VS2010 command prompt:

cmake -DWITH_MP4=ON -DENABLE_STATIC=ON .
like image 720
Carl Avatar asked Dec 12 '25 16:12

Carl


2 Answers

Alternatively to Andrey's answer you could specify the character set in a CMakeLists.txt file by

target_compile_definitions (TargetName PRIVATE -D_UNICODE -DUNICODE
                                                     <additional defines>)
like image 200
TobiMcNamobi Avatar answered Dec 15 '25 09:12

TobiMcNamobi


The following command should do the job:

cmake -DCMAKE_CXX_FLAGS=/D_UNICODE ..

cmake automatically turns on the Unicode character set in Visual Studio projects if _UNICODE macro is defined.

like image 36
Andrey Kamaev Avatar answered Dec 15 '25 11:12

Andrey Kamaev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!