forked from smferdous1/Picasso
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
70 lines (57 loc) · 1.67 KB
/
CMakeLists.txt
File metadata and controls
70 lines (57 loc) · 1.67 KB
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
cmake_minimum_required(VERSION 3.1.0...3.31.6)
if(NOT CMAKE_CXX_COMPILER)
if(APPLE)
set(CMAKE_CXX_COMPILER "g++-12")
elseif(UNIX)
set(CMAKE_CXX_COMPILER "g++")
endif()
endif()
project( CliqePart VERSION 0.1.0
DESCRIPTION "Cliqe Partition for quantum chemistry"
LANGUAGES C CXX
)
if(${CMAKE_VERSION} VERSION_LESS "3.11")
# If CUDA detected, set ENABLE_CUDA flag
find_package(CUDA)
if(CUDA_FOUND)
set(ENABLE_CUDA ON)
# Print CUDA found
message(STATUS "CUDA found, enabling CUDA compilation")
else()
set(ENABLE_CUDA OFF)
message(STATUS "CUDA not found, disabling CUDA compilation")
endif()
else()
include(CheckLanguage)
check_language(CUDA)
if(CMAKE_CUDA_COMPILER)
set(ENABLE_CUDA ON)
# Print CUDA found
message(STATUS "CUDA found, enabling CUDA compilation")
else()
set(ENABLE_CUDA OFF)
message(STATUS "CUDA not found, disabling CUDA compilation")
endif()
endif()
# If CUDA enabled, add as language
if(ENABLE_CUDA)
enable_language(CUDA)
set(CMAKE_CUDA_ARCHITECTURES 80)
include_directories("${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}")
endif()
include(CTest)
enable_testing()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#
# Prevent building in the source directory
#
if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.\n")
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
#find_package(ColPack REQUIRED)
find_package(OpenMP REQUIRED)
# The executable code is here
add_subdirectory(apps)
# The compiled library code is here
add_subdirectory(src)