Skip to content

Commit

Permalink
Install the kernel spec in CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Aug 25, 2020
1 parent 2e7bcbe commit 5002a09
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(LFORTRAN_CXX_NO_RTTI_FLAG "/GR-")
endif ()


# For CMAKE_INSTALL_BINDIR:
include(GNUInstallDirs)


# Build a CPack driven installer package
#
# To build a binary package:
Expand Down Expand Up @@ -101,6 +106,21 @@ set(WITH_XEUS no CACHE BOOL "Build with XEUS support")
if (WITH_XEUS)
find_package(xeus 0.24.1 REQUIRED)
set(HAVE_LFORTRAN_XEUS yes)

# Generate kernel.json with correct paths
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/share/jupyter/kernels/fortran/kernel.json.in"
"${CMAKE_CURRENT_BINARY_DIR}/share/jupyter/kernels/fortran/kernel.json"
)

# Configuration and data directories for Jupyter and LFortran
set(XJUPYTER_DATA_DIR "share/jupyter" CACHE STRING "Jupyter data directory")

# Install Jupyter kernelspecs
set(XEUS_CALCSPEC_DIR ${CMAKE_CURRENT_BINARY_DIR}/share/jupyter/kernels)
install(DIRECTORY ${XEUS_CALCSPEC_DIR}
DESTINATION ${XJUPYTER_DATA_DIR}
PATTERN "*.in" EXCLUDE)
endif()

# JSON
Expand Down

0 comments on commit 5002a09

Please sign in to comment.