Skip to content

Commit

Permalink
Use PkgConfig, as suggested in #61
Browse files Browse the repository at this point in the history
  • Loading branch information
bkille committed Aug 22, 2023
1 parent 28ea0b8 commit b9a643f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ endif()
option(USE_HTSLIB "Compile with htslib for --targetPrefix and --targetList" OFF)
if (USE_HTSLIB)
add_definitions(-DUSE_HTSLIB)
find_package(PkgConfig)
pkg_check_modules(HTSLIB REQUIRED IMPORTED_TARGET htslib)
endif()
option(PROFILE "Prevent inlining and add debug symbols" OFF)

Expand Down Expand Up @@ -73,13 +75,17 @@ add_executable(mashmap-align
target_include_directories(mashmap PRIVATE
src
src/common
)
)

target_include_directories(mashmap-align PRIVATE
src
src/common
)
)

if (USE_HTSLIB)
target_link_libraries(mashmap PkgConfig::HTSLIB)
target_link_libraries(mashmap-align PkgConfig::HTSLIB)
endif()

target_link_libraries(mashmap
gsl
Expand All @@ -90,9 +96,6 @@ target_link_libraries(mashmap
z
#assert
)
if (USE_HTSLIB)
target_link_libraries(mashmap hts)
endif()

target_link_libraries(mashmap-align
gsl
Expand All @@ -103,9 +106,6 @@ target_link_libraries(mashmap-align
z
#assert
)
if (USE_HTSLIB)
target_link_libraries(mashmap-align hts)
endif()

install(TARGETS mashmap DESTINATION bin)
install(TARGETS mashmap-align DESTINATION bin)
Expand Down

0 comments on commit b9a643f

Please sign in to comment.