Qt: Properly preprocess Windows RC file
Jeffrey Pfau jeffrey@endrift.com
Mon, 16 Mar 2015 00:35:09 -0700
4 files changed,
31 insertions(+),
29 deletions(-)
M
CMakeLists.txt
→
CMakeLists.txt
@@ -110,6 +110,7 @@ find_feature(USE_MAGICK "MagickWand")
# Platform support if(WIN32) + set(WIN32_VERSION "${LIB_VERSION_MAJOR},${LIB_VERSION_MINOR},${LIB_VERSION_PATCH}") add_definitions(-D_WIN32_WINNT=0x0600) list(APPEND OS_LIB ws2_32) file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/windows/*.c)
D
res/mgba.rc
@@ -1,28 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "mgba.ico" - -#include <windows.h> - -VS_VERSION_INFO VERSIONINFO -FILEVERSION 0,2,0,0 -PRODUCTVERSION 0,2,0,0 -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4" - BEGIN - VALUE "CompanyName", "endrift" - VALUE "FileDescription", "mGBA Game Boy Advance emulator" - VALUE "FileVersion", "0.2.0.0" - VALUE "InternalName", BINARY_NAME - VALUE "LegalCopyright", "(c) 2013 - 2015 Jeffrey Pfau" - VALUE "OriginalFilename", BINARY_NAME - VALUE "ProductName", PROJECT_NAME - VALUE "ProductVersion", PROJECT_VERSION - END - END - - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END
A
res/mgba.rc.in
@@ -0,0 +1,28 @@
+IDI_ICON1 ICON DISCARDABLE "${CMAKE_SOURCE_DIR}/res/mgba.ico" + +#include <windows.h> + +VS_VERSION_INFO VERSIONINFO +FILEVERSION ${WIN32_VERSION},0 +PRODUCTVERSION ${WIN32_VERSION},0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "endrift" + VALUE "FileDescription", "mGBA Game Boy Advance emulator" + VALUE "FileVersion", "${LIB_VERSION_STRING}.0" + VALUE "InternalName", "${BINARY_NAME}" + VALUE "LegalCopyright", "(c) 2013 - 2015 Jeffrey Pfau" + VALUE "OriginalFilename", "${BINARY_NAME}" + VALUE "ProductName", "${PROJECT_NAME}" + VALUE "ProductVersion", "${BINARY_NAME}" + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END
M
src/platform/qt/CMakeLists.txt
→
src/platform/qt/CMakeLists.txt
@@ -106,7 +106,8 @@ set_source_files_properties(${CMAKE_SOURCE_DIR}/res/mgba.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
qt5_add_resources(RESOURCES resources.qrc) if(WIN32) - list(APPEND RESOURCES ${CMAKE_SOURCE_DIR}/res/mgba.rc) + configure_file(${CMAKE_SOURCE_DIR}/res/mgba.rc.in ${CMAKE_BINARY_DIR}/res/mgba.rc) + list(APPEND RESOURCES ${CMAKE_BINARY_DIR}/res/mgba.rc) endif() add_executable(${BINARY_NAME}-qt WIN32 MACOSX_BUNDLE main.cpp ${CMAKE_SOURCE_DIR}/res/mgba.icns ${SOURCE_FILES} ${PLATFORM_SRC} ${UI_FILES} ${AUDIO_SRC} ${RESOURCES}) set_target_properties(${BINARY_NAME}-qt PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/res/info.plist.in COMPILE_DEFINITIONS "${FEATURE_DEFINES}")