-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
36 lines (28 loc) · 1.11 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
cmake_minimum_required(VERSION 3.14)
project(hw2_1)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
find_package(OpenMP REQUIRED)
# Group number
set(GROUP_NAME "None" CACHE STRING "Your group name as it appears on bCourses (no spaces)")
# Packaging system
if (NOT ${GROUP_NAME} STREQUAL None)
set(CPACK_GENERATOR TGZ)
set(CPACK_PACKAGE_FILE_NAME "cs267${GROUP_NAME}_hw2_1")
install(FILES serial.cpp openmp.cpp DESTINATION .)
install(FILES ${CPACK_PACKAGE_FILE_NAME}.pdf DESTINATION .)
include(CPack)
endif ()
# We require the GNU compiler for this assignment.
if (NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
set(Prg-Clang "PrgEnv-cray")
message(WARNING
"Must use GNU Compiler for submission. Make sure you ran:\n"
"module swap ${Prg-${CMAKE_C_COMPILER_ID}} PrgEnv-gnu")
endif ()
add_executable(serial main.cpp serial.cpp common.h)
add_executable(openmp main.cpp openmp.cpp common.h)
target_link_libraries(openmp PRIVATE OpenMP::OpenMP_CXX)
# Copy the job scripts
configure_file(job-serial job-serial COPYONLY)
configure_file(job-openmp job-openmp COPYONLY)