-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
71 lines (57 loc) · 1.92 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
cmake_minimum_required(VERSION 2.8)
project(Executor)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -pthread")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
include_directories(common)
include_directories(include)
find_package(OpenCL)
find_package(Boost REQUIRED COMPONENTS program_options)
# Enable ExternalProject CMake module
include(ExternalProject)
# Download and install GoogleTest
ExternalProject_Add(
gtest
URL https://github.com/google/googletest/archive/release-1.7.0.zip
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gtest
# Disable install step
INSTALL_COMMAND ""
)
# Create a libgtest target to be used as a dependency by test programs
add_library(libgtest IMPORTED STATIC GLOBAL)
add_dependencies(libgtest gtest)
# Set gtest properties
ExternalProject_Get_Property(gtest source_dir binary_dir)
set_target_properties(libgtest PROPERTIES
"IMPORTED_LOCATION" "${binary_dir}/libgtest.a"
"IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}"
# "INTERFACE_INCLUDE_DIRECTORIES" "${source_dir}/include"
)
# I couldn't make it work with INTERFACE_INCLUDE_DIRECTORIES
include_directories("${source_dir}/include")
set(SOURCE_FILES
src/run.cpp
src/file_utils.cpp
src/csv_utils.cpp
src/opencl_utils.cpp)
add_library (Executor ${SOURCE_FILES})
function(add_app name)
add_executable(harness_${name} apps/${name}.cpp)
target_link_libraries(harness_${name} Executor pthread ${OpenCL_LIBRARIES} ${Boost_LIBRARIES})
endfunction()
include_directories(apps)
add_executable(convert_to_binary apps/convert_to_binary.cpp)
target_link_libraries(convert_to_binary Executor)
add_app(generic)
add_app(stencil)
add_app(hotspot)
add_app(hotspot3D)
add_app(stencilNoPad)
add_app(convolution)
add_app(convolution2D)
add_app(shocStencil2D)
add_app(convolutionSeparableY)
add_app(srad1)
add_app(srad2)
add_app(acoustic3D)
enable_testing()
add_subdirectory(test)