From 1c1de07b426dc5882473ef7e481e89b97d95eb62 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Fri, 25 Jun 2021 18:39:36 +0200
Subject: [PATCH] Add profile build type

---
 CMakeLists.txt                     | 1 +
 cmake/ConfigureCompilerFlags.cmake | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 49dae780..a00365bb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,6 @@
 cmake_minimum_required(VERSION 3.18)
 project(Detection_eddies LANGUAGES Fortran)
+set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release Profile)
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
 find_package(NR_util REQUIRED CONFIG)
 find_package(Jumble REQUIRED CONFIG)
diff --git a/cmake/ConfigureCompilerFlags.cmake b/cmake/ConfigureCompilerFlags.cmake
index 5a3bc2cc..31a9a16b 100644
--- a/cmake/ConfigureCompilerFlags.cmake
+++ b/cmake/ConfigureCompilerFlags.cmake
@@ -75,3 +75,6 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES NAG)
   #  without that option, and is not compatible with calling C code
   #  via a BIND(C) interface.
 endif()
+
+set(CMAKE_Fortran_FLAGS_PROFILE "-p -g -O2")
+set(CMAKE_EXE_LINKER_FLAGS_PROFILE "-p -g -O2")
-- 
GitLab