-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
51 lines (42 loc) · 1.54 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
cmake_minimum_required(VERSION 3.9)
project(cz5test C CXX)
message(STATUS "Using C11")
message(CXX)
set(CMAKE_C_STANDARD 11)
if (NOT "${CMAKE_CXX_FLAGS}" MATCHES "-std=c\\+\\+17")
message(STATUS "Using C++14")
set(CMAKE_CXX_STANDARD 14)
else()
message(STATUS "Using C++17")
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(DEFINED ENV{CONDA_PREFIX})
include_directories(BEFORE $ENV{CONDA_PREFIX}/include)
list(APPEND CMAKE_PREFIX_PATH $ENV{CONDA_PREFIX})
endif()
option(WITH_MARRAY ON)
if(WITH_MARRAY)
set(MARRAY_INCLUDE_DIR ${CMAKE_PREFIX_PATH} CACHE PATH "include")
add_definitions(-DWITH_MARRAY)
include_directories(${MARRAY_INCLUDE_DIR})
endif()
find_package(Boost REQUIRED COMPONENTS system filesystem)
option(WITH_ZLIB ON)
if(WITH_ZLIB)
find_package(ZLIB REQUIRED)
include_directories(ZLIB_INCLUDE_DIRS)
message(ZLIB_INCLUDE_DIRS)
add_definitions(-DWITH_ZLIB)
SET(COMPRESSION_LIBRARIES "${COMPRESSION_LIBRARIES};${ZLIB_LIBRARIES}")
endif()
SET(TEST_LIBS
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY})
add_executable(test_cpp main.cpp)
target_link_libraries(test_cpp LINK_PUBLIC ${TEST_LIBS} ${COMPRESSION_LIBRARIES})
add_executable(test_c main.c z5wrapper.cc)
target_link_libraries(test_c LINK_PUBLIC ${TEST_LIBS} ${COMPRESSION_LIBRARIES})
add_executable(test_attributes test_attributes.c z5wrapper.cc)
target_link_libraries(test_attributes LINK_PUBLIC ${TEST_LIBS} ${COMPRESSION_LIBRARIES})
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/z5wrapper.h"
DESTINATION "${CMAKE_INSTALL_PREFIX}/include")