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

chore(build): use search_dependency to add AppImageUpdaterBridge

This commit is contained in:
antony-jr 2019-07-27 16:07:49 +05:30
parent e50b3bbd5c
commit bcab4514e4
No known key found for this signature in database
GPG Key ID: 13089CB6F3D41A27
2 changed files with 19 additions and 19 deletions

View File

@ -56,6 +56,11 @@ if(APPLE)
/usr/local/opt/openal-soft/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}) /usr/local/opt/openal-soft/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
endif() endif()
if(${APPIMAGE_UPDATER_BRIDGE})
set(ENV{PKG_CONFIG_PATH}
/usr/local/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
endif()
execute_process( execute_process(
COMMAND brew --prefix qt5 COMMAND brew --prefix qt5
OUTPUT_VARIABLE QT_PREFIX_PATH OUTPUT_VARIABLE QT_PREFIX_PATH
@ -691,12 +696,16 @@ endif()
if(${UPDATE_CHECK}) if(${UPDATE_CHECK})
add_definitions(-DUPDATE_CHECK_ENABLED=1) add_definitions(-DUPDATE_CHECK_ENABLED=1)
if(APPIMAGE_UPDATER_BRIDGE_SRC_DIR AND APPIMAGE_UPDATER_BRIDGE_BUILD_DIR) if(${APPIMAGE_UPDATER_BRIDGE})
message(STATUS "using AppImageUpdaterBridge") search_dependency(AIUB PACKAGE AppImageUpdaterBridge)
add_definitions(-DAPPIMAGE_UPDATER_BRIDGE_ENABLED=1) if(AIUB_FOUND)
include_directories(${APPIMAGE_UPDATER_BRIDGE_SRC_DIR}) message(STATUS "using AppImageUpdaterBridge")
add_definitions(-DAPPIMAGE_UPDATER_BRIDGE_ENABLED=1)
else()
message(STATUS "cannot find AppImageUpdaterBridge , ignoring cmake flag")
endif()
else() else()
message(STATUS "NOT using AppImageUpdaterBridge") message(STATUS "not using AppImageUpdaterBridge")
endif() endif()
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES} set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
src/net/updatecheck.cpp src/net/updatecheck.cpp
@ -737,18 +746,10 @@ add_library(${PROJECT_NAME}_static
${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_SOURCES}
${${PROJECT_NAME}_QM_FILES} ${${PROJECT_NAME}_QM_FILES}
${${PROJECT_NAME}_RESOURCES}) ${${PROJECT_NAME}_RESOURCES})
target_link_libraries(${PROJECT_NAME}_static
${CMAKE_REQUIRED_LIBRARIES}
${ALL_LIBRARIES})
if(APPIMAGE_UPDATER_BRIDGE_BUILD_DIR AND APPIMAGE_UPDATER_BRIDGE_SRC_DIR AND UPDATE_CHECK)
target_link_libraries(${PROJECT_NAME}_static
${CMAKE_REQUIRED_LIBRARIES}
${ALL_LIBRARIES}
${APPIMAGE_UPDATER_BRIDGE_BUILD_DIR}/libAppImageUpdaterBridge.a)
else()
target_link_libraries(${PROJECT_NAME}_static
${CMAKE_REQUIRED_LIBRARIES}
${ALL_LIBRARIES})
endif()
add_executable(${PROJECT_NAME} add_executable(${PROJECT_NAME}
WIN32 WIN32
MACOSX_BUNDLE MACOSX_BUNDLE

View File

@ -22,7 +22,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
# Fail out on error # Fail out on error
set -exuo pipefail set -exuo pipefail
@ -110,11 +109,11 @@ LDFLAGS="-lcrypto"
make make
make install make install
# build aub into a static library and later use it in # build aub into a static library and later use it in
# qTox # qTox
git clone "$AUB_GIT" "$AUB_SRC_DIR" git clone "$AUB_GIT" "$AUB_SRC_DIR"
cd "$AUB_SRC_DIR" # we need to checkout first cd "$AUB_SRC_DIR" # we need to checkout first
git checkout tags/v1.1.1 git checkout tags/v1.1.2
mkdir $AUB_BUILD_DIR mkdir $AUB_BUILD_DIR
cd $AUB_BUILD_DIR cd $AUB_BUILD_DIR
cmake .. -DLOGGING_DISABLED=ON cmake .. -DLOGGING_DISABLED=ON