I have a simple cmake project with two libraries (lib, util). The util library has a windows resource file, which is not included in the output file. Only when I add the .rc file to the lib library it's included in the output.
src
|- lib
|- util
src/CMakeLists.txt
:
cmake_minimum_required(VERSION 3.18)
project(MyLib LANGUAGES CXX RC)
add_subdirectory(lib)
add_subdirectory(util)
src/lib/CMakeLists.txt
:
add_library(MyLib MODULE
Main.cpp
# ../util/Resource.rc # This would work
)
target_link_libraries(MyLib PUBLIC
util
)
src/util/CMakeLists.txt
:
cmake_minimum_required(VERSION 3.13)
add_library(util STATIC
Resource.rc # This is not working
Resource.h
util.cpp util.h)
The content of the .h/.cpp files does not matter. I checked with ResEdit if the libMyLib.dll contains the resources defined in the .rc file.