diff --git a/CMakeLists.txt b/CMakeLists.txt index 14ba1e9..0804917 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,8 @@ add_compile_options( ) if(NOT PROJECT_IS_TOP_LEVEL) - set(STATIC_ANALYSIS OFF) + set(STATIC_ANALYSIS off) + set(LIBRARY_ONLY on) endif() if(STATIC_ANALYSIS) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 03fa91a..6345519 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(HTSLIB REQUIRED) -if(NOT TARGET smithlab_cpp) +if(NOT TARGET bamxx) add_subdirectory(bamxx) endif() if(NOT TARGET smithlab_cpp) @@ -28,16 +28,18 @@ add_library(abismal_objs OBJECT AbismalIndex.cpp simreads.cpp ) -target_link_libraries(abismal_objs PUBLIC bamxx smithlab_cpp) -target_include_directories(abismal_objs PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -# ADS: below, for config.h -target_include_directories(abismal_objs PUBLIC ${CMAKE_BINARY_DIR}) - -add_executable(abismal abismal_main.cpp) -# ADS: below, for config.h -target_include_directories(abismal PUBLIC ${CMAKE_BINARY_DIR}) -target_link_libraries(abismal PUBLIC - abismal_objs +target_link_libraries(abismal_objs PUBLIC + bamxx smithlab_cpp HTSLIB::HTSLIB ) +# ADS: CMAKE_BINARY_DIR for config.h +target_include_directories(abismal_objs PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR} +) + +if(NOT LIBRARY_ONLY) + add_executable(abismal abismal_main.cpp) + target_link_libraries(abismal PRIVATE abismal_objs) +endif()