-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
34 lines (29 loc) · 922 Bytes
/
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
cmake_minimum_required (VERSION 2.6)
project (IsingMonteCarlo)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra -Wpedantic")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_program(
CLANG_TIDY_EXE
NAMES "clang-tidy"
DOC "Path to clang-tidy executable"
)
if (NOT CLANG_TIDY_EXE)
message(STATUS "clang-tidy not found")
else()
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=modernize-*,cppcoreguidelines-*,readability-*,misc-*,bugprone-*,performance-*")
endif()
include_directories("${PROJECT_SOURCE_DIR}/include")
file(GLOB SOURCES "src/*.cpp")
add_executable(IsingMonteCarlo ${SOURCES})
set_target_properties(IsingMonteCarlo PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
if (CLANG_TIDY_EXE)
set_target_properties(
IsingMonteCarlo PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()