mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(build): when building without XSS extension
This commit is contained in:
parent
8c2703b756
commit
ab62221375
|
@ -7,6 +7,8 @@
|
||||||
cmake_minimum_required(VERSION 2.8.11)
|
cmake_minimum_required(VERSION 2.8.11)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
|
option(PLATFORM_EXTENSIONS "Enable platform specific extensions, requires extra dependencies" ON)
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE Debug)
|
set(CMAKE_BUILD_TYPE Debug)
|
||||||
endif()
|
endif()
|
||||||
|
@ -279,18 +281,6 @@ set(${PROJECT_NAME}_SOURCES
|
||||||
src/persistence/smileypack.h
|
src/persistence/smileypack.h
|
||||||
src/persistence/toxsave.cpp
|
src/persistence/toxsave.cpp
|
||||||
src/persistence/toxsave.h
|
src/persistence/toxsave.h
|
||||||
src/platform/autorun.h
|
|
||||||
src/platform/capslock.h
|
|
||||||
src/platform/timer.h
|
|
||||||
src/platform/autorun_osx.cpp
|
|
||||||
src/platform/autorun_win.cpp
|
|
||||||
src/platform/autorun_xdg.cpp
|
|
||||||
src/platform/capslock_osx.cpp
|
|
||||||
src/platform/capslock_win.cpp
|
|
||||||
src/platform/capslock_x11.cpp
|
|
||||||
src/platform/timer_osx.cpp
|
|
||||||
src/platform/timer_win.cpp
|
|
||||||
src/platform/timer_x11.cpp
|
|
||||||
src/video/cameradevice.cpp
|
src/video/cameradevice.cpp
|
||||||
src/video/cameradevice.h
|
src/video/cameradevice.h
|
||||||
src/video/camerasource.cpp
|
src/video/camerasource.cpp
|
||||||
|
@ -451,6 +441,23 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (PLATFORM_EXTENSIONS)
|
||||||
|
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
|
||||||
|
src/platform/autorun.h
|
||||||
|
src/platform/capslock.h
|
||||||
|
src/platform/timer.h
|
||||||
|
src/platform/autorun_osx.cpp
|
||||||
|
src/platform/autorun_win.cpp
|
||||||
|
src/platform/autorun_xdg.cpp
|
||||||
|
src/platform/capslock_osx.cpp
|
||||||
|
src/platform/capslock_win.cpp
|
||||||
|
src/platform/capslock_x11.cpp
|
||||||
|
src/platform/timer_osx.cpp
|
||||||
|
src/platform/timer_win.cpp
|
||||||
|
src/platform/timer_x11.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_definitions(-DQT_MESSAGELOGCONTEXT=1)
|
add_definitions(-DQT_MESSAGELOGCONTEXT=1)
|
||||||
|
|
||||||
if (NOT DEFINED ENABLE_STATUSNOTIFIER)
|
if (NOT DEFINED ENABLE_STATUSNOTIFIER)
|
||||||
|
|
|
@ -70,6 +70,8 @@ function(search_dependency pkg)
|
||||||
if(NOT ${pkg}_FOUND)
|
if(NOT ${pkg}_FOUND)
|
||||||
if(NOT arg_OPTIONAL)
|
if(NOT arg_OPTIONAL)
|
||||||
message(FATAL_ERROR "${pkg} package, library or framework not found")
|
message(FATAL_ERROR "${pkg} package, library or framework not found")
|
||||||
|
else()
|
||||||
|
message(STATUS "${pkg} not found")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
link_directories(${${pkg}_LIBRARY_DIRS})
|
link_directories(${${pkg}_LIBRARY_DIRS})
|
||||||
|
@ -78,6 +80,7 @@ function(search_dependency pkg)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" PARENT_SCOPE)
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" PARENT_SCOPE)
|
||||||
endforeach()
|
endforeach()
|
||||||
set(ALL_LIBRARIES ${ALL_LIBRARIES} ${${pkg}_LIBRARIES} PARENT_SCOPE)
|
set(ALL_LIBRARIES ${ALL_LIBRARIES} ${${pkg}_LIBRARIES} PARENT_SCOPE)
|
||||||
|
message(STATUS "${pkg} found")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${pkg}_FOUND ${${pkg}_FOUND} PARENT_SCOPE)
|
set(${pkg}_FOUND ${${pkg}_FOUND} PARENT_SCOPE)
|
||||||
|
@ -108,9 +111,11 @@ endif()
|
||||||
|
|
||||||
search_dependency(OPENAL PACKAGE openal FRAMEWORK OpenAL)
|
search_dependency(OPENAL PACKAGE openal FRAMEWORK OpenAL)
|
||||||
|
|
||||||
# Automatic auto-away support. (X11 also using for capslock detection)
|
if (PLATFORM_EXTENSIONS AND UNIX AND NOT APPLE)
|
||||||
search_dependency(X11 PACKAGE x11 OPTIONAL)
|
# Automatic auto-away support. (X11 also using for capslock detection)
|
||||||
search_dependency(XSS LIBRARY Xss OPTIONAL)
|
search_dependency(X11 PACKAGE x11 OPTIONAL)
|
||||||
|
search_dependency(XSS LIBRARY Xss OPTIONAL)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
search_dependency(AVFOUNDATION FRAMEWORK AVFoundation)
|
search_dependency(AVFOUNDATION FRAMEWORK AVFoundation)
|
||||||
|
@ -178,14 +183,16 @@ if (X11_FOUND AND XSS_FOUND)
|
||||||
set(X11_EXT True)
|
set(X11_EXT True)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (${APPLE_EXT} OR ${X11_EXT})
|
if (PLATFORM_EXTENSIONS)
|
||||||
|
if (${APPLE_EXT} OR ${X11_EXT})
|
||||||
add_definitions(
|
add_definitions(
|
||||||
-DQTOX_PLATFORM_EXT=1
|
-DQTOX_PLATFORM_EXT
|
||||||
)
|
|
||||||
else()
|
|
||||||
add_definitions(
|
|
||||||
-DQTOX_PLATFORM_EXT=0
|
|
||||||
)
|
)
|
||||||
|
message(STATUS "Using platform extensions")
|
||||||
|
else()
|
||||||
|
message(WARNING "Not using platform extensions, dependencies not found")
|
||||||
|
set(PLATFORM_EXTENSIONS OFF)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(
|
add_definitions(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user