This repository was archived by the owner on Aug 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
77 lines (62 loc) · 1.92 KB
/
CMakeLists.txt
File metadata and controls
77 lines (62 loc) · 1.92 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
70
71
72
73
74
75
76
77
# -*- Mode: cmake -*-
cmake_minimum_required( VERSION 3.8 )
project( ChASE LANGUAGES C CXX )
# FIND_PACKAGE(OpenMP REQUIRED)
# if (OPENMP_FOUND)
# set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
# set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
# endif()
# ## algorithm ##
add_library(chase_algorithm INTERFACE)
target_include_directories( chase_algorithm INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>"
$<INSTALL_INTERFACE:include/> # <prefix>/include/mylib
)
target_compile_features(chase_algorithm INTERFACE cxx_auto_type)
option( CHASE_OUTPUT "ChASE will provide output at each iteration")
if( CHASE_OUTPUT )
target_compile_definitions( chase_algorithm INTERFACE "-DCHASE_OUTPUT" )
endif()
install( TARGETS chase_algorithm
EXPORT chase-headers
LIBRARY DESTINATION lib
INCLUDES DESTINATION include
ARCHIVE DESTINATION lib
)
install(DIRECTORY algorithm DESTINATION include/algorithm
FILES_MATCHING
PATTERN "*.hpp"
PATTERN "*.inc"
)
install(EXPORT chase-headers
NAMESPACE ChASE::
FILE chase-header.cmake
EXPORT_LINK_INTERFACE_LIBRARIES
DESTINATION share
)
# ## ChASE-MPI ##
add_subdirectory( "ChASE-MPI/")
add_subdirectory( "ChASE-Elemental/")
# Driver
add_executable( "chase_driver" driver/noinput.cpp )
target_link_libraries(chase_driver chase_mpi)
# Simple Driver
option(BUILD_SIMPLEDRIVER "Build Simple Driver" OFF)
if(BUILD_SIMPLEDRIVER)
message(STATUS "Building Simple Driver")
add_subdirectory("./simple_driver")
endif()
enable_testing()
add_test( BASIC "chase_driver" )
# Install ChASE as a CMake package
include(CMakePackageConfigHelpers)
configure_package_config_file(
"cmake/Config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/chase-config.cmake"
INSTALL_DESTINATION share
)
install( FILES
"${CMAKE_CURRENT_BINARY_DIR}/chase-config.cmake"
DESTINATION share
)