Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
chore(build): use search_dependency to add AppImageUpdaterBridge
Browse files Browse the repository at this point in the history
  • Loading branch information
antony-jr committed Jul 27, 2019
1 parent e50b3bb commit bcab451
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
33 changes: 17 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ if(APPLE)
/usr/local/opt/openal-soft/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
endif()

if(${APPIMAGE_UPDATER_BRIDGE})
set(ENV{PKG_CONFIG_PATH}
/usr/local/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
endif()

execute_process(
COMMAND brew --prefix qt5
OUTPUT_VARIABLE QT_PREFIX_PATH
Expand Down Expand Up @@ -691,12 +696,16 @@ endif()

if(${UPDATE_CHECK})
add_definitions(-DUPDATE_CHECK_ENABLED=1)
if(APPIMAGE_UPDATER_BRIDGE_SRC_DIR AND APPIMAGE_UPDATER_BRIDGE_BUILD_DIR)
message(STATUS "using AppImageUpdaterBridge")
add_definitions(-DAPPIMAGE_UPDATER_BRIDGE_ENABLED=1)
include_directories(${APPIMAGE_UPDATER_BRIDGE_SRC_DIR})
if(${APPIMAGE_UPDATER_BRIDGE})
search_dependency(AIUB PACKAGE AppImageUpdaterBridge)
if(AIUB_FOUND)
message(STATUS "using AppImageUpdaterBridge")
add_definitions(-DAPPIMAGE_UPDATER_BRIDGE_ENABLED=1)
else()
message(STATUS "cannot find AppImageUpdaterBridge , ignoring cmake flag")
endif()
else()
message(STATUS "NOT using AppImageUpdaterBridge")
message(STATUS "not using AppImageUpdaterBridge")
endif()
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
src/net/updatecheck.cpp
Expand Down Expand Up @@ -737,18 +746,10 @@ add_library(${PROJECT_NAME}_static
${${PROJECT_NAME}_SOURCES}
${${PROJECT_NAME}_QM_FILES}
${${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}
WIN32
MACOSX_BUNDLE
Expand Down
5 changes: 2 additions & 3 deletions appimage/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.


# Fail out on error
set -exuo pipefail

Expand Down Expand Up @@ -110,11 +109,11 @@ LDFLAGS="-lcrypto"
make
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
git clone "$AUB_GIT" "$AUB_SRC_DIR"
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
cd $AUB_BUILD_DIR
cmake .. -DLOGGING_DISABLED=ON
Expand Down

0 comments on commit bcab451

Please sign in to comment.