Add resources to exe files

pull/218/head
Hleb Valoshka 2019-01-11 19:39:11 +00:00
parent 65acb21911
commit 1921672941
2 changed files with 11 additions and 2 deletions

View File

@ -53,7 +53,12 @@ set(CMAKE_AUTOUIC ON)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
qt5_add_resources(RC_SRC "icons.qrc")
add_executable(celestia-qt WIN32 ${QT_SOURCES} ${RC_SRC})
if (WIN32)
set (RES celestia.rc)
endif()
add_executable(celestia-qt WIN32 ${QT_SOURCES} ${RC_SRC} ${RES})
cotire(celestia-qt)
qt5_use_modules(celestia-qt ${QT_LIBS})
target_link_libraries(celestia-qt ${CELESTIA_LIBS})

View File

@ -38,7 +38,11 @@ set(WIN32_HEADERS
winviewoptsdlg.h
)
add_executable(celestia-win WIN32 ${WIN32_SOURCES})
add_library(resources OBJECT res/celestia.rc)
target_include_directories(resources PRIVATE "${CMAKE_SOURCE_DIR}/src/celestia/win32/res")
set(RESOURCES $<TARGET_OBJECTS:resources>)
add_executable(celestia-win WIN32 ${WIN32_SOURCES} ${RESOURCES})
cotire(celestia-win)
target_link_libraries(celestia-win ${CELESTIA_LIBS})
install(TARGETS celestia-win RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})