-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
23 lines (23 loc) · 1.01 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
#Set the minimum cmake version required
cmake_minimum_required(VERSION 3.5)
project(NBody)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_COMPILER "g++")
set(ARMA_DIR "${CMAKE_BINARY_DIR}/var/")
set(SOURCE_FILES src/main.cpp src/Hyperphysics.cpp src/Hyperphysics.h "${ARMA_DIR}/include/armadillo")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
FIND_PACKAGE( OpenMP REQUIRED)
if(OPENMP_FOUND)
message("OPENMP FOUND")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -O3")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
add_definitions(-DAMRA_DONT_USE_WRAPPER)
include_directories("${ARMA_DIR}/include/armadillo_bits")
include_directories("${ARMA_DIR}/include")
add_executable(NBody ${SOURCE_FILES} "${ARMA_DIR}/include/armadillo")
target_link_libraries(NBody nvblas)
target_link_libraries(NBody "${ARMA_DIR}/lib/libarmadillo.so")
target_link_libraries(NBody blas)
target_link_libraries(NBody lapack)