Skip to content
Merged
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
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.10)
project(libvgio VERSION 0.0.0 LANGUAGES CXX)

OPTION(USE_INSTALLED_LIBHANDLEGRAPH "Use the version of libhandlegraph installed on the system, if it exists, instead of the bundled version [default: off]" OFF)
OPTION(USE_INSTALLED_LIBHANDLEGRAPH_ONLY "Use the version of libhandlegraph installed on the system, which must exist [default: off]" OFF)


# Optimize by default, but also include debug info
Expand Down Expand Up @@ -91,8 +92,14 @@ pkg_check_modules(HTSlib REQUIRED htslib)
pkg_check_modules(Jansson REQUIRED jansson)

# Find or build libhandlegraph
if (USE_INSTALLED_LIBHANDLEGRAPH)
find_package(libhandlegraph)
if (USE_INSTALLED_LIBHANDLEGRAPH_ONLY)
find_package(libhandlegraph REQUIRED)
else()
if (USE_INSTALLED_LIBHANDLEGRAPH)
find_package(libhandlegraph)
else ()
message("Not checking for installed libhandlegraph")
endif()
endif()

if (${libhandlegraph_FOUND})
Expand All @@ -104,9 +111,6 @@ else ()
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/deps/libhandlegraph")
endif()

add_library(libhandlegraph::handlegraph_shared ALIAS handlegraph_shared)
add_library(libhandlegraph::handlegraph_static ALIAS handlegraph_static)

if (CMAKE_MAJOR_VERSION EQUAL "3" AND (CMAKE_MINOR_VERSION EQUAL "10" OR CMAKE_MINOR_VERSION EQUAL "11"))
# Set link directories. We can't yet use target_link_directories to keep
# these straight between static and dynamic libraries since it's not
Expand Down