-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
99 lines (75 loc) · 2.56 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
cmake_minimum_required(VERSION 2.8)
set(CMAKE_C_COMPILER /usr/bin/gcc)
include(CheckFunctionExists)
# TODO: add appropriate label for OpenMP here.
# find_package(OpenMP)
function(add_mpi_executable exe_name src_name)
add_executable(${exe_name} ${src_name})
target_link_libraries(${exe_name} ${MPI_C_LIBRARIES})
endfunction()
#add_mpi_executable(dotProd dotProd.c)
#add_rose_translator(identityTranslator identityTranslator.C)
#add_rose_translator(myTranslator myTranslator.C)
add_rose_translator(uSchedTrans uSchedTrans.C)
install(TARGETS uSchedTrans DESTINATION bin)
install(TARGETS slackconscious DESTINATION lib)
include_directories(
${PROJECT_BINARY_DIR}
${MPI_INCLUDE_PATH}
${MPI_C_INCLUDE_PATH}
${ROSE_INCLUDE_PATH}
${adept_utils_INCLUDE_DIR}
${SLACKCONSCIOUS_INCLUDE_PATH}
)
# Detect C++ standard and add appropriate flag _before_ loading BLT
set(COMPILERS_KNOWN_TO_CMAKE33 AppleClang Clang GNU MSVC)
include(CheckCXXCompilerFlag)
if(RAJA_CXX_STANDARD_FLAG MATCHES default)
if("cxx_std_17" IN_LIST CMAKE_CXX_KNOWN_FEATURES)
#TODO set BLT_CXX_STANDARD
set(CMAKE_CXX_STANDARD 17)
elseif("cxx_std_14" IN_LIST CMAKE_CXX_KNOWN_FEATURES)
set(CMAKE_CXX_STANDARD 14)
elseif("${CMAKE_CXX_COMPILER_ID}" IN_LIST COMPILERS_KNOWN_TO_CMAKE33)
set(CMAKE_CXX_STANDARD 14)
else() #cmake has no idea what to do, do it ourselves...
foreach(flag_var "-std=c++17" "-std=c++1z" "-std=c++14" "-std=c++1y" "-std=c++11")
CHECK_CXX_COMPILER_FLAG(${flag_var} COMPILER_SUPPORTS_${flag_var})
if(COMPILER_SUPPORTS_${flag_var})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag_var}")
break()
endif()
endforeach(flag_var)
endif()
else(RAJA_CXX_STANDARD_FLAG MATCHES default)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RAJA_CXX_STANDARD_FLAG}")
message("Using C++ standard flag: ${RAJA_CXX_STANDARD_FLAG}")
endif(RAJA_CXX_STANDARD_FLAG MATCHES default)
set(CMAKE_CXX_EXTENSIONS OFF)
# Setup basic CMake options
include(cmake/SetupBasics.cmake)
# Find third-party packages
include(cmake/SetupPackages.cmake)
# Setup vendor-specific compiler flags
include(cmake/SetupCompilers.cmake)
if (ENABLE_OPENMP)
endif()
install(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN *.hpp)
if(ENABLE_TESTS)
add_subdirectory(test)
endif()
if(ENABLE_REPRODUCERS)
add_subdirectory(reproducers)
endif()
if(ENABLE_EXAMPLES)
add_subdirectory(examples)
endif()
if(ENABLE_EXERCISES)
add_subdirectory(exercises)
endif()
if (ENABLE_DOCUMENTATION)
add_subdirectory(docs)
endif ()
if (ENABLE_BENCHMARKS)
add_subdirectory(benchmark)
endif ()