-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
30 lines (23 loc) · 889 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
cmake_minimum_required(VERSION 3.10)
# Set some basic project attributes
project(Simple_SCT_Simulator
VERSION 0.1
DESCRIPTION "A Simple SCT Simulator Project")
# Option switches for profiling and debug
option(ENABLE_PROFILING "Enable profiling for the build" OFF)
option(ENABLE_DEBUG "Enable debug symbols for the build" OFF)
# This project will output an executable file
add_executable(${PROJECT_NAME} Simple_SCT_Simulator.cpp)
# Create a simple configuration header
configure_file(config.h.in config.h)
# Include the configuration header in the build
target_include_directories(${PROJECT_NAME} PUBLIC "${PROJECT_BINARY_DIR}")
# Profiling with GProf
if(ENABLE_PROFILING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
endif()
# Debugging with Perf or Callgrind
if(ENABLE_DEBUG)
set(CMAKE_BUILD_TYPE Debug)
endif()