Skip to content

Commit

Permalink
[qt] Setup resource file and icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Feb 9, 2020
1 parent c06d4ee commit 82833cb
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 2.8)
project(NanoboyAdvance CXX)

set(VERSION_MAJOR 0)
set(VERSION_MINOR 1)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
Expand Down
22 changes: 18 additions & 4 deletions source/platform/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
SET(SOURCES
set(SOURCES
main.cpp
mainwindow.cpp
screen.cpp
)

SET(HEADERS
set(HEADERS
mainwindow.hpp
screen.hpp
)
Expand All @@ -18,5 +18,19 @@ find_package(Qt5Widgets REQUIRED)
find_package(Qt5OpenGL REQUIRED)
set(QT_DEPS Qt5::Gui Qt5::Widgets Qt5::OpenGL)

ADD_EXECUTABLE(NanoboyAdvance ${SOURCES} ${HEADERS})
TARGET_LINK_LIBRARIES(NanoboyAdvance gba ${QT_DEPS} ${OPENGL_gl_LIBRARY})
if (WIN32)
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/res/app.rc.in"
"${CMAKE_CURRENT_BINARY_DIR}/res/app.rc"
)
list(APPEND RESOURCES "${CMAKE_CURRENT_BINARY_DIR}/res/app.rc")
if (MINGW)
set(CMAKE_RC_COMPILER_INIT windres)
enable_language(RC)
set(CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> -i <SOURCE> -o <OBJECT>")
endif()
endif()

add_executable(NanoboyAdvance ${SOURCES} ${HEADERS} ${RESOURCES})
target_link_libraries(NanoboyAdvance gba ${QT_DEPS} ${OPENGL_gl_LIBRARY})
Binary file added source/platform/qt/res/app.ico
Binary file not shown.
28 changes: 28 additions & 0 deletions source/platform/qt/res/app.rc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
IDI_ICON1 ICON DISCARDABLE "${CMAKE_CURRENT_SOURCE_DIR}/res/app.ico"

#include <windows.h>

VS_VERSION_INFO VERSIONINFO
FILEVERSION ${VERSION_MAJOR},${VERSION_MINOR}
PRODUCTVERSION ${VERSION_MAJOR},${VERSION_MINOR}
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "fleroviux"
VALUE "FileDescription", "NanoboyAdvance GameBoy Advance emulator"
VALUE "FileVersion", "${VERSION_MAJOR}.${VERSION_MINOR}"
VALUE "InternalName", "${BINARY_NAME}"
VALUE "LegalCopyright", "(c) 2020 Frederic Meyer"
VALUE "OriginalFilename", "${BINARY_NAME}"
VALUE "ProductName", "${PROJECT_NAME}"
VALUE "ProductVersion", "${BINARY_NAME}"
END
END

BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END

0 comments on commit 82833cb

Please sign in to comment.