-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
58 lines (39 loc) · 1.59 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
cmake_minimum_required(VERSION 3.2)
set(PROJECT_NAME kallisto-align)
project(${PROJECT_NAME})
include(ExternalProject)
set(CMAKE_CXX_COMPILER g++)
set(CMAKE_VERBOSE_MAKEFILE on)
add_compile_options(-std=c++11)
# Set default ExternalProject root directory
SET_DIRECTORY_PROPERTIES(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/external)
ExternalProject_Add(
kallisto
URL https://github.com/churchill-lab/kallisto/archive/master.zip
INSTALL_COMMAND ""
)
ExternalProject_Get_Property(kallisto source_dir)
set(KALLISTO_INCLUDE_DIR ${source_dir})
MESSAGE(STATUS "KALLISTO_INCLUDE_DIR=" ${KALLISTO_INCLUDE_DIR})
# Library
ExternalProject_Get_Property(kallisto binary_dir)
set(KALLISTO_LIBRARY_PATH ${binary_dir}/src/libkallisto_core.a)
MESSAGE(STATUS "KALLISTO_LIBRARY_PATH=" ${KALLISTO_LIBRARY_PATH})
add_executable(${PROJECT_NAME} main.cpp)
add_dependencies(${PROJECT_NAME} kallisto)
include_directories(${KALLISTO_INCLUDE_DIR}/src)
target_link_libraries(${PROJECT_NAME} ${KALLISTO_LIBRARY_PATH})
find_package( ZLIB REQUIRED )
if ( ZLIB_FOUND )
include_directories( ${ZLIB_INCLUDE_DIRS} )
target_link_libraries( ${PROJECT_NAME} ${ZLIB_LIBRARIES} )
else()
message(FATAL_ERROR "zlib not found. Required for to output files" )
endif( ZLIB_FOUND )
find_package(HDF5)
if(HDF5_FOUND)
include_directories( ${HDF5_INCLUDE_DIR} )
target_link_libraries( ${PROJECT_NAME} ${HDF5_LIBRARIES} )
else()
message(FATAL_ERROR "HDF5 not found. Required to output files")
endif(HDF5_FOUND)