-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathCMakeLists.txt
67 lines (53 loc) · 1.82 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
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 2.6)
enable_testing()
project(marray)
include_directories(include include/andres)
file(GLOB headers include/andres/*)
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-Wall)
endif()
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_HDF5USEDLL_)
endif()
# doxygen
find_package(Doxygen QUIET)
if(DOXYGEN_FOUND)
message(STATUS "Doxygen found.")
else()
message("doxygen not found.")
endif()
# hdf5
find_package(HDF5)
if(HDF5_FOUND)
include_directories(${HDF5_INCLUDE_DIR})
endif()
# png
find_package(PNG)
if(PNG_FOUND)
include_directories(${PNG_INCLUDE_DIR})
endif()
# targets
add_executable(tutorial-marray src/tutorial/tutorial.cxx ${headers})
add_executable(test-marray src/unittest/marray.cxx ${headers})
add_test(test-marray test-marray)
add_executable(test-marray-bmp src/unittest/marray-bmp.cxx ${headers})
add_test(test-marray-bmp test-marray-bmp)
if(HDF5_FOUND)
add_executable(test-hdf5 src/unittest/hdf5.cxx ${headers})
target_link_libraries(test-hdf5 ${HDF5_LIBRARIES})
add_test(test-hdf5 test-hdf5)
add_executable(test-marray-hdf5 src/unittest/marray-hdf5.cxx ${headers})
target_link_libraries(test-marray-hdf5 ${HDF5_LIBRARIES})
add_test(test-marray-hdf5 test-marray-hdf5)
add_executable(tutorial-marray-hdf5 src/tutorial/tutorial-hdf5.cxx ${headers})
target_link_libraries(tutorial-marray-hdf5 ${HDF5_LIBRARIES})
endif()
if(PNG_FOUND)
add_executable(test-marray-png src/unittest/marray-png.cxx ${headers})
target_link_libraries(test-marray-png ${PNG_LIBRARIES})
add_test(test-marray-png test-marray-png)
endif()
if(DOXYGEN_FOUND)
configure_file("${marray_SOURCE_DIR}/doxygen/Doxyfile.in" "${marray_BINARY_DIR}/Doxyfile" @ONLY IMMEDIATE)
add_custom_target(doc-marray ALL COMMAND ${DOXYGEN} "${marray_BINARY_DIR}/Doxyfile")
endif()