### CMake Installer Package Configuration for ASDB (Debian) Source: https://github.com/makotoshimazu/asdb-vtabwrapper/blob/master/CMakeLists.txt This snippet configures the installer package for the ASDB project, specifically for Debian (.deb) packages. It includes settings for the license file, package version, description, Debian package name, maintainer information, and required system dependencies. ```cmake # Installer Package include (InstallRequiredSystemLibraries) # common set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") set (CPACK_PACKAGE_VERSION_MAJOR "${ASDB_VERSION_MAJOR}") set (CPACK_PACKAGE_VERSION_MINOR "${ASDB_VERSION_MINOR}") set (CPACK_PACKAGE_VERSION_PATCH "${ASDB_VERSION_PATCH}") set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "ASDB - Any Source Database (for development)") set (CPACK_PACKAGE_NAME "libasdb-dev") # deb set (CPACK_DEBIAN_PACKAGE_NAME "libasdb-dev") set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Makoto Shimazu ") set (CPACK_DEBIAN_PACKAGE_DEPENDS "libsqlite3-dev (>=3.7.9), libglib2.0-dev (>=2.32)") # generator # set (CPACK_GENERATOR DEB;RPM) set (CPACK_GENERATOR DEB) include (CPack) ``` -------------------------------- ### Configure CppUTest Dependency Source: https://github.com/makotoshimazu/asdb-vtabwrapper/blob/master/test/CMakeLists.txt This snippet configures the CppUTest testing framework. It checks for the CppUTest installation via the CPPUTEST_HOME environment variable or pkg-config. It then includes the necessary headers and links the CppUTest library, either statically or dynamically. ```cmake if (DEFINED ENV{CPPUTEST_HOME}) message("Using CppUTest found in $ENV{CPPUTEST_HOME}") # include CppUTest headers include_directories($ENV{CPPUTEST_HOME}/include) # add cpputest library add_library(imp_cpputest STATIC IMPORTED) set_property(TARGET imp_cpputest PROPERTY IMPORTED_LOCATION $ENV{CPPUTEST_HOME}/lib/libCppUTest.a) link_libraries(imp_cpputest) else () # include CppUTest headers include (FindPkgConfig) pkg_check_modules(CPPUTEST REQUIRED cpputest>=3.0) message("Using CppUTest installed by system") include_directories(${CPPUTEST_INCLUDE_DIRS}) link_directories(${CPPUTEST_LIBRARY_DIRS}) link_libraries(${CPPUTEST_LIBRARIES}) endif() ``` -------------------------------- ### Define Project Source and Test Targets Source: https://github.com/makotoshimazu/asdb-vtabwrapper/blob/master/test/CMakeLists.txt This snippet defines the include paths for the project's source and header files, and then creates build targets for test libraries (DummyTest, IndexTest) and the main test executable (RunAllTests). It also specifies the libraries to be linked with the executable. ```cmake # include project source include_directories(${PROJECT_SOURCE_DIR}/../include) include_directories(${PROJECT_SOURCE_DIR}/../src) # build test library add_library(DummyTest dummy.cpp) add_library(IndexTest idx_test.cpp) add_executable(RunAllTests run_all_test.cpp) target_link_libraries(RunAllTests DummyTest IndexTest ASDBTest ASDBTestAdapter) ``` -------------------------------- ### CMake: Configure ASDB Project Source: https://github.com/makotoshimazu/asdb-vtabwrapper/blob/master/src/CMakeLists.txt Configures the ASDB project using CMake. It includes finding packages like PkgConfig, SQLite3, and GLib2, setting C flags, and managing include directories. It also handles conditional library creation based on the EXECTEST variable. ```cmake project (ASDB) include (FindPkgConfig) # Settings for this project set(CMAKE_C_FLAGS "-std=c99") # Each Path include_directories(${PROJECT_SOURCE_DIR}/../include) include_directories(${PROJECT_BINARY_DIR}) configure_file ( "${PROJECT_SOURCE_DIR}/../include/ASDBConfig.h.in" "${PROJECT_BINARY_DIR}/ASDBConfig.h" ) # SQLite3 pkg_check_modules(SQLITE3 REQUIRED sqlite3>=3.7.9) link_directories(${SQLITE3_LIBRARY_DIRS}) link_libraries(${SQLITE3_LIBRARIES}) # GLib2.0 pkg_check_modules(GLIB2 REQUIRED glib-2.0) include_directories(${GLIB2_INCLUDE_DIRS}) link_directories(${GLIB2_LIBRARY_DIRS}) link_libraries(${GLIB2_LIBRARIES}) # TestLibrary if(EXECTEST) function(createTestLibrary) # Add definition for execution of test add_definitions(-D__TEST__) add_library(ASDBTest asdb.c array.c) endfunction() createTestLibrary() else() # Package add_library (asdb SHARED asdb.c array.c) install (TARGETS asdb DESTINATION lib) install (FILES "${PROJECT_SOURCE_DIR}/../include/asdb.h" DESTINATION include) endif() ``` -------------------------------- ### Configure Post-Build Test Execution Source: https://github.com/makotoshimazu/asdb-vtabwrapper/blob/master/test/CMakeLists.txt This code defines a custom post-build command for the 'RunAllTests' executable. After the executable is successfully built, this command will automatically execute 'RunAllTests' and display a message indicating that all tests are running. ```cmake add_custom_command( TARGET RunAllTests POST_BUILD COMMAND RunAllTests COMMENT "Running all tests" # VERBATIM ) ``` -------------------------------- ### Link SQLite3 and GLib2.0 Libraries Source: https://github.com/makotoshimazu/asdb-vtabwrapper/blob/master/test/CMakeLists.txt This section configures the project to use SQLite3 and GLib2.0 libraries. It utilizes pkg-config to find the required modules and then sets up include directories, library directories, and links the libraries to the project. ```cmake # SQLite3 pkg_check_modules(SQLITE3 REQUIRED sqlite3>=3.7.9) link_directories(${SQLITE3_LIBRARY_DIRS}) link_libraries(${SQLITE3_LIBRARIES}) # GLib2.0 pkg_check_modules(GLIB2 REQUIRED glib-2.0) include_directories(${GLIB2_INCLUDE_DIRS}) link_directories(${GLIB2_LIBRARY_DIRS}) link_libraries(${GLIB2_LIBRARIES}) ``` -------------------------------- ### CMake Build Configuration for ASDB Source: https://github.com/makotoshimazu/asdb-vtabwrapper/blob/master/CMakeLists.txt This snippet details the core CMake configuration for the ASDB project. It sets the minimum required CMake version, defines the project name and version components (major, minor, patch), and enables C language support. It also includes options for executing tests and includes subdirectories for source, mock, and test files. ```cmake cmake_minimum_required (VERSION 2.8) project (ASDB) set (ASDB_VERSION_MAJOR 0) set (ASDB_VERSION_MINOR 3) set (ASDB_VERSION_PATCH 0) enable_language(C) # Options option(EXECTEST "Execute all tests" OFF) # Settings for sub directories # sources add_subdirectory(src) # test if(EXECTEST) add_subdirectory(mock) add_subdirectory(test) endif() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.