Skip to content

Commit 982e314

Browse files
dominicpriceDominic Price
authored andcommitted
Add cdb-nbtool with miscellaneous command line tools for notebook files
1 parent 51bfda6 commit 982e314

File tree

3 files changed

+537
-0
lines changed

3 files changed

+537
-0
lines changed

core/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ find_package(GLIBMM REQUIRED)
4141
# GMPXX
4242
find_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)
310313
target_include_directories(cadabra2-cli PRIVATE ${PYTHON_INCLUDE_DIRS})
311314
target_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
314330
add_executable(test_preprocessor
315331
test_preprocessor.cc
@@ -416,6 +432,7 @@ else()
416432
endif()
417433

418434
install(TARGETS cadabra2-cli DESTINATION bin)
435+
install(TARGETS cdb-nbtool DESTINATION bin)
419436

420437
install(
421438
FILES

0 commit comments

Comments
 (0)