File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 33#######################################################
44# Project information
55cmake_minimum_required (VERSION 3.15)
6+ include (cmake/functions/ensure_build_type.cmake)
67project (Matplot++ VERSION 1.2.0)
78set (MATPLOT_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
89set (MATPLOT_VERSION ${CMAKE_PROJECT_VERSION} )
Original file line number Diff line number Diff line change 1+ #
2+ # Copyright (c) 2023 Alan de Freitas (alandefreitas@gmail.com)
3+ #
4+ # Distributed under the Boost Software License, Version 1.0.
5+ # See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt
6+ #
7+ # Official repository: https://github.com/alandefreitas/futures
8+ #
9+
10+ if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
11+ return ()
12+ endif ()
13+
14+ # Set a default build type if none was specified
15+ set (default_build_type "Release" )
16+ if (EXISTS "${CMAKE_SOURCE_DIR} /.git" )
17+ set (default_build_type "Debug" )
18+ endif ()
19+
20+ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
21+ message (STATUS "Setting build type to '${default_build_type} ' as none was specified." )
22+ get_property (IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
23+ if (NOT IS_MULTICONFIG)
24+ set (CMAKE_BUILD_TYPE "${default_build_type} " CACHE STRING "Choose the type of build." FORCE)
25+ set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" )
26+ else ()
27+ set (CMAKE_CONFIGURATION_TYPES "${default_build_type} " CACHE STRING "Choose the type of build." FORCE)
28+ endif ()
29+ endif ()
30+
31+
32+ if (NOT gen_multi AND NOT (CMAKE_BUILD_TYPE OR DEFINED ENV{CMAKE_BUILD_TYPE }))
33+ set (CMAKE_BUILD_TYPE Release CACHE STRING "Release can have faster run time than Debug" )
34+ endif ()
You can’t perform that action at this time.
0 commit comments