Debian Codegraph @

ext/bifrost/src/CMakeLists.txt

raw
1 file(GLOB sources *.cpp roaring.c)
2 file(GLOB headers *.h *.hpp *.hh *.tcc)
3
4 list(REMOVE_ITEM sources Bifrost.cpp)
5
6 add_definitions(-DMAX_KMER_SIZE=${MAX_KMER_SIZE})
7 add_definitions(-DMAX_GMER_SIZE=${MAX_GMER_SIZE})
8
9 add_library(bifrost_static STATIC ${sources} ${headers})
10 add_library(bifrost_dynamic SHARED ${sources} ${headers})
11
12 set_target_properties(bifrost_static PROPERTIES OUTPUT_NAME "bifrost")
13 set_target_properties(bifrost_dynamic PROPERTIES OUTPUT_NAME "bifrost")
14
15 target_include_directories(bifrost_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
16 target_include_directories(bifrost_dynamic PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
17
18 add_executable(Bifrost Bifrost.cpp)
19
20 find_package(Threads REQUIRED)
21 target_link_libraries(bifrost_static pthread)
22 target_link_libraries(bifrost_dynamic pthread)
23
24 find_package(ZLIB REQUIRED)
25 target_link_libraries(bifrost_static ${ZLIB_LIBRARIES})
26 target_link_libraries(bifrost_dynamic ${ZLIB_LIBRARIES})
27
28 if (ZLIB_FOUND)
29 if (DEFINED ZLIB_INCLUDE_DIRS)
30 include_directories( ${ZLIB_INCLUDE_DIRS} )
31 elseif (DEFINED ZLIB_INCLUDE_DIR)
32 include_directories( ${ZLIB_INCLUDE_DIR} )
33 else()
34 message(FATAL_ERROR "zlib found but no include directories are set.")
35 endif()
36 else()
37 message(FATAL_ERROR "zlib not found. Required for to output files")
38 endif(ZLIB_FOUND)
39
40 target_link_libraries(Bifrost bifrost_dynamic)
41
42 install(TARGETS Bifrost DESTINATION bin)
43 install(TARGETS bifrost_dynamic DESTINATION lib)
44 install(TARGETS bifrost_static DESTINATION lib)
45 install(FILES ${headers} DESTINATION include/bifrost)