mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
CMake: Fix Qt resource files not included in build
- Move Qt resource initialization to rpcs3_qt target
This commit is contained in:
parent
566c88802e
commit
9a457400e7
3 changed files with 18 additions and 11 deletions
|
@ -1,7 +1,5 @@
|
|||
cmake_minimum_required(VERSION 3.8.2)
|
||||
|
||||
set(RES_FILES "")
|
||||
|
||||
include(cotire)
|
||||
|
||||
# Generate git-version.h at build time.
|
||||
|
@ -16,10 +14,6 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|||
add_definitions(-DNDEBUG)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(RES_FILES "rpcs3.rc")
|
||||
endif()
|
||||
|
||||
set(ADDITIONAL_LIBS "")
|
||||
if(CMAKE_SYSTEM MATCHES "Linux")
|
||||
#on some Linux distros shm_unlink and similar functions are in librt only
|
||||
|
@ -50,9 +44,9 @@ add_subdirectory(rpcs3qt)
|
|||
file(GLOB RPCS3_SRC "*.cpp")
|
||||
|
||||
if(WIN32)
|
||||
add_executable(rpcs3 WIN32 ${RPCS3_SRC} ${RES_FILES} resources.qrc windows.qrc)
|
||||
add_executable(rpcs3 WIN32 ${RPCS3_SRC})
|
||||
else()
|
||||
add_executable(rpcs3 ${RPCS3_SRC} ${RES_FILES} resources.qrc)
|
||||
add_executable(rpcs3 ${RPCS3_SRC})
|
||||
endif()
|
||||
|
||||
add_dependencies(rpcs3 GitVersion)
|
||||
|
@ -65,6 +59,11 @@ target_link_libraries(rpcs3 ${ADDITIONAL_LIBS})
|
|||
target_link_libraries(rpcs3 rpcs3_emu rpcs3_ui)
|
||||
target_link_libraries(rpcs3 3rdparty::discord-rpc 3rdparty::qt5 3rdparty::hidapi)
|
||||
|
||||
# Win resource file
|
||||
if (WIN32)
|
||||
target_sources(rpcs3 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/rpcs3.rc")
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
find_package(X11 REQUIRED)
|
||||
target_include_directories(rpcs3 PUBLIC ${X11_INCLUDE_DIR})
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
file(GLOB SRC_FILES "*.cpp")
|
||||
|
||||
file(GLOB UI_FILES "*.ui")
|
||||
|
||||
add_library(rpcs3_ui ${SRC_FILES} ${UI_FILES})
|
||||
set(RES_FILES "../resources.qrc")
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND RES_FILES "../windows.qrc")
|
||||
endif()
|
||||
|
||||
add_library(rpcs3_ui ${SRC_FILES} ${UI_FILES} ${RES_FILES})
|
||||
|
||||
set_target_properties(rpcs3_ui
|
||||
PROPERTIES
|
||||
AUTOMOC ON
|
||||
AUTOUIC ON)
|
||||
AUTOUIC ON
|
||||
AUTORCC ON)
|
||||
|
||||
target_link_libraries(rpcs3_ui
|
||||
PUBLIC
|
||||
|
|
|
@ -74,6 +74,8 @@ main_window::~main_window()
|
|||
*/
|
||||
void main_window::Init()
|
||||
{
|
||||
Q_INIT_RESOURCE(resources);
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
setAcceptDrops(true);
|
||||
|
|
Loading…
Add table
Reference in a new issue