Merge pull request #509 from Zapeth/master

Fix cmake resource file compilation issues
This commit is contained in:
Arisotura 2019-09-01 20:24:14 +02:00 committed by GitHub
commit b3df6e523a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -14,6 +14,10 @@ SET(SOURCES_LIBUI
OSD.cpp OSD.cpp
) )
if (WIN32)
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> -o <OBJECT>")
endif()
option(BUILD_SHARED_LIBS "Whether to build libui as a shared library or a static library" ON) option(BUILD_SHARED_LIBS "Whether to build libui as a shared library or a static library" ON)
set(BUILD_SHARED_LIBS OFF) set(BUILD_SHARED_LIBS OFF)
add_subdirectory(libui) add_subdirectory(libui)
@ -39,11 +43,11 @@ if (UNIX)
ADD_DEFINITIONS(${GTK3_CFLAGS_OTHER}) ADD_DEFINITIONS(${GTK3_CFLAGS_OTHER})
add_custom_command(OUTPUT melon_grc.c add_custom_command(OUTPUT melon_grc.c
COMMAND glib-compile-resources --sourcedir="${CMAKE_SOURCE_DIR}" COMMAND glib-compile-resources --sourcedir=${CMAKE_SOURCE_DIR}
--target="${CMAKE_CURRENT_BINARY_DIR}/melon_grc.c" --target=${CMAKE_CURRENT_BINARY_DIR}/melon_grc.c
--generate-source "${CMAKE_SOURCE_DIR}/melon_grc.xml" --generate-source "${CMAKE_SOURCE_DIR}/melon_grc.xml"
COMMAND glib-compile-resources --sourcedir="${CMAKE_SOURCE_DIR}" COMMAND glib-compile-resources --sourcedir=${CMAKE_SOURCE_DIR}
--target="${CMAKE_CURRENT_BINARY_DIR}/melon_grc.h" --target=${CMAKE_CURRENT_BINARY_DIR}/melon_grc.h
--generate-header "${CMAKE_SOURCE_DIR}/melon_grc.xml") --generate-header "${CMAKE_SOURCE_DIR}/melon_grc.xml")
if (CMAKE_SYSTEM_NAME STREQUAL "Linux") if (CMAKE_SYSTEM_NAME STREQUAL "Linux")

View File

@ -73,7 +73,7 @@ macro(_handle_static)
add_custom_command( add_custom_command(
TARGET libui POST_BUILD TARGET libui POST_BUILD
COMMAND 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>/CMakeFiles/libui.dir/windows/resources.rc.obj ${_LIBUI_STATIC_RES}
COMMENT "Copying libui.res") COMMENT "Copying libui.res")
endmacro() endmacro()