# The ordinary build does not require Pandoc; generate the manual on installation. set(CPSC_LOCAL_BIN_DIRS "@CPSC_LOCAL_BIN_DIRS@") include("@CPSC_DEPS_MODULE_DIR@/FindDependency.cmake") execute_process( COMMAND "@CMAKE_COMMAND@" --build "@CMAKE_CURRENT_BINARY_DIR@" --target doc RESULT_VARIABLE cpsc_doc_result ) if(NOT cpsc_doc_result STREQUAL "0") message(FATAL_ERROR "Cannot build the manual; Pandoc must be available locally or in PATH") endif() set(cpsc_install_windows "@WIN32@") if(cpsc_install_windows) cpsc_find_dependency(PROGRAM cpsc_powershell NAMES powershell.exe REQUIRED) execute_process( COMMAND "${cpsc_powershell}" -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "@CMAKE_CURRENT_SOURCE_DIR@/install.ps1" -SourceDir "@CMAKE_CURRENT_BINARY_DIR@" -Prefix "${CMAKE_INSTALL_PREFIX}" RESULT_VARIABLE cpsc_install_result ) else() cpsc_find_dependency(PROGRAM cpsc_shell NAMES sh bash REQUIRED) execute_process( COMMAND "${cpsc_shell}" "@CMAKE_CURRENT_SOURCE_DIR@/install.sh" --source-dir "@CMAKE_CURRENT_BINARY_DIR@" --prefix "${CMAKE_INSTALL_PREFIX}" RESULT_VARIABLE cpsc_install_result ) endif() if(NOT cpsc_install_result STREQUAL "0") message(FATAL_ERROR "cpsc installation failed (${cpsc_install_result})") endif()