Skip to content

Commit

Permalink
cmake: embed rc files
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Mar 14, 2017
1 parent 54fc5f8 commit aea2dbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 10,6 @@ INCLUDE(CheckTypeSize)

# set qt dirs first so we can find depends in qt install dir
include_directories(${QTDIR}/include) #TODO: remove. use external/include

get_filename_component(QTDIR "${QTDIR}" ABSOLUTE)

list(APPEND EXTRA_INCLUDE ${CMAKE_SOURCE_DIR}/external/include)
Expand Down Expand Up @@ -471,9 470,11 @@ SET(RESOURCES ${MODULE}.qrc shaders/shaders.qrc)
SOURCE_GROUP("Resources" FILES ${RESOURCES})
QT5_ADD_RESOURCES(RESOURCES_SOURCES ${RESOURCES})
set_source_files_properties(${RESOURCES_SOURCES} PROPERTIES GENERATED ON)

if(WIN32)
set(RC_FILE QtAV.rc)
endif()
# add HEADERS for moc
add_library(${MODULE} SHARED ${SOURCES} ${RESOURCES_SOURCES} ${HEADERS})
add_library(${MODULE} SHARED ${SOURCES} ${RESOURCES_SOURCES} ${HEADERS} ${RC_FILE})

list(REMOVE_DUPLICATES EXTRA_LIBS)
# qt5_use_modules(since 2.8.9) is deprecated since cmake 2.8.11
Expand Down
6 changes: 4 additions & 2 deletions widgets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 41,11 @@ if(Qt5Gui_VERSION VERSION_LESS 5.4.0)
endif()

set(HEADERS ${SDK_HEADERS})

if(WIN32)
set(RC_FILE QtAVWidgets.rc)
endif()
# add HEADERS for moc
add_library(${MODULE} SHARED ${SOURCES} ${RESOURCES_SOURCES} ${HEADERS})
add_library(${MODULE} SHARED ${SOURCES} ${RESOURCES_SOURCES} ${HEADERS} ${RC_FILE})
target_link_libraries(${MODULE}
LINK_PRIVATE ${EXTRA_LIBS}
LINK_PUBLIC QtAV Qt5::Widgets
Expand Down

0 comments on commit aea2dbc

Please sign in to comment.