Skip to content

Commit

Permalink
Merge pull request #375 from vgteam/external-libraries
Browse files Browse the repository at this point in the history
Support external tabixpp
  • Loading branch information
pjotrp committed Apr 22, 2024
2 parents d984611 + da92060 commit 5b8e608
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ if (${CMAKE_BUILD_TYPE} MATCHES Release)
endif()

if ((${CMAKE_BUILD_TYPE} MATCHES Release) OR (${CMAKE_BUILD_TYPE} MATCHES RelWithDebInfo))
set (CMAKE_C_FLAGS "${OpenMP_C_FLAGS} ${EXTRA_FLAGS}")
set (CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${EXTRA_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}")
endif ()

if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
Expand Down Expand Up @@ -115,12 +115,22 @@ include_directories(contrib/multichoose)
include_directories(contrib/filevercmp)
include_directories(contrib/c-progress-bar)

if(NOT HTSLIB_FOUND)
if(HTSLIB_FOUND)
list(JOIN HTSLIB_CFLAGS " " HTSLIB_CFLAGS_STRING)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${HTSLIB_CFLAGS_STRING}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HTSLIB_CFLAGS_STRING}")
else(HTSLIB_FOUND)
message(STATUS "Using included htslib")
set(HTSLIB_LOCAL contrib/tabixpp/htslib)
set(TABIX_FOUND OFF) # also build tabixpp if htslib is missing
set(TABIXPP_FOUND OFF) # also build tabixpp if htslib is missing
endif()

if (NOT TABIX_FOUND)
if(TABIXPP_FOUND)
list(JOIN TABIXPP_CFLAGS " " TABIXPP_CFLAGS_STRING)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TABIXPP_CFLAGS_STRING}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TABIXPP_CFLAGS_STRING}")
else(TABIXPP_FOUND)
message(STATUS "Using included tabixpp")
set(TABIXPP_LOCAL contrib/tabixpp)
include_directories(contrib/tabixpp)
set(tabixpp_SOURCE
Expand Down Expand Up @@ -365,6 +375,7 @@ if (HTSLIB_LOCAL)
endif(HTSLIB_LOCAL)

if(WFA_GITMODULE)
message(STATUS "Using included libwfa")
set(WFA_INCLUDE_DIRS ${WFA_LOCAL})
add_subdirectory(${WFA_LOCAL})
set(WFALIB wfa2) # pick up the wfa2 lib target from the included CMakeLists.txt
Expand Down

0 comments on commit 5b8e608

Please sign in to comment.