Skip to content

Add option for use system libappimage #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ project(AppImageUpdate)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(USE_SYSTEM_LIBAPPIMAGE OFF CACHE BOOL "")

# read Git revision ID
# WARNING: this value will be stored in the CMake cache
# to update it, you will have to reset the CMake cache
Expand Down
3 changes: 2 additions & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
add_subdirectory(zsync2 EXCLUDE_FROM_ALL)

if(NOT TARGET libappimage)
if(NOT USE_SYSTEM_LIBAPPIMAGE)
add_subdirectory(libappimage EXCLUDE_FROM_ALL)
set(LIBAPPIMAGE_LIBRARIES libappimage_shared PARENT_SCOPE)
endif()
7 changes: 5 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ find_package(Sanitizers REQUIRED)
# required to link to correct thread library
find_package(Threads REQUIRED)
find_package(X11 REQUIRED)
if(USE_SYSTEM_LIBAPPIMAGE)
find_package(libappimage REQUIRED)
endif()

if(NOT ${X11_Xpm_FOUND})
message(FATAL_ERROR "libxpm could not be found!")
Expand Down Expand Up @@ -38,7 +41,7 @@ set_target_properties(libappimageupdate
)
# link thread libraries
target_link_libraries(libappimageupdate
PUBLIC libappimage_shared
PUBLIC ${LIBAPPIMAGE_LIBRARIES}
PRIVATE ${CMAKE_THREAD_LIBS_INIT}
PRIVATE libzsync2
PRIVATE ${CPR_LIBRARIES}
Expand Down Expand Up @@ -69,7 +72,7 @@ set_target_properties(libappimageupdate_static
)
# link thread libraries
target_link_libraries(libappimageupdate_static
PUBLIC libappimage_shared
PUBLIC ${LIBAPPIMAGE_LIBRARIES}
PRIVATE ${CMAKE_THREAD_LIBS_INIT}
PRIVATE libzsync2
PRIVATE ${CPR_LIBRARIES}
Expand Down