1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

chore(cmake): Small fixes

This commit is contained in:
Diadlo 2016-12-04 01:44:03 +03:00
parent 1efca679e1
commit 7f80416c89
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
2 changed files with 73 additions and 62 deletions

View File

@ -23,14 +23,6 @@ execute_process(
OUTPUT_VARIABLE QT_PREFIX_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT QT_PREFIX_PATH)
set(QT_PREFIX_PATH
/usr/src/mxe/usr/x86_64-w64-mingw32.shared/qt5
/usr/src/mxe/usr/i686-w64-mingw32.shared/qt5)
endif()
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT_PREFIX_PATH})
execute_process(
COMMAND xcode-select -p
OUTPUT_VARIABLE CMAKE_OSX_SYSROOT
@ -124,7 +116,7 @@ qt5_add_resources(
)
if(NOT ${SMILEYS})
set(SMILEYS, "")
set(SMILEYS, "")
endif()
if(NOT ${SMILEYS} MATCHES "NO")
@ -253,12 +245,6 @@ set(${PROJECT_NAME}_SOURCES
src/persistence/smileypack.h
src/persistence/toxsave.cpp
src/persistence/toxsave.h
src/platform/camera/directshow.cpp
src/platform/camera/directshow.h
src/platform/camera/v4l2.cpp
src/platform/camera/v4l2.h
src/platform/install_osx.cpp
src/platform/install_osx.h
src/platform/autorun.h
src/platform/capslock.h
src/platform/timer.h
@ -409,11 +395,32 @@ set(${PROJECT_NAME}_SOURCES
src/widget/translator.cpp
src/widget/translator.h
src/widget/widget.cpp
src/widget/widget.h)
src/widget/widget.h
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
src/platform/camera/directshow.cpp
src/platform/camera/directshow.h
)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
src/platform/camera/v4l2.cpp
src/platform/camera/v4l2.h
)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
src/platform/install_osx.cpp
src/platform/install_osx.h
)
endif()
add_definitions(-DQT_MESSAGELOGCONTEXT=1)
if (NOT ENABLE_STATUSNOTIFIER)
set(ENABLE_STATUSNOTIFIER True)
set(ENABLE_STATUSNOTIFIER True)
endif()
if(${ENABLE_STATUSNOTIFIER} AND GDK_PIXBUF_FOUND AND GLIB_FOUND AND GTK_FOUND)
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
src/platform/statusnotifier/closures.c
@ -433,14 +440,14 @@ if(AVFOUNDATION_FOUND)
endif()
if (NOT ENABLE_APPINDICATOR)
set(ENABLE_APPINDICATOR False)
set(ENABLE_APPINDICATOR False)
endif()
if(${ENABLE_APPINDICATOR} AND APPINDICATOR_FOUND)
add_definitions(-DENABLE_SYSTRAY_UNITY_BACKEND=1)
endif()
if (NOT ENABLE_GTK_SYSTRAY)
set(ENABLE_GTK_SYSTRAY True)
set(ENABLE_GTK_SYSTRAY True)
endif()
if(${ENABLE_GTK_SYSTRAY} AND GTK_FOUND)

View File

@ -48,7 +48,12 @@ function(search_dependency pkg)
# Then, try OSX frameworks.
if(NOT ${pkg}_FOUND AND arg_FRAMEWORK)
find_library(${pkg}_LIBRARIES NAMES ${arg_FRAMEWORK} PATHS ${CMAKE_OSX_SYSROOT}/System/Library PATH_SUFFIXES Frameworks NO_DEFAULT_PATH)
find_library(${pkg}_LIBRARIES
NAMES ${arg_FRAMEWORK}
PATHS ${CMAKE_OSX_SYSROOT}/System/Library
PATH_SUFFIXES Frameworks
NO_DEFAULT_PATH
)
if(${pkg}_LIBRARIES)
set(${pkg}_FOUND TRUE)
endif()
@ -80,7 +85,6 @@ search_dependency(APPINDICATOR PACKAGE appindicator-0.1 OPTIONAL)
search_dependency(GDK_PIXBUF PACKAGE gdk-pixbuf-2.0 OPTIONAL)
search_dependency(GLIB PACKAGE glib-2.0 OPTIONAL)
search_dependency(GTK PACKAGE gtk+-2.0 OPTIONAL)
search_dependency(X11 PACKAGE x11 OPTIONAL)
search_dependency(LIBAVCODEC PACKAGE libavcodec)
search_dependency(LIBAVDEVICE PACKAGE libavdevice)
@ -96,15 +100,17 @@ search_dependency(VPX PACKAGE vpx)
search_dependency(OPENAL PACKAGE openal FRAMEWORK OpenAL)
# XScreenSaver support.
# Automatic auto-away support. (X11 also using for capslock detection)
search_dependency(X11 PACKAGE x11 OPTIONAL)
search_dependency(XSS LIBRARY Xss OPTIONAL)
if(APPLE)
search_dependency(AVFOUNDATION FRAMEWORK AVFoundation)
search_dependency(COREMEDIA FRAMEWORK CoreMedia )
search_dependency(COREGRAPHICS FRAMEWORK CoreGraphics)
search_dependency(FOUNDATION FRAMEWORK Foundation )
search_dependency(IOKIT FRAMEWORK IOKit )
search_dependency(FOUNDATION FRAMEWORK Foundation OPTIONAL)
search_dependency(IOKIT FRAMEWORK IOKit OPTIONAL)
endif()
if(WIN32)
@ -112,17 +118,17 @@ if(WIN32)
endif()
if (NOT GIT_DESCRIBE)
execute_process(
COMMAND git describe --tags
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DESCRIBE
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND git describe --tags
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DESCRIBE
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT GIT_DESCRIBE)
set(GIT_DESCRIBE "Nightly")
endif()
if(NOT GIT_DESCRIBE)
set(GIT_DESCRIBE "Nightly")
endif()
endif()
add_definitions(
@ -130,17 +136,17 @@ add_definitions(
)
if (NOT GIT_VERSION)
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT GIT_VERSION)
set(GIT_VERSION "build without git")
endif()
if(NOT GIT_VERSION)
set(GIT_VERSION "build without git")
endif()
endif()
add_definitions(
@ -148,32 +154,30 @@ add_definitions(
)
if (NOT TIMESTAMP)
execute_process(
COMMAND date +%s
OUTPUT_VARIABLE TIMESTAMP
)
execute_process(
COMMAND date +%s
OUTPUT_VARIABLE TIMESTAMP
)
endif()
set(APPLE_EXT False)
if (AVFOUNDATION_FOUND OR FRAMEWORK_FOUND OR COREMEDIA_FOUND
OR COREGRAPHICS_FOUND OR FOUNDATION_FOUND OR IOKIT_FOUND)
set(APPLE_EXT True)
if (FOUNDATION_FOUND AND IOKIT_FOUND)
set(APPLE_EXT True)
endif()
set(LINUX_EXT False)
if (APPINDICATOR_FOUND OR GDK_PIXBUF_FOUND OR GLIB_FOUND
OR GTK_FOUND OR X11_FOUND OR XSS_FOUND)
set(LINUX_EXT True)
set(X11_EXT False)
if (X11_FOUND AND XSS_FOUND)
set(X11_EXT True)
endif()
if (${APPLE_EXT} OR ${LINUX_EXT})
add_definitions(
-DQTOX_PLATFORM_EXT=1
)
if (${APPLE_EXT} OR ${X11_EXT})
add_definitions(
-DQTOX_PLATFORM_EXT=1
)
else()
add_definitions(
-DQTOX_PLATFORM_EXT=0
)
add_definitions(
-DQTOX_PLATFORM_EXT=0
)
endif()
add_definitions(