### Install Core Project Documentation Files Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/CMakeLists.txt This snippet defines a list of essential documentation files (NEWS, ChangeLog, INSTALL, AUTHORS, COPYING) and then iterates through them. For each file, it sets up an installation rule to copy it to the designated documentation directory (`TASKSH_DOCDIR`) during the installation phase. ```CMake set (doc_FILES NEWS ChangeLog INSTALL AUTHORS COPYING) foreach (doc_FILE ${doc_FILES}) install (FILES ${doc_FILE} DESTINATION ${TASKSH_DOCDIR}) endforeach (doc_FILE) ``` -------------------------------- ### Install Tasksh on Debian/Ubuntu Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/README.md This command installs the Tasksh utility on Debian or Ubuntu systems using the apt-get package manager. It requires superuser privileges to execute successfully. ```Shell sudo apt-get install tasksh ``` -------------------------------- ### Configure and Install Taskshell Man Pages using CMake Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/doc/CMakeLists.txt This CMake script defines the process for configuring and installing man pages for the Taskshell project. It iterates through a list of man page source files, processes them using `configure_file` to generate the final man page files, and then installs these generated files to the specified man page directory (`TASKSH_MAN1DIR`). This ensures that the project's documentation is correctly placed during the build and installation process. ```CMake cmake_minimum_required (VERSION 2.8) message ("-- Configuring man pages") set (man_FILES tasksh.1) foreach (man_FILE ${man_FILES}) configure_file ( man/${man_FILE}.in man/${man_FILE}) endforeach (man_FILE) install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man/ DESTINATION ${TASKSH_MAN1DIR} FILES_MATCHING PATTERN "*.1") ``` -------------------------------- ### Configure Installation Directories Based on OS Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/CMakeLists.txt This snippet defines standard installation directories for man pages, documentation, configuration files, and binaries. It includes conditional logic to adjust the man page directory path specifically for FreeBSD systems, ensuring correct installation paths across different operating systems. ```CMake if (FREEBSD) SET (TASKSH_MAN1DIR man/man1 CACHE STRING "Installation directory for man pages, section 1") else (FREEBSD) SET (TASKSH_MAN1DIR share/man/man1 CACHE STRING "Installation directory for man pages, section 1") endif (FREEBSD) SET (TASKSH_DOCDIR share/doc/tasksh CACHE STRING "Installation directory for doc files") SET (TASKSH_RCDIR "${TASKSH_DOCDIR}/rc" CACHE STRING "Installation directory for configuration files") SET (TASKSH_BINDIR bin CACHE STRING "Installation directory for the binary") ``` -------------------------------- ### Configure Tasksh Project Build with CMake Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/src/CMakeLists.txt This CMake script defines the build process for the Tasksh project. It specifies the minimum CMake version, includes necessary directories, lists source files for the `tasksh` and `libshared` static libraries, creates an executable, links the libraries, sets the output name, and defines the installation target for the executable. ```CMake cmake_minimum_required (VERSION 2.8) include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/libshared/src ${TASKSH_INCLUDE_DIRS}) set (tasksh_SRCS diag.cpp help.cpp prompt.cpp review.cpp shell.cpp) set (libshared_SRCS libshared/src/Color.cpp libshared/src/Color.h libshared/src/Datetime.cpp libshared/src/Datetime.h libshared/src/Duration.cpp libshared/src/Duration.h libshared/src/FS.cpp libshared/src/FS.h libshared/src/Lexer.cpp libshared/src/Lexer.h libshared/src/Pig.cpp libshared/src/Pig.h libshared/src/shared.cpp libshared/src/shared.h libshared/src/format.cpp libshared/src/format.h libshared/src/unicode.cpp libshared/src/unicode.h libshared/src/utf8.cpp libshared/src/utf8.h libshared/src/wcwidth6.cpp) add_library (tasksh STATIC ${tasksh_SRCS}) add_library (libshared STATIC ${libshared_SRCS}) add_executable (tasksh_executable main.cpp) target_link_libraries (tasksh_executable tasksh libshared ${TASKSH_LIBRARIES}) set_property (TARGET tasksh_executable PROPERTY OUTPUT_NAME "tasksh") install (TARGETS tasksh_executable DESTINATION ${TASKSH_BINDIR}) ``` -------------------------------- ### Initialize CMake Project and Define Version Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/CMakeLists.txt This snippet sets the minimum required CMake version, configures module paths, and defines the project name and version. It also includes a custom CXXSniffer module for C++ analysis. ```CMake cmake_minimum_required (VERSION 2.8) set (CMAKE_LEGACY_CYGWIN_WIN32 0) set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") set (HAVE_CMAKE true) project (tasksh) include (CXXSniffer) set (PROJECT_VERSION "1.2.0") ``` -------------------------------- ### Configure Taskshell Project with CMake Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/test/CMakeLists.txt This CMake script configures the Taskshell project, setting the minimum required CMake version, managing include and link directories, and defining a custom target for running tests. It also iterates through source files to create executables and link necessary libraries for the project components. ```CMake cmake_minimum_required (VERSION 2.8) # See this CMake issue before complaining about the following. # https://cmake.org/Bug/view.php?id=16062 if(POLICY CMP0037) cmake_policy(SET CMP0037 OLD) endif() include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/libshared/src ${CMAKE_SOURCE_DIR}/test ${TASKSH_INCLUDE_DIRS}) include_directories (${CMAKE_INSTALL_PREFIX}/include) link_directories(${CMAKE_INSTALL_PREFIX}/lib) set (test_SRCS) add_custom_target (test ./run_all --verbose DEPENDS ${test_SRCS} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test) foreach (src_FILE ${test_SRCS}) add_executable (${src_FILE} "${src_FILE}.cpp" test.cpp) target_link_libraries (${src_FILE} tasksh libshared ${TASKSH_LIBRARIES}) endforeach (src_FILE) configure_file(run_all run_all COPYONLY) configure_file(problems problems COPYONLY) ``` -------------------------------- ### Configure CPack for Source Package Generation Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/CMakeLists.txt This block configures CPack, CMake's packaging tool, to generate a source package. It specifies the output format (TGZ), the package file name, and a list of files and directories to ignore during the packaging process, ensuring a clean and relevant source distribution. ```CMake set (CPACK_SOURCE_GENERATOR "TGZ") set (CPACK_SOURCE_PACKAGE_FILE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION}) set (CPACK_SOURCE_IGNORE_FILES "CMakeCache" "CMakeFiles" "CPackConfig" "CPackSourceConfig" "_CPack_Packages" "cmake_install" "install_manifest" "Makefile$" "test" "package-config" "misc/*" "src/tasksh$" "README.md" "/\\.gitignore" "/\\.git/" "swp$") include (CPack) ``` -------------------------------- ### Include Project Subdirectories for Building Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/CMakeLists.txt This section adds the 'src' and 'doc' subdirectories to the build system, indicating that CMake should process their respective CMakeLists.txt files. It also conditionally includes a 'test' subdirectory if it exists, excluding it from the default 'all' build target. ```CMake add_subdirectory (src) add_subdirectory (doc) if (EXISTS ${CMAKE_SOURCE_DIR}/test) add_subdirectory (test EXCLUDE_FROM_ALL) endif (EXISTS ${CMAKE_SOURCE_DIR}/test) ``` -------------------------------- ### Find and Link GNU Readline Library Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/CMakeLists.txt This section configures CMake to locate the GNU Readline library, which is required for interactive command-line input. It adds the Readline module path, searches for the library, and then sets the necessary include directories and libraries for the project if Readline is found. ```CMake set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules") message ("-- Looking for GNU Readline") find_package (Readline REQUIRED) if (READLINE_FOUND) set (HAVE_READLINE true) set (TASKSH_INCLUDE_DIRS ${TASKSH_INCLUDE_DIRS} ${READLINE_INCLUDE_DIR}) set (TASKSH_LIBRARIES ${TASKSH_LIBRARIES} ${READLINE_LIBRARIES}) endif (READLINE_FOUND) ``` -------------------------------- ### Perform System Capability Checks Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/CMakeLists.txt This section includes standard CMake modules to check for the existence of specific functions, struct members, and C++ compiler flags. These checks are crucial for ensuring compatibility and tailoring the build process to the target system's capabilities. ```CMake include (CheckFunctionExists) include (CheckStructHasMember) include (CheckCXXCompilerFlag) ``` -------------------------------- ### Configure CMake Generated Header File Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/CMakeLists.txt This snippet uses `configure_file` to process a template header file (`cmake.h.in`) and generate the final `cmake.h`. This mechanism allows CMake variables to be embedded directly into C/C++ source code, providing compile-time access to build-system configurations. ```CMake message ("-- Configuring cmake.h") configure_file ( ${CMAKE_SOURCE_DIR}/cmake.h.in ${CMAKE_SOURCE_DIR}/cmake.h) ``` -------------------------------- ### Integrate Git Commit SHA1 into Build Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/CMakeLists.txt This snippet checks for the presence of a Git repository and, if found, extracts the latest commit's short SHA1 hash. This hash is then used to configure a 'commit.h' header file, allowing the build to embed version control information directly into the compiled application. ```CMake message ("-- Looking for SHA1 references") if (EXISTS ${CMAKE_SOURCE_DIR}/.git/index) set (HAVE_COMMIT true) execute_process (COMMAND git log -1 --pretty=format:%h WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE COMMIT) configure_file ( ${CMAKE_SOURCE_DIR}/commit.h.in ${CMAKE_SOURCE_DIR}/commit.h) message ("-- Found SHA1 reference: ${COMMIT}") endif (EXISTS ${CMAKE_SOURCE_DIR}/.git/index) ``` -------------------------------- ### Define Project Package Metadata Source: https://github.com/gothenburgbitfactory/taskshell/blob/master/CMakeLists.txt This block sets various package-related variables, such as the package name, version, bug report email, and full package string. These variables are typically used by packaging tools like CPack or for generating application-specific version information. ```CMake set (PACKAGE "${PROJECT_NAME}") set (VERSION "${PROJECT_VERSION}") set (PACKAGE_BUGREPORT "support@taskwarrior.org") set (PACKAGE_NAME "${PACKAGE}") set (PACKAGE_TARNAME "${PACKAGE}") set (PACKAGE_VERSION "${VERSION}") set (PACKAGE_STRING "${PACKAGE} ${VERSION}") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.