Skip to content
Open
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
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ if(WIN32)
find_library(WS2_32_LIBRARY ws2_32)
endif()

if(DEFINED USE_SYSTEM_LIBS)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PLIST REQUIRED libplist++-2.0)
pkg_check_modules(USBMUX REQUIRED libusbmuxd-2.0)
pkg_check_modules(IMOBILEDEV REQUIRED libimobiledevice-1.0)
endif()

if(NOT PLIST_FOUND EQUAL 1)

# ---- libcnary

set(libcnary_HEADERS
Expand Down Expand Up @@ -109,6 +118,10 @@ target_link_libraries(libplist
libcnary
)

endif() # NOT PLIST_FOUND

if(NOT USBMUX_FOUND EQUAL 1)

#------- libusbmuxd

set(libusbmuxd_HEADERS
Expand Down Expand Up @@ -163,6 +176,7 @@ if(WIN32)
target_link_libraries(libusbmuxd wsock32 ws2_32)
endif()

endif() # NOT USBMUX_FOUND

# -------- Portal Lib

Expand All @@ -187,6 +201,13 @@ include_directories(portal include
deps/portal/src/
)

if(DEFINED USE_SYSTEM_LIBS)
add_library(portal SHARED ${portal_SOURCES} ${portal_HEADERS})
target_link_libraries(portal PUBLIC ${IMOBILEDEV_LIBRARIES} ${USBMUXD_LIBRARIES})
target_link_directories(portal PUBLIC ${IMOBILEDEV_LIBRARY_DIRS} ${USBMUXD_LIBRARY_DIRS})

else()

add_library(portal STATIC
${portal_SOURCES}
${portal_HEADERS})
Expand All @@ -198,6 +219,8 @@ target_link_libraries(portal
libimobiledevice
)

endif() # DEFINED USE_SYSTEM_LIBS

## --

set(ENABLE_PROGRAMS false)
Expand Down