Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lethean/03fb21f7a137be71f8958499cc8b729e to your computer and use it in GitHub Desktop.
Save lethean/03fb21f7a137be71f8958499cc8b729e to your computer and use it in GitHub Desktop.
fix libui build error in win32 due to resources.res
diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt
index 4695eb4..df7d838 100644
--- a/windows/CMakeLists.txt
+++ b/windows/CMakeLists.txt
@@ -65,14 +65,14 @@ set(_LIBUI_INCLUDEDIRS _LIBUI_INCLUDEDIRS PARENT_SCOPE)
# Windows won't link resources in static libraries; we need to provide the libui.res file in this case.
set(_LIBUINAME libui PARENT_SCOPE)
if(NOT BUILD_SHARED_LIBS)
- set(_LIBUI_STATIC_RES ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libui.res PARENT_SCOPE)
+ set(_LIBUI_STATIC_RES ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/$(Configuration)/libui.res PARENT_SCOPE)
endif()
macro(_handle_static)
# TODO this full path feels hacky
add_custom_command(
TARGET libui POST_BUILD
COMMAND
- ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:libui,BINARY_DIR>/CMakeFiles/libui.dir/windows/resources.rc.* ${_LIBUI_STATIC_RES}
+ ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:libui,BINARY_DIR>/libui.dir/$(Configuration)/resources.res ${_LIBUI_STATIC_RES}
COMMENT "Copying libui.res")
endmacro()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment