-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
134 lines (103 loc) · 4.35 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
cmake_minimum_required(VERSION 2.8)
project(NextGenMap)
set( NGM_VERSION_MAJOR 0 )
set( NGM_VERSION_MINOR 5 )
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Building in debug mode!")
set( NGM_VERSION_BUILD 5-debug )
else()
set( NGM_VERSION_BUILD 5)
ENDIF()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/ngm-${NGM_VERSION_MAJOR}.${NGM_VERSION_MINOR}.${NGM_VERSION_BUILD}/)
file(MAKE_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
#add_definitions(-D INSTANCE_COUNTING)
#VERBOSE OUTPUT
#add_definitions(-D VERBOSE)
#DEBUG OUTPUT FOR CS (FILE: cs-results.txt)
#add_definitions(-D _DEBUGCS)
#DEBUG OUTPUT FOR CS (CONSOLE)
#add_definitions(-D _DEBUGCSVERBOSE)
#DEBUG OUTPUT FOR SCORE COMPTATION
#add_definitions(-D _DEBUGSW)
#add_definitions(-D _DEBUGOUT)
#add_definitions(-D _DEBUGCSKMERS)
#add_definitions(-D _DEBUGRP)
#Print bed file with all CMRs
#add_definitions(-D _DEBUGCMRS)
# Set a default build type for single-configuration
# CMake generators if no build type is set.
IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type specified. Using 'release'")
SET(CMAKE_BUILD_TYPE Release)
ENDIF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
IF(NOT APPLE)
SET (CMAKE_CXX_FLAGS_RELEASE "-L${EXECUTABLE_OUTPUT_PATH}/opencl/lib")
SET (CMAKE_CXX_FLAGS_DEBUG "-L${EXECUTABLE_OUTPUT_PATH}/opencl/lib")
endif()
IF(NOT APPLE)
add_subdirectory(opencl-sdk)
endif()
IF(APPLE)
set(GDB "ggdb")
set(OPENCL_LIBRARIES "-framework OpenCL")
ELSE()
set(GDB "gdb")
set(OPENCL_LIBRARIES "-lOpenCL")
ENDIF()
include_directories("${CMAKE_CURRENT_BINARY_DIR}/lib/zlib-1.2.7")
include_directories("${PROJECT_SOURCE_DIR}/lib/zlib-1.2.7")
add_subdirectory(lib/zlib-1.2.7)
add_subdirectory(lib/bamtools-2.3.0)
IF(NOT APPLE)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/opencl-sdk/AMD-APP-SDK-v2.8.1.0-RC-lnx64/include")
endif()
add_subdirectory(lib/mason/opencl)
add_subdirectory(src)
add_subdirectory(utils)
#Writing wrapper scripts for NextGenMape: ngm, ngm-debug, ngm-log
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ngm" "#!/bin/bash
pushd . > /dev/null
SCRIPT_PATH=\"\${BASH_SOURCE[0]}\";
while([ -h \"\${SCRIPT_PATH}\" ]) do
cd \"`dirname \"\${SCRIPT_PATH}\"`\"
SCRIPT_PATH=\"$(readlink \"`basename \"\${SCRIPT_PATH}\"`\")\";
done
cd \"`dirname \"\${SCRIPT_PATH}\"`\" > /dev/null
SCRIPT_PATH=\"`pwd`\";
popd > /dev/null
#echo \"srcipt=[\${SCRIPT_PATH}]\"
#echo \"pwd =[`pwd`]\"
OPENCL_VENDOR_PATH=\"$SCRIPT_PATH/opencl/vendor\" LD_LIBRARY_PATH=\"$SCRIPT_PATH/opencl/lib\" exec $SCRIPT_PATH/ngm-core $@
")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ngm-log" "#!/bin/bash
pushd . > /dev/null
SCRIPT_PATH=\"\${BASH_SOURCE[0]}\";
while([ -h \"\${SCRIPT_PATH}\" ]) do
cd \"`dirname \"\${SCRIPT_PATH}\"`\"
SCRIPT_PATH=\"$(readlink \"`basename \"\${SCRIPT_PATH}\"`\")\";
done
cd \"`dirname \"\${SCRIPT_PATH}\"`\" > /dev/null
SCRIPT_PATH=\"`pwd`\";
popd > /dev/null
#echo \"srcipt=[\${SCRIPT_PATH}]\"
#echo \"pwd =[`pwd`]\"
OPENCL_VENDOR_PATH=\"$SCRIPT_PATH/opencl/vendor\" LD_LIBRARY_PATH=\"$SCRIPT_PATH/opencl/lib\" exec $SCRIPT_PATH/ngm-core-debug $@
")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ngm-debug" "#!/bin/bash
pushd . > /dev/null
SCRIPT_PATH=\"\${BASH_SOURCE[0]}\";
while([ -h \"\${SCRIPT_PATH}\" ]) do
cd \"`dirname \"\${SCRIPT_PATH}\"`\"
SCRIPT_PATH=\"$(readlink \"`basename \"\${SCRIPT_PATH}\"`\")\";
done
cd \"`dirname \"\${SCRIPT_PATH}\"`\" > /dev/null
SCRIPT_PATH=\"`pwd`\";
popd > /dev/null
#echo \"srcipt=[\${SCRIPT_PATH}]\"
#echo \"pwd =[`pwd`]\"
OPENCL_VENDOR_PATH=\"$SCRIPT_PATH/opencl/vendor\" LD_LIBRARY_PATH=\"$SCRIPT_PATH/opencl/lib\" exec ${GDB} --args $SCRIPT_PATH/ngm-core-debug $@
")
file(COPY "${CMAKE_CURRENT_BINARY_DIR}/ngm-debug" DESTINATION "${EXECUTABLE_OUTPUT_PATH}" FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ NO_SOURCE_PERMISSIONS)
file(COPY "${CMAKE_CURRENT_BINARY_DIR}/ngm" DESTINATION "${EXECUTABLE_OUTPUT_PATH}" FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ NO_SOURCE_PERMISSIONS)
file(COPY "${CMAKE_CURRENT_BINARY_DIR}/ngm-log" DESTINATION "${EXECUTABLE_OUTPUT_PATH}" FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ NO_SOURCE_PERMISSIONS)