Skip to content

Commit

Permalink
allow QtAV to be used as a cmake external project
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Jul 25, 2017
1 parent 78f1814 commit 528769c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 1,7 @@
cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)

project(QTAV)

set(QTAV_MAJOR 1)
set(QTAV_MINOR 11)
set(QTAV_PATCH 0)
Expand Down
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 101,7 @@ if(Qt5Quick_FOUND)
set(MODULE QMLPlayer)
if(WIN32)
set(RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.rc)
configure_file(${CMAKE_SOURCE_DIR}/cmake/QtAV.rc.in ${RC_FILE})
configure_file(${QTAV_SOURCE_DIR}/cmake/QtAV.rc.in ${RC_FILE})
endif()
add_executable(QMLPlayer ${EXE_TYPE}
QMLPlayer/main.cpp
Expand All @@ -120,7 120,7 @@ if(Qt5Widgets_FOUND)
set(MODULE Player)
if(WIN32)
set(RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.rc)
configure_file(${CMAKE_SOURCE_DIR}/cmake/QtAV.rc.in ${RC_FILE})
configure_file(${QTAV_SOURCE_DIR}/cmake/QtAV.rc.in ${RC_FILE})
endif()
add_executable(Player ${EXE_TYPE} ${PLAYER_SRC} ${PLAYER_HEADERS} ${PLAYER_RES} ${RC_FILE})
target_link_libraries(Player QtAVWidgets common)
Expand Down
2 changes: 1 addition & 1 deletion qml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 32,7 @@ endif()
# add HEADERS for moc
if(WIN32)
set(RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.rc)
configure_file(${CMAKE_SOURCE_DIR}/cmake/QtAV.rc.in ${RC_FILE})
configure_file(${QTAV_SOURCE_DIR}/cmake/QtAV.rc.in ${RC_FILE})
endif()
add_library(${MODULE} SHARED ${SOURCES} ${RESOURCES_SOURCES} ${HEADERS} ${RC_FILE})
target_link_libraries(${MODULE}
Expand Down
12 changes: 6 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 12,8 @@ INCLUDE(CheckTypeSize)
include_directories(${QTDIR}/include) #TODO: remove. use external/include
get_filename_component(QTDIR "${QTDIR}" ABSOLUTE)

list(APPEND EXTRA_INCLUDE ${CMAKE_SOURCE_DIR}/external/include)
list(APPEND EXTRA_LIBS ${CMAKE_LIBRARY_PATH_FLAG}${CMAKE_SOURCE_DIR}/external/lib)
list(APPEND EXTRA_INCLUDE ${QTAV_SOURCE_DIR}/external/include)
list(APPEND EXTRA_LIBS ${CMAKE_LIBRARY_PATH_FLAG}${QTAV_SOURCE_DIR}/external/lib)
if(APPLE)
if(IOS)
#set_xcode_property(myioslib IPHONEOS_DEPLOYMENT_TARGET "8.0")
Expand All @@ -22,9 22,9 @@ if(APPLE)
list(APPEND EXTRA_LIBS -L/usr/local/lib)
endif()
endif()
if(EXISTS ${CMAKE_SOURCE_DIR}/contrib/capi/capi.h)
if(EXISTS ${QTAV_SOURCE_DIR}/contrib/capi/capi.h)
set(HAVE_CAPI 1)
list(APPEND EXTRA_INCLUDE ${CMAKE_SOURCE_DIR}/contrib/capi) # TODO: only files use capi.h
list(APPEND EXTRA_INCLUDE ${QTAV_SOURCE_DIR}/contrib/capi) # TODO: only files use capi.h
list(APPEND EXTRA_DEFS -DQTAV_HAVE_CAPI=1)
endif()

Expand Down Expand Up @@ -324,7 324,7 @@ endif()
if(WIN32 OR WindowsStore OR WindowsPhone)
check_include_files(XAudio2.h HAVE_XAUDIO2_H)
if(NOT HAVE_XAUDIO2_H)
list(APPEND EXTRA_INCLUDE ${CMAKE_SOURCE_DIR}/contrib/dxsdk)
list(APPEND EXTRA_INCLUDE ${QTAV_SOURCE_DIR}/contrib/dxsdk)
endif()
message("Qt5Gui_EGL_INCLUDE_DIRS: ${Qt5Gui_EGL_INCLUDE_DIRS}")
list(APPEND HEADERS
Expand Down Expand Up @@ -473,7 473,7 @@ QT5_ADD_RESOURCES(RESOURCES_SOURCES ${RESOURCES})
set_source_files_properties(${RESOURCES_SOURCES} PROPERTIES GENERATED ON)
if(WIN32)
set(RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.rc)
configure_file(${CMAKE_SOURCE_DIR}/cmake/QtAV.rc.in ${RC_FILE})
configure_file(${QTAV_SOURCE_DIR}/cmake/QtAV.rc.in ${RC_FILE})
endif()
# add HEADERS for moc
add_library(${MODULE} SHARED ${SOURCES} ${RESOURCES_SOURCES} ${HEADERS} ${RC_FILE})
Expand Down
2 changes: 1 addition & 1 deletion widgets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 43,7 @@ endif()
set(HEADERS ${SDK_HEADERS})
if(WIN32)
set(RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.rc)
configure_file(${CMAKE_SOURCE_DIR}/cmake/QtAV.rc.in ${RC_FILE})
configure_file(${QTAV_SOURCE_DIR}/cmake/QtAV.rc.in ${RC_FILE})
endif()
# add HEADERS for moc
add_library(${MODULE} SHARED ${SOURCES} ${RESOURCES_SOURCES} ${HEADERS} ${RC_FILE})
Expand Down

0 comments on commit 528769c

Please sign in to comment.