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

chore(cmake): Added optional dependencies

This commit is contained in:
Diadlo 2016-11-30 09:45:15 +03:00
parent ba872e02af
commit d5870d8079
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
2 changed files with 41 additions and 26 deletions

View File

@ -411,7 +411,10 @@ set(${PROJECT_NAME}_SOURCES
src/widget/widget.cpp
src/widget/widget.h)
if(GDK_PIXBUF_FOUND AND GLIB_FOUND AND GTK_FOUND)
if (NOT ENABLE_STATUSNOTIFIER)
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
src/platform/statusnotifier/closures.h
@ -429,11 +432,18 @@ if(AVFOUNDATION_FOUND)
src/platform/camera/avfoundation.h)
endif()
if(APPINDICATOR_FOUND)
if (NOT ENABLE_APPINDICATOR)
set(ENABLE_APPINDICATOR False)
endif()
if(${ENABLE_APPINDICATOR} AND APPINDICATOR_FOUND)
add_definitions(-DENABLE_SYSTRAY_UNITY_BACKEND=1)
endif()
if(GTK_FOUND)
if (NOT ENABLE_GTK_SYSTRAY)
set(ENABLE_GTK_SYSTRAY True)
endif()
if(${ENABLE_GTK_SYSTRAY} AND GTK_FOUND)
add_definitions(-DENABLE_SYSTRAY_GTK_BACKEND=1)
endif()

View File

@ -111,43 +111,48 @@ if(WIN32)
search_dependency(STRMIIDS LIBRARY strmiids)
endif()
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)
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")
if(NOT GIT_DESCRIBE)
set(GIT_DESCRIBE "Nightly")
endif()
endif()
add_definitions(
-DGIT_DESCRIBE="${GIT_DESCRIBE}"
)
# 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
)
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
)
if(NOT GIT_VERSION)
set(GIT_VERSION "build without git")
if(NOT GIT_VERSION)
set(GIT_VERSION "build without git")
endif()
endif()
add_definitions(
-DGIT_VERSION="${GIT_VERSION}"
)
execute_process(
COMMAND date +%s
OUTPUT_VARIABLE TIMESTAMP
)
if (NOT TIMESTAMP)
execute_process(
COMMAND date +%s
OUTPUT_VARIABLE TIMESTAMP
)
endif()
add_definitions(
-DTIMESTAMP=${TIMESTAMP}