Good afternoon, I create my Qt project using the Cmake build system on a Windows platform, but if I add a line to the cmake file:
add_definitions ("- DUNICODE -D_UNICODE") UNICODE definition does not work (MINGW), this work only works correctly if I create my project using the MSVC compiler. After a few times, I found a workaround.
How to define a variable when calling CMake, so qtcreator knows that this is defined? , this solution works, but if I use my own WINAPI functions such as CreateFile, I get a compilation error because the compiler chose CreateFileA, but I use w_char and I would like to use CreateFileW, this is because the UNICODE macro definition appears earlier than I am including a confugure file. How to define a UNICODE macro in cmakefile
source share