Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to clips 6.4 from ros vendor #2

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
24 changes: 12 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ cmake_minimum_required(VERSION 3.12)
project(
clips_pddl_parser
VERSION 0.9.0
DESCRIPTION "Parse PDDL domains from within CLIPS")
DESCRIPTION "Parse PDDL domains from within CLIPS")

include(GNUInstallDirs)

find_package(PddlParser REQUIRED)
find_package(spdlog REQUIRED)
include(FindPkgConfig)
pkg_check_modules(clipsmm REQUIRED IMPORTED_TARGET clipsmm-1.0)
find_package(clips_vendor REQUIRED)
find_package(clips REQUIRED)
add_library(clips_pddl_parser SHARED src/clips_pddl_parser.cpp src/precondition_visitor.cpp src/effect_visitor.cpp)
target_link_libraries(
clips_pddl_parser PddlParser::pddl_parser
PkgConfig::clipsmm spdlog::spdlog)
ClipsNS::libclips_ns spdlog::spdlog)
target_include_directories(
clips_pddl_parser PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
clips_pddl_parser PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/> $<INSTALL_INTERFACE:include/>)
target_compile_definitions(
clips_pddl_parser PRIVATE SHAREDIR="${CMAKE_INSTALL_FULL_DATADIR}/clips")
set_target_properties(clips_pddl_parser PROPERTIES SOVERSION
${PROJECT_VERSION_MAJOR})
${PROJECT_VERSION_MAJOR})
install(
TARGETS clips_pddl_parser
EXPORT ClipsPddlParserTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

install(DIRECTORY include/clips_pddl_parser
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

target_compile_features(clips_pddl_parser PRIVATE cxx_std_17)

Expand All @@ -46,13 +46,13 @@ install(
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ClipsPddlParser)

install(FILES cmake/ClipsPddlParserConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/ClipsPddlParserConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ClipsPddlParser)
${CMAKE_CURRENT_BINARY_DIR}/ClipsPddlParserConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ClipsPddlParser)

set(PKG_CONFIG_REQUIRES "pddl_parser spdlog clipsmm-1.0")
set(PKG_CONFIG_REQUIRES "pddl_parser spdlog")

configure_file(clips_pddl_parser.pc.in
${CMAKE_CURRENT_BINARY_DIR}/clips_pddl_parser.pc @ONLY)
${CMAKE_CURRENT_BINARY_DIR}/clips_pddl_parser.pc @ONLY)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/clips_pddl_parser.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
4 changes: 2 additions & 2 deletions cmake/ClipsPddlParserConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ include(CMakeFindDependencyMacro)
find_dependency(PddlParser)
find_dependency(Boost COMPONENTS system)
find_dependency(spdlog)
include(FindPkgConfig)
pkg_check_modules(clipsmm REQUIRED IMPORTED_TARGET clipsmm-1.0)
find_dependency(clips_vendor)
find_dependency(clips)
include("${CMAKE_CURRENT_LIST_DIR}/ClipsPddlParserTargets.cmake")
25 changes: 13 additions & 12 deletions include/clips_pddl_parser/clips_pddl_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,30 @@

#ifndef _CLIPS_PDDL_PARSER_H_
#define _CLIPS_PDDL_PARSER_H_

#include <clipsmm.h>
#include <map>
#include <clips_ns/clips.h>
#undef LHS // to avoid clash with boost
#undef RHS // to avoid clash with boost
#include <list>
#include <mutex>
#include <string>

namespace clips_pddl_parser {

class ClipsPddlParser
{
class ClipsPddlParser {
public:
ClipsPddlParser(CLIPS::Environment *env, std::mutex &env_mutex, bool load_clips_templates);
~ClipsPddlParser();
ClipsPddlParser(clips::Environment *env, std::mutex &env_mutex,
bool load_clips_templates);
~ClipsPddlParser();

private:
void setup_clips(bool load_clips_templates);
void parse_domain(std::string domain_file);
void setup_clips(bool load_clips_templates);
void parse_domain(std::string domain_file);

private:
CLIPS::Environment *clips_;
std::mutex & clips_mutex_;
clips::Environment *clips_;
std::mutex &clips_mutex_;

std::list<std::string> functions_;
std::list<std::string> functions_;
};

} // end namespace clips_pddl_parser
Expand Down
22 changes: 22 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>clips_pddl_parser</name>
<version>0.9.0</version>
<description>Wrapper to provide bindings for the pddl_parser</description>

<maintainer email="viehmann@kbsg.rwth-aachen.de">Tarik Viehmann</maintainer>

<license>GPLv2+ license</license>

<buildtool_depend>cmake</buildtool_depend>

<depend>pddl_parser</depend>
<depend>spdlog</depend>
<depend>clips_vendor</depend>
<depend>pkg-config</depend>

<export>
<build_type>cmake</build_type>
</export>
</package>
Loading