Skip to content

Commit bc9af92

Browse files
author
Kasper Peeters
committed
Remove Python2 support, enforce C++-17.
1 parent 5578c99 commit bc9af92

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

CMakeLists.txt

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
2-
set(CADABRA_CMAKE_VERSION 3.11)
2+
set(CADABRA_CMAKE_VERSION 3.12)
33

44
# Policy settings for CMake to resolve ambiguities.
55

@@ -14,12 +14,7 @@ if(POLICY CMP0127)
1414
endif()
1515

1616
cmake_minimum_required(VERSION ${CADABRA_CMAKE_VERSION})
17-
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
18-
set(CMAKE_CXX_STANDARD 14)
19-
message(STATUS "Using C++14 as you are using CMake < 3.8; consider upgrading as future versions of Cadabra may use C++17 features")
20-
else()
21-
set(CMAKE_CXX_STANDARD 17)
22-
endif()
17+
set(CMAKE_CXX_STANDARD 17)
2318
project(Cadabra)
2419

2520
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@@ -115,9 +110,6 @@ include(cmake/packaging.cmake)
115110
#
116111
option(MSVC_TARGET_CONSOLE "Force Release book on MSVC to display a console window" OFF)
117112

118-
# Provide option to build with Python 3 (default) or Python 2.
119-
option(USE_PYTHON_3 "Use Python 3 if ON, or fall back to Python 2 if OFF" ON)
120-
121113
option(APPIMAGE_MODE "Run in AppImage mode, overriding path settings" OFF)
122114
if(APPIMAGE_MODE)
123115
message(STATUS "Building for AppImage packaging (Debian paths, MicroTeX)")
@@ -285,15 +277,10 @@ print_header("Configuring Python")
285277
# NEEDED TO USE CMAKE_INSTALL_FULL<dir>
286278
include(GNUInstallDirs)
287279

288-
if(USE_PYTHON_3)
289-
set(PYTHON_POSTFIX "3")
290-
message(STATUS "Building for use with Python 3 (good!)")
291-
else()
292-
set(PYTHON_POSTFIX "")
293-
message(STATUS "Building for use with Python 2 (consider upgrading!)")
294-
endif()
280+
set(PYTHON_POSTFIX "3")
281+
# message(STATUS "Building for use with Python 3 (good!)")
295282

296-
# set(PYBIND11_FINDPYTHON ON)
283+
find_package(Python COMPONENTS Interpreter Development)
297284
add_subdirectory(libs/pybind11)
298285

299286
message(STATUS "Found python ${PYTHON_LIBRARIES}")

0 commit comments

Comments
 (0)