CMake and Visual Studio resource files

前端 未结 2 629
暖寄归人
暖寄归人 2021-02-14 08:11

I am converting a C++ project created using Visual Studio 2005 to CMake and have stumbled upon a bit of a problem with resource files that are included in the project.

T

相关标签:
2条回答
  • 2021-02-14 08:59

    By default it shouldn't do anything with those files. The source file property LANGUAGE should be empty and thus the action for the file should be checked by the file type. Which shouldn't be anything since it's not something it should compile.

    Check your CMakeLists.txt that is doesn't contain a set_source_files_properties command that would mess with that property.

    If you want to do something with the files, here are two ways to do things:

    With add_custom_target you can add them and run custom commands for them when you build the project. Granted that the files have changed.

    With configure_file you can easily copy them to a build directory if needed. With the COPYONLY flag.

    0 讨论(0)
  • 2021-02-14 09:06

    Try to set_source_files_properties(your.ico your.rc2 PROPERTIES LANGUAGE RC).

    0 讨论(0)
提交回复
热议问题