forked from audiofilter/openBliSSART
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (53 loc) · 2.3 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.20)
#cmake_policy(SET CMP0042 NEW)
# set the project name and version
project(openBliSSART VERSION 1.0)
configure_file(openBliSSARTconfig.h.in openBliSSARTconfig.h)
# specify the C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
#SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg -Wuninitialized -Wall -Wpedantic -fstack-protector")
#SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weffc++ -pg -Wuninitialized -Werror -Wall -Wextra -Wpedantic -fstack-protector")
#print_trace()
#SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-pie -ggdb3 -O3 -no-pie -rdynamic -pedantic-errors")
#Backtrace()
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg -g -fpic -export-dynamic")
#set(CMAKE_CXX_CPPCHECK "cppcheck")
find_program(CMAKE_CXX_CPPCHECK NAMES cppcheck)
if (CMAKE_CXX_CPPCHECK)
list(
APPEND CMAKE_CXX_CPPCHECK
"--enable=warning"
"--inconclusive"
"--force"
"--inline-suppr"
# "--suppressions-list=${CMAKE_SOURCE_DIR}/CppCheckSuppressions.txt"
)
endif()
# Option to Enable NO_CUDA
option( NO_CUDA "Enable NO_CUDA" OFF )
# The lines below will generate the config.h based on the options above
# The file will be in the ${CMAKE_BINARY_DIR} location
set(CONFIG_H ${CMAKE_BINARY_DIR}/config.h)
string(TIMESTAMP CURRENT_TIMESTAMP)
file(WRITE ${CONFIG_H} "/* WARNING: This file is auto-generated by CMake on ${CURRENT_TIMESTAMP}. DO NOT EDIT!!! */\n\n")
if( NO_CUDA )
message(" NO_CUDA Enabled")
file(APPEND ${CONFIG_H} "/* Enable NO_CUDA */\n")
file(APPEND ${CONFIG_H} "#define [HAVE_CUDA] \n\n")
endif( NO_CUDA )
#findCUDA()
find_package(CUDAToolkit 11.6 REQUIRED)
#find_package(CUDA 11.6 REQUIRED)
message(STATUS "Found CUDA ${CUDA_VERSION_STRING} at ${CUDA_TOOLKIT_ROOT_DIR}")
#cmake -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-5.5 ..
#findSDL2()
## !!! WARNING These are the defines that were defined regardless of an option.
## !!! Or the script couldn't match them. Match them accordingly, delete them or keep them
# Setting the include directory for the application to find config.h
include_directories( ${CMAKE_BINARY_DIR} )
#list(APPEND CMAKE_PREFIX_PATH "~/Qt/6.3.0/gcc_64")
# Since we have created a config.h add a global define for it
add_definitions( "-DHAVE_CONFIG_H" )
add_subdirectory( src )
add_subdirectory( doc )