-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
50 lines (40 loc) · 1.6 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
cmake_minimum_required(VERSION 2.8)
option(WITH_WARNINGS "Compile with warnings" ON)
option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
project(OpenCL_EX C)
# Set the build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
# The OpenCL_EX version number.
set(OpenCL_EX_VERSION_MAJOR 0)
set(OpenCL_EX_VERSION_MINOR 0)
set(OpenCL_EX_VERSION_PATCH 0)
set(OpenCL_EX_VERSION "${OpenCL_EX_VERSION_MAJOR}.${OpenCL_EX_VERSION_MINOR}")
set(OpenCL_EX_VERSION_FULL "${OpenCL_EX_VERSION}.${OpenCL_EX_VERSION_PATCH}")
# Directory where customize cmake files reside
set(CMAKE_MODULE_PATH
${OpenCL_EX_SOURCE_DIR}/CMake/Modules ${CMAKE_MODULE_PATH}
)
find_package(OpenCL)
if(OPENCL_FOUND)
set(HAVE_OPENCL ON)
include_directories(${OPENCL_INCLUDE_DIRS})
endif(OPENCL_FOUND)
include_directories(${OpenCL_EX_SOURCE_DIR}/src)
include_directories(${OpenCL_EX_BINARY_DIR}/src)
if(WITH_WARNINGS)
# enable compiler warning flags
if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -pedantic -Wall -Wextra -Wundef -Wshadow -Wno-unused-parameter")
endif("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
if("${CMAKE_C_COMPILER_ID}" MATCHES "Intel")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -w2 -Wcheck")
endif("${CMAKE_C_COMPILER_ID}" MATCHES "Intel")
if ("${CMAKE_C_COMPILER_ID}" MATCHES "PGI")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Minform=inform")
endif("${CMAKE_C_COMPILER_ID}" MATCHES "PGI")
endif(WITH_WARNINGS)
subdirs(src)