-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (48 loc) · 1.71 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
cmake_minimum_required(VERSION 3.5)
cmake_policy(SET CMP0045 NEW)
project(ctas)
set(VERSION 0.7.0)
set(CMAKE_MODULE_PATH ${ctas_SOURCE_DIR}/cmake)
set(CMAKE_C_STANDARD "17")
set(CMAKE_CXX_STANDARD "17")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffast-math -pthread")
set(CMAKE_CXX_FLAGS "$ENV{CPPFLAGS} ${CMAKE_CXX_FLAGS} -ffast-math -pthread")
# uninstall target
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
# dist target
if(NOT TARGET dist)
add_custom_target(dist
COMMAND git archive --prefix=${PROJECT_NAME}.${VERSION}/ HEAD | bzip2 >
${CMAKE_BINARY_DIR}/${PROJECT_NAME}.${VERSION}.tar.bz2
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif()
include(CheckIncludeFile)
include(CheckLibraryExists)
set(LIBEXEC_DESTINATION "libexec/${PROJECT_NAME}")
set(LIB_DESTINATION "lib/${PROJECT_NAME}")
set(INC_DESTINATION "include/${PROJECT_NAME}")
set(MAN_DESTINATION "man/man1")
add_custom_target(doc)
# Doxygen documentation
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(
doxygen
COMMAND
echo
" -- Running doxygen. Output will be redirected to \"\\\"${CMAKE_CURRENT_BINARY_DIR}/doxygen.log\\\"\"."
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile &> doxygen.log)
endif()
# Just a workaroun to show cl files in Qt creator
file(GLOB_RECURSE OpenCLfiles "*.cl")
add_custom_target(OpenCLsource SOURCES ${OpenCLfiles})
add_subdirectory(src)