forked from snugel/cas-offinder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (49 loc) · 1.67 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
cmake_minimum_required (VERSION 2.6)
project (CAS-OFFinder)
set (CAS-OFFinder_VERSION_MAJOR 3)
set (CAS-OFFinder_VERSION_MINOR 0)
set(CMAKE_BUILD_TYPE Release)
include (CheckIncludeFiles)
check_include_files (dirent.h HAVE_DIRENT_H)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules")
if (APPLE)
find_library(OPENCL_LIBRARY OpenCL)
else (APPLE)
find_package (OpenCL REQUIRED)
include_directories ("${OPENCL_INCLUDE_DIR}")
endif (APPLE)
include_directories ("${PROJECT_SOURCE_DIR}")
if (NOT HAVE_DIRENT_H)
message ("Could not find dirent.h on your system.")
message ("For workaround, using a custom dirent.h written for MS system (by Toni Ronkko).")
message ("More information, visit http://softagalleria.net/dirent.php")
include_directories ("${PROJECT_SOURCE_DIR}/ext")
endif (NOT HAVE_DIRENT_H)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif(OPENMP_FOUND)
configure_file (
"${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_SOURCE_DIR}/config.h"
)
execute_process(COMMAND ${CMAKE_COMMAND} "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" -P "${CMAKE_MODULE_PATH}/CopyKernels.cmake")
set (SOURCES
main.cpp
cas-offinder.cpp
read_fasta.cpp
read_twobit.cpp
cas-offinder.cl
)
set (HEADERS
config.h
cas-offinder.h
read_fasta.h
read_twobit.h
oclfunctions.h
oclkernels.h
)
add_executable(cas-offinder ${SOURCES} ${HEADERS})
target_link_libraries(cas-offinder ${OPENCL_LIBRARY})
add_custom_command(TARGET cas-offinder PRE_BUILD COMMAND ${CMAKE_COMMAND} "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" -P "${CMAKE_MODULE_PATH}/CopyKernels.cmake")