Skip to content

Commit 8f2fd1a

Browse files
committed
COMP: Use modern project() invocations.
1 parent 39204bb commit 8f2fd1a

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

CMakeLists.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
cmake_minimum_required(VERSION 3.16.3)
1+
cmake_minimum_required(VERSION 3.22.1)
22

3+
# Need to set CMAKE_CXX_STANDARD, CMAKE_CXX_STANDARD_REQUIRED, CMAKE_CXX_EXTENSIONS
4+
# before calling project to ensure that it is available globally within your CMake project.
35
if(NOT CMAKE_CXX_STANDARD)
4-
set(CMAKE_CXX_STANDARD 14) # Supported values are ``14``, ``17`` and ``20``.
6+
set(CMAKE_CXX_STANDARD 17) # Supported values are ``14``, ``17`` and ``20``.
57
endif()
68
if(NOT CMAKE_CXX_STANDARD_REQUIRED)
79
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -10,9 +12,14 @@ if(NOT CMAKE_CXX_EXTENSIONS)
1012
set(CMAKE_CXX_EXTENSIONS OFF)
1113
endif()
1214

13-
## If building external to ITK, we need to capture
14-
## required build setting from ITK prior to calling
15-
## project()
15+
16+
project(PerformanceBenchmarking
17+
VERSION 0.9.0
18+
DESCRIPTION
19+
"Real-world tests to benchmark ITK performance."
20+
HOMEPAGE_URL "https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking"
21+
LANGUAGES CXX C
22+
)
1623
if(NOT ITK_SOURCE_DIR)
1724
find_package(ITK REQUIRED)
1825
list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
@@ -27,20 +34,14 @@ if(NOT ITK_SOURCE_DIR)
2734
endif()
2835
endforeach()
2936

30-
3137
# Set a default build type if none was specified
3238
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
3339
message(STATUS "Setting build type to 'Release' as none was specified.")
3440
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
3541
# Set the possible values of build type for cmake-gui
3642
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
3743
endif()
38-
enable_language(C)
39-
enable_language(CXX)
4044
endif()
41-
42-
project(PerformanceBenchmarking)
43-
4445
set(PerformanceBenchmarking_LIBRARIES PerformanceBenchmarking)
4546

4647
include_directories(${CMAKE_BINARY_DIR})

0 commit comments

Comments
 (0)