diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ff1db6df2ede12b6254e3c9ad1841fe1a3603061..abe6464f286242beecf08a61b8588a027c5c5865 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -84,7 +84,8 @@ test: script: - mkdir build - cd build - - conan install .. -s "compiler.libcxx=libstdc++11" + - VERSION="$(conan inspect --raw version ..)" + - conan install -s "compiler.libcxx=libstdc++11" -o build_acm=True .. "caosdb/$VERSION" - cmake -DCMAKE_BUILD_TYPE=Debug .. - cmake --build . -j - cmake --build . -j --target unit_test_coverage diff --git a/src/cxxcaosdbcli.cpp b/src/cxxcaosdbcli.cpp index bfa48b8f6baa460fef512b957b9f8da4a6eed90f..1ea31c4c10336b07291a5a8ef99780452cf308c2 100644 --- a/src/cxxcaosdbcli.cpp +++ b/src/cxxcaosdbcli.cpp @@ -46,7 +46,9 @@ using boost::program_options::positional_options_description; using boost::program_options::store; using boost::program_options::value; using boost::program_options::variables_map; +#ifdef BUILD_ACM using caosdb::acm::Role; +#endif auto print_version(bool print) -> void { if (print) { @@ -98,6 +100,7 @@ auto execute_query(std::string query) -> void { } } +#ifdef BUILD_ACM auto list_roles() -> void { std::cout << "Known roles:" << std::endl; const auto &connection = caosdb::connection::ConnectionManager::GetDefaultConnection(); @@ -125,6 +128,7 @@ auto delete_role(std::string name) { connection->DeleteSingleRole(name); std::cout << "OK" << std::endl; } +#endif auto main(int argc, const char *argv[]) -> int { try { @@ -137,10 +141,14 @@ auto main(int argc, const char *argv[]) -> int { "retrieve", value<std::string>()->notifier(retrieve_entity_by_id), "Retrieve an entity by id and print its JSON representation.")( "execute-query", value<std::string>()->notifier(execute_query), - "Execute a query and print the results")("list-roles", "List all known roles")( - "retrieve-role", value<std::string>()->notifier(retrieve_role), "Retrieve a role by name")( - "create-role", value<std::string>()->notifier(create_role), "Create a new role")( - "delete-role", value<std::string>()->notifier(delete_role), "Create a new role"); + "Execute a query and print the results") +#ifdef BUILD_ACM + ("list-roles", "List all known roles")( + "retrieve-role", value<std::string>()->notifier(retrieve_role), "Retrieve a role by name")( + "create-role", value<std::string>()->notifier(create_role), "Create a new role")( + "delete-role", value<std::string>()->notifier(delete_role), "Create a new role") +#endif + ; parser.options(desc); @@ -158,6 +166,7 @@ auto main(int argc, const char *argv[]) -> int { } else if (vm["version"].as<bool>()) { } else if (vm.count("test-connection")) { test_connection(); +#ifdef BUILD_ACM } else if (vm.count("list-roles")) { list_roles(); } else if (vm.count("retrieve-role")) { @@ -165,6 +174,7 @@ auto main(int argc, const char *argv[]) -> int { } else if (vm.count("create-role")) { } else if (vm.count("delete-role")) { } else if (vm.count("execute-query")) { +#endif } else { print_version(true); test_connection();