Skip to content

Commit

Permalink
BUG: let ITK initialize C++ standard and build type
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rit committed Aug 31, 2021
1 parent 4c2621c commit a21ff58
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,6 @@ foreach(p ${CMAKE_POLICIES})
endif()
endforeach()

## Set the default target properties for RTK
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11) # Supported values are ``11``, ``14``, and ``17``.
endif()
if(NOT CMAKE_CXX_STANDARD_REQUIRED)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
if(NOT CMAKE_CXX_EXTENSIONS)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()

#=========================================================
# Help function to debug CMake
macro (DD in)
Expand All @@ -47,11 +36,6 @@ set(RTK_VERSION_STRING "${RTK_VERSION_MAJOR}.${RTK_VERSION_MINOR}")

set(RTK_LIBRARIES RTK)

## Default to release
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif ()

#=========================================================
# Installation variables
#=========================================================
Expand Down Expand Up @@ -233,6 +217,24 @@ if(NOT ITK_SOURCE_DIR)
# This must be done after RTK has been loaded by ITK to make sure
# ${itk-module} variables are defined for RTK.
itk_module_target_export(lpsolve55)

if(${ITK_VERSION} VERSION_LESS 5.3)
## Set the default target properties for RTK
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14) # Supported values are ``11``, ``14``, and ``17``.
endif()
if(NOT CMAKE_CXX_STANDARD_REQUIRED)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
if(NOT CMAKE_CXX_EXTENSIONS)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()

## Default to release
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
endif()
else()
itk_module_impl()
endif()
Expand Down

0 comments on commit a21ff58

Please sign in to comment.