Files
cargoxx/build/CMakeLists.txt

409 lines
11 KiB
CMake

cmake_minimum_required(VERSION 3.30)
set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "d0edc3af-4c50-42ea-a356-e2862fe7a444")
set(CMAKE_CXX_MODULE_STD ON)
project(cargoxx LANGUAGES CXX)
# Generated by cargoxx — do not edit.
# Source of truth: ../Cargoxx.toml
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_compile_options(-Wall -Wextra -Wpedantic -Wconversion)
# ----- dependencies -----
find_package(reproc CONFIG REQUIRED)
find_package(SQLite3 REQUIRED)
find_package(Catch2 CONFIG REQUIRED)
# ----- library target -----
add_library(cargoxx STATIC)
target_sources(cargoxx
PUBLIC
FILE_SET CXX_MODULES BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/.. FILES
../src/cli/cli.cppm
../src/codegen/codegen.cppm
../src/exec/exec.cppm
../src/layout/layout.cppm
../src/lib.cppm
../src/linkdb/linkdb.cppm
../src/lockfile/lockfile.cppm
../src/manifest/manifest.cppm
../src/resolver/resolver.cppm
../src/util/util.cppm
PRIVATE
../src/cli/cmd_add.cpp
../src/cli/cmd_build.cpp
../src/cli/cmd_clean.cpp
../src/cli/cmd_linkdb_add.cpp
../src/cli/cmd_new.cpp
../src/cli/cmd_remove.cpp
../src/cli/cmd_run.cpp
../src/cli/cmd_test.cpp
../src/cli/run.cpp
../src/codegen/cmake.cpp
../src/codegen/flake.cpp
../src/exec/subprocess.cpp
../src/layout/layout.cpp
../src/linkdb/database.cpp
../src/linkdb/overlay.cpp
../src/lockfile/lockfile.cpp
../src/manifest/parser.cpp
../src/manifest/writer.cpp
../src/resolver/brute_scan.cpp
../src/resolver/conan_probe.cpp
../src/resolver/discover.cpp
../src/resolver/findmodule_scan.cpp
../src/resolver/fuzzy_listing.cpp
../src/resolver/nix_cmake_scan.cpp
../src/resolver/nixpkgs_git.cpp
../src/resolver/nixpkgs_probe.cpp
../src/resolver/pc_scan.cpp
../src/resolver/search_devbox.cpp
../src/resolver/vcpkg_probe.cpp
../src/resolver/verify_link.cpp
../src/resolver/version_resolve.cpp
../src/util/error.cpp
../src/util/levenshtein.cpp
../src/util/semver.cpp
)
target_include_directories(cargoxx SYSTEM PRIVATE ../third_party)
target_link_libraries(cargoxx PUBLIC
reproc
SQLite::SQLite3
)
# ----- binary target -----
add_executable(cargoxx_bin ../src/main.cpp)
set_target_properties(cargoxx_bin PROPERTIES OUTPUT_NAME cargoxx)
target_link_libraries(cargoxx_bin PRIVATE
cargoxx
reproc
SQLite::SQLite3
)
# ----- tests -----
enable_testing()
include(Catch)
add_executable(test_brute_scan_parse ../tests/brute_scan_parse.cpp)
target_link_libraries(test_brute_scan_parse PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_brute_scan_parse)
add_executable(test_cmd_add ../tests/cmd_add.cpp)
target_link_libraries(test_cmd_add PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_cmd_add)
add_executable(test_cmd_build ../tests/cmd_build.cpp)
target_link_libraries(test_cmd_build PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_cmd_build)
add_executable(test_cmd_clean ../tests/cmd_clean.cpp)
target_link_libraries(test_cmd_clean PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_cmd_clean)
add_executable(test_cmd_linkdb_add ../tests/cmd_linkdb_add.cpp)
target_link_libraries(test_cmd_linkdb_add PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_cmd_linkdb_add)
add_executable(test_cmd_new ../tests/cmd_new.cpp)
target_link_libraries(test_cmd_new PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_cmd_new)
add_executable(test_cmd_remove ../tests/cmd_remove.cpp)
target_link_libraries(test_cmd_remove PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_cmd_remove)
add_executable(test_cmd_run ../tests/cmd_run.cpp)
target_link_libraries(test_cmd_run PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_cmd_run)
add_executable(test_codegen_cmake ../tests/codegen_cmake.cpp)
target_link_libraries(test_codegen_cmake PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_codegen_cmake)
add_executable(test_codegen_flake ../tests/codegen_flake.cpp)
target_link_libraries(test_codegen_flake PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_codegen_flake)
add_executable(test_conan_probe_live ../tests/conan_probe_live.cpp)
target_link_libraries(test_conan_probe_live PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_conan_probe_live)
add_executable(test_conan_probe_parse ../tests/conan_probe_parse.cpp)
target_link_libraries(test_conan_probe_parse PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_conan_probe_parse)
add_executable(test_devbox_resolve_live ../tests/devbox_resolve_live.cpp)
target_link_libraries(test_devbox_resolve_live PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_devbox_resolve_live)
add_executable(test_devbox_resolve_parse ../tests/devbox_resolve_parse.cpp)
target_link_libraries(test_devbox_resolve_parse PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_devbox_resolve_parse)
add_executable(test_exec_run ../tests/exec_run.cpp)
target_link_libraries(test_exec_run PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_exec_run)
add_executable(test_findmodule_scan_live ../tests/findmodule_scan_live.cpp)
target_link_libraries(test_findmodule_scan_live PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_findmodule_scan_live)
add_executable(test_last_failure_dir ../tests/last_failure_dir.cpp)
target_link_libraries(test_last_failure_dir PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_last_failure_dir)
add_executable(test_layout_discovery ../tests/layout_discovery.cpp)
target_link_libraries(test_layout_discovery PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_layout_discovery)
add_executable(test_levenshtein ../tests/levenshtein.cpp)
target_link_libraries(test_levenshtein PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_levenshtein)
add_executable(test_linkdb_lookup ../tests/linkdb_lookup.cpp)
target_link_libraries(test_linkdb_lookup PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_linkdb_lookup)
add_executable(test_linkdb_overlay ../tests/linkdb_overlay.cpp)
target_link_libraries(test_linkdb_overlay PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_linkdb_overlay)
add_executable(test_lockfile_round_trip ../tests/lockfile_round_trip.cpp)
target_link_libraries(test_lockfile_round_trip PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_lockfile_round_trip)
add_executable(test_manifest_parse ../tests/manifest_parse.cpp)
target_link_libraries(test_manifest_parse PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_manifest_parse)
add_executable(test_manifest_write ../tests/manifest_write.cpp)
target_link_libraries(test_manifest_write PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_manifest_write)
add_executable(test_nix_cmake_scan_live ../tests/nix_cmake_scan_live.cpp)
target_link_libraries(test_nix_cmake_scan_live PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_nix_cmake_scan_live)
add_executable(test_nix_cmake_scan_parse ../tests/nix_cmake_scan_parse.cpp)
target_link_libraries(test_nix_cmake_scan_parse PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_nix_cmake_scan_parse)
add_executable(test_nixpkgs_git_resolve ../tests/nixpkgs_git_resolve.cpp)
target_link_libraries(test_nixpkgs_git_resolve PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_nixpkgs_git_resolve)
add_executable(test_nixpkgs_probe_live ../tests/nixpkgs_probe_live.cpp)
target_link_libraries(test_nixpkgs_probe_live PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_nixpkgs_probe_live)
add_executable(test_nixpkgs_probe_parse ../tests/nixpkgs_probe_parse.cpp)
target_link_libraries(test_nixpkgs_probe_parse PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_nixpkgs_probe_parse)
add_executable(test_pc_scan_parse ../tests/pc_scan_parse.cpp)
target_link_libraries(test_pc_scan_parse PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_pc_scan_parse)
add_executable(test_semver_satisfies ../tests/semver_satisfies.cpp)
target_link_libraries(test_semver_satisfies PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_semver_satisfies)
add_executable(test_util_error ../tests/util_error.cpp)
target_link_libraries(test_util_error PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_util_error)
add_executable(test_vcpkg_probe_live ../tests/vcpkg_probe_live.cpp)
target_link_libraries(test_vcpkg_probe_live PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_vcpkg_probe_live)
add_executable(test_vcpkg_probe_parse ../tests/vcpkg_probe_parse.cpp)
target_link_libraries(test_vcpkg_probe_parse PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_vcpkg_probe_parse)
add_executable(test_verify_link_unit ../tests/verify_link_unit.cpp)
target_link_libraries(test_verify_link_unit PRIVATE
cargoxx
reproc
SQLite::SQLite3
Catch2::Catch2
Catch2::Catch2WithMain
)
catch_discover_tests(test_verify_link_unit)