File tree Expand file tree Collapse file tree 10 files changed +616
-27
lines changed
libs/internal/include/internal Expand file tree Collapse file tree 10 files changed +616
-27
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,12 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0)
22set (CADABRA_CMAKE_VERSION 3.1)
33
44cmake_minimum_required (VERSION ${CADABRA_CMAKE_VERSION} )
5- set (CMAKE_CXX_STANDARD 14)
5+ if (${CMAKE_VERSION} VERSION_LESS "3.8.0" )
6+ set (CMAKE_CXX_STANDARD 14)
7+ message (STATUS "Using C++14 as you are using CMake < 3.8; consider upgrading as future versions of Cadabra may use C++17 features" )
8+ else ()
9+ set (CMAKE_CXX_STANDARD 17)
10+ endif ()
611project (Cadabra)
712
813if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
@@ -146,6 +151,8 @@ endif()
146151# - Turn optimizations on
147152# - Turn off warnings we don't need
148153
154+
155+
149156# GCC
150157if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
151158 if (ENABLE_FRONTEND)
Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 2.8)
2- set (CMAKE_CXX_STANDARD 14)
2+
3+ if (${CMAKE_VERSION} VERSION_LESS "3.8.0" )
4+ set (CMAKE_CXX_STANDARD 14)
5+ message (STATUS "Using C++14 as you are using CMkake < 3.8, consider upgrading as future versions of Cadabra may make use of C++17 features" )
6+ else ()
7+ set (CMAKE_CXX_STANDARD 17)
8+ endif ()
9+
310project (Cadabra)
411
512#---------------------------------------------------------------------------
@@ -42,11 +49,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
4249endif ()
4350
4451if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
45- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 - O2" )
52+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2" )
4653endif ()
4754
4855if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "Clang" )
49- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 - O2" )
56+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2" )
5057endif ()
5158
5259if (MSVC )
Original file line number Diff line number Diff line change @@ -11,11 +11,14 @@ endif()
1111if (NOT VCPKG_TOOLCHAIN)
1212 find_file (CMAKE_TOOLCHAIN_FILE vcpkg.cmake HINTS $ENV{userprofile} $ENV{systemdrive} PATH_SUFFIXES vcpkg/scripts/buildsystems)
1313 if (CMAKE_TOOLCHAIN_FILE)
14- include (${CMAKE_TOOLCHAIN_FILE} )
14+ include (${CMAKE_TOOLCHAIN_FILE} )
1515 endif ()
1616endif ()
1717if (VCPKG_TOOLCHAIN)
18- message (STATUS "Found vcpkg at ${_VCPKG_ROOT_DIR} " )
18+ if (NOT _VCPKG_ROOT_DIR)
19+ set (_VCPKG_ROOT_DIR ${Z_VCPKG_ROOT_DIR} )
20+ endif ()
21+ message (STATUS "Found vcpkg at ${Z_VCPKG_ROOT_DIR} " )
1922else ()
2023 message (FATAL_ERROR "Could not find vcpkg (required for building on Visual Studio)" )
2124endif ()
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ find_package(GLIBMM REQUIRED)
4141# GMPXX
4242find_package (GMPXX REQUIRED)
4343
44+ # Dependency of TinyProcessLib
45+ find_package (Threads)
46+
4447#---------------------------------------------------------------------------
4548# Enumerate input files and directories.
4649#---------------------------------------------------------------------------
@@ -310,6 +313,19 @@ target_compile_definitions(cadabra2-cli PRIVATE CDBPYTHON_NO_NOTEBOOK)
310313target_include_directories (cadabra2-cli PRIVATE ${PYTHON_INCLUDE_DIRS} )
311314target_link_libraries (cadabra2-cli PRIVATE ${PYTHON_LIBRARIES} ${GLIBMM3_LIBRARIES} )
312315
316+ # Notebook diff tool
317+ add_executable (cdb-nbtool
318+ cdb-nbtool.cc
319+ ${CADABRA_LIBS_DIR} /tiny-process-library/process.cpp
320+ )
321+ if (MSVC )
322+ target_sources (cdb-nbtool PRIVATE ${CADABRA_LIBS_DIR} /tiny-process-library/process_win.cpp)
323+ else ()
324+ target_sources (cdb-nbtool PRIVATE ${CADABRA_LIBS_DIR} /tiny-process-library/process_unix.cpp)
325+ target_link_libraries (cdb-nbtool PRIVATE Threads::Threads)
326+ endif ()
327+ target_include_directories (cdb-nbtool PRIVATE ${CADABRA_LIBS_DIR} /tiny-process-library)
328+
313329# Test preprocessor executable
314330add_executable (test_preprocessor
315331 test_preprocessor.cc
@@ -416,6 +432,7 @@ else()
416432endif ()
417433
418434install (TARGETS cadabra2-cli DESTINATION bin)
435+ install (TARGETS cdb-nbtool DESTINATION bin)
419436
420437install (
421438 FILES
Original file line number Diff line number Diff line change @@ -180,6 +180,8 @@ def save_history(history_path):
180180
181181try:
182182 import readline
183+ if not hasattr(readline, 'redisplay'):
184+ readline.redisplay = lambda: None
183185 history_path = os.path.join(user_data_dir(), "cadabra_history")
184186 if os.path.exists(history_path):
185187 readline.read_history_file(history_path)
You can’t perform that action at this time.
0 commit comments