Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • sw/simox/simox
  • uwkce_singer/simox
2 results
Show changes
Commits on Source (3246)
Showing
with 1159 additions and 307 deletions
build/
build*
!/build/.gitkeep
!.gitkeep
!.gitignore
.idea
.venv
*.bak
*#
.#*
*~
*.swp
.*.kate-swp
.*.swo
*.pyc
.DS_Store
CMakeFiles
CMakeCache.txt
CMakeLists.txt.user*
*.o
*.os
*.a
*.la
*.lo
*.so
*.dylib
moc_*
# eclipse stuff
.project
.pydevproject
.settings
.metadata
.cproject
.project
# qtcreator project stuff
*.pro
*.pro.user
.cmake/api/v1/query/cache-v2
.cmake/api/v1/query/codemodel-v2
.cmake/api/v1/query/cmakeFiles-v1
# vscode stuff
.vscode
# clangd
.cache
.clang-format
.clang-tidy
stages:
- build-and-test
- deploy
- post-deploy-test
- downstream
.build-and-test:
cache:
# https://docs.gitlab.com/ee/ci/caching/#share-caches-across-jobs-in-different-branches
key: one-key-to-rule-them-all
paths:
- .ccache
before_script:
# Ccache configuration and introspection.
- apt-get update
- apt-get install ccache --yes
- ccache --set-config=cache_dir="$CI_PROJECT_DIR/.ccache"
- ccache --max-size=5G
- ccache --show-stats
# Activate Axii.
- source /axii/scripts/install_axii.sh
script:
# Create workspace.
- axii workspace create ~/workspace workspace
- axii workspace activate workspace
- _axii_auto_env_refresh
# Use workspace configuration from project.
- cp "$CI_PROJECT_DIR/.gitlab/ci/armarx-workspace.json" "$ARMARX_WORKSPACE/armarx-workspace.json"
- cat "$ARMARX_WORKSPACE/armarx-workspace.json"
- axii workspace env
- _axii_auto_env_refresh
- echo "Workspace information:"
- axii workspace list-modules
- axii workspace list-modules --deps
- axii workspace info
- export PROJECT_PATH_IN_WORKSPACE="$simox__PATH"
# Symlink project directory into Axii workspace.
- mkdir -p "$(dirname $PROJECT_PATH_IN_WORKSPACE)"
- ln -s "$CI_PROJECT_DIR" "$PROJECT_PATH_IN_WORKSPACE"
# Upgrade.
- axii workspace system --accept-apt-install
- axii workspace update --prefer-https
- _axii_auto_env_refresh
# Upgrade.
- axii workspace upgrade -m simox
- _axii_auto_env_refresh
- ccache --show-stats
# Test.
# ToDo: Add and use `axii ws test -m simox`
- cd "$PROJECT_PATH_IN_WORKSPACE/build"
- ctest --output-on-failure --output-junit "$CI_PROJECT_DIR/report.xml" .
# Generate documentation.
- cd "$PROJECT_PATH_IN_WORKSPACE/build"
- make doc
- du -sh *
- du -sh doc/*
build-and-test-bionic:
stage: build-and-test
extends: .build-and-test
image: git.h2t.iar.kit.edu:5050/sw/armarx/meta/axii:latest-bionic
artifacts:
reports:
junit: report.xml
name: "Simox-Documentation-$CI_COMMIT_REF_NAME"
paths:
- build/doc/html/
build-and-test-jammy:
stage: build-and-test
extends: .build-and-test
image: git.h2t.iar.kit.edu:5050/sw/armarx/meta/axii:latest-jammy
docker-bionic:
stage: deploy
needs: ["build-and-test-bionic"]
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/docker/bionic"
--destination "${CI_REGISTRY_IMAGE}:latest-bionic"
rules:
- if: $CI_COMMIT_BRANCH == "master"
docker-jammy:
stage: deploy
needs: ["build-and-test-jammy"]
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/docker/jammy"
--destination "${CI_REGISTRY_IMAGE}:latest-jammy"
rules:
- if: $CI_COMMIT_BRANCH == "master"
.test-docker-image-common:
before_script:
- source /axii/scripts/install_axii.sh
- _axii_auto_env_refresh
script:
- echo "ArmarX Workspace = '$ARMARX_WORKSPACE'"
- printenv
- axii workspace list-modules
- axii workspace list-modules --deps
- axii workspace info
- echo "Simox directory = '$Simox_DIR'"
- which RobotViewer
test-docker-image-bionic:
stage: post-deploy-test
needs: ["docker-bionic"]
extends: .test-docker-image-common
image: git.h2t.iar.kit.edu:5050/sw/simox/simox:latest-bionic
rules:
- if: $CI_COMMIT_BRANCH == "master"
test-docker-image-jammy:
stage: post-deploy-test
needs: ["docker-jammy"]
extends: .test-docker-image-common
image: git.h2t.iar.kit.edu:5050/sw/simox/simox:latest-jammy
rules:
- if: $CI_COMMIT_BRANCH == "master"
armarx-core:
stage: downstream
variables:
TODO_ENV_VARIABLE: "This variable will be available to the CI pipeline of ArmarXCore."
trigger:
project: sw/armarx/armarx-core
# This is optional, but we could tell ArmarX which Simox branch to use.
branch: master
rules:
- if: $CI_COMMIT_BRANCH == "master"
/SimDynamics/ @rietsch @nefzer
/SimoxUtility @meixner @reister
/VirtualRobot @meixner @reister
/GraspPlanning @hyseni
/GeometricPlanning @reister
{
"modules": {
"tools/ccache/default": {},
"deps/doxygen": {},
"simox": {}
},
"global": {
"prepare": {
"cmake": {
"definitions": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_C_COMPILER_LAUNCHER": "$CCACHE",
"CMAKE_CXX_COMPILER_LAUNCHER": "$CCACHE"
}
}
}
}
}
PROJECT(Simox)
cmake_minimum_required(VERSION 3.10)
MESSAGE (STATUS "cmake version: ${CMAKE_VERSION}")
cmake_minimum_required(VERSION 2.6)
# If OS is Ubuntu 20 we nned to change some things
execute_process(COMMAND lsb_release -cs
OUTPUT_VARIABLE RELEASE_CODENAME
OUTPUT_STRIP_TRAILING_WHITESPACE
)
#######################################################################################
PROJECT(Simox LANGUAGES CXX VERSION 2.3.74.0)
MESSAGE (STATUS "** Simox version: ${Simox_VERSION}")
INCLUDE(${Simox_SOURCE_DIR}/CMakeModules/SimoxMacros.cmake)
#determine boost version
if(NOT "" STREQUAL "${Simox_BOOST_VERSION}")
#keep the value
elseif(NOT "" STREQUAL "$ENV{Simox_BOOST_VERSION}")
message(STATUS "Use boost version from env variable Simox_BOOST_VERSION")
SET(Simox_BOOST_VERSION $ENV{Simox_BOOST_VERSION})
elseif(RELEASE_CODENAME STREQUAL focal OR RELEASE_CODENAME STREQUAL odin OR RELEASE_CODENAME STREQUAL jolnir)
SET(Simox_BOOST_VERSION 1.71.0)
elseif(RELEASE_CODENAME STREQUAL impish)
SET(Simox_BOOST_VERSION 1.74.0)
elseif(RELEASE_CODENAME STREQUAL jammy OR RELEASE_CODENAME STREQUAL horus)
SET(Simox_BOOST_VERSION 1.74.0)
elseif(RELEASE_CODENAME STREQUAL noble) #Ubuntu 24
SET(Simox_BOOST_VERSION 1.83.0)
else()
SET(Simox_BOOST_VERSION 1.65.1)
endif()
message(STATUS "Using Boost Version ${Simox_BOOST_VERSION}")
#######################################################################################
#global config
# Set up build type
if(NOT "$ENV{CMAKE_UNITY_BUILD_BATCH_SIZE}" STREQUAL "")
message(STATUS "CMAKE_UNITY_BUILD_BATCH_SIZE -> $ENV{CMAKE_UNITY_BUILD_BATCH_SIZE}")
set(CMAKE_UNITY_BUILD ON)
set(CMAKE_UNITY_BUILD_BATCH_SIZE $ENV{CMAKE_UNITY_BUILD_BATCH_SIZE})
endif()
IF(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif()
#we want Release and RelWithDebInfo to use the same optimization level
string(REGEX MATCH "([ \t]|^)-O[^ \t]+([ \t]|^)" RELEASE_O_LEVEL ${CMAKE_CXX_FLAGS_RELEASE})
string(REGEX MATCH "([ \t]|^)-O[^ \t]+([ \t]|^)" RELWITHDEBINFO_O_LEVEL ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
if(NOT RELEASE_O_LEVEL STREQUAL RELWITHDEBINFO_O_LEVEL)
string(REPLACE "${RELWITHDEBINFO_O_LEVEL}" "${RELEASE_O_LEVEL}" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
message(STATUS "Changing o level of RelWithDebInfo to match o level of Release (from '${RELWITHDEBINFO_O_LEVEL}' to '${RELEASE_O_LEVEL}')")
message(STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO = ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
endif()
# cmake 3.10 does not understand c++2a, so we tell it we will handle the standard flag
set(CMAKE_CXX_STANDARD_DEFAULT)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++2b" COMPILER_SUPPORTS_CXX2B)
if(COMPILER_SUPPORTS_CXX2B)
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++2b support.")
add_definitions(-std=c++2b)
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++2b support. Using C++2a instead.")
add_definitions(-std=c++2a)
endif()
list(APPEND CMAKE_MODULE_PATH ${Simox_SOURCE_DIR}/CMakeModules)
list(APPEND CMAKE_MODULE_PATH ${Simox_SOURCE_DIR}/CMakeModules/find_modules)
MESSAGE (STATUS "** Module path: " ${CMAKE_MODULE_PATH})
# we want a global automoc
FIND_PACKAGE(Qt5 5.5.0 COMPONENTS OpenGL Core Gui Widgets)
set(OpenGL_GL_PREFERENCE LEGACY)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(qwt QUIET)
FIND_PACKAGE (Eigen3 REQUIRED)
FIND_PACKAGE(Boost ${Simox_BOOST_VERSION} EXACT COMPONENTS
filesystem
system
program_options
thread
unit_test_framework
regex
REQUIRED)
MESSAGE (STATUS "Boost found at: ${Boost_INCLUDE_DIR}")
FIND_PACKAGE (difflib QUIET)
find_package(nlohmann_json 3.11.3 REQUIRED)
find_package(RBDL REQUIRED)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#flags
add_compile_options(-fsigned-char)
add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Wpedantic)
message(STATUS "Compiler version: ${CMAKE_CXX_COMPILER_VERSION}")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
add_compile_options(-fconcepts)
#turn warnings about dangerous stuff into errors
add_compile_options(-Werror)
add_compile_options(-Wno-error=unused-but-set-variable)
add_compile_options(-Wno-error=unused-variable)
add_compile_options(-Wno-error=unused-parameter)
add_compile_options(-Wno-error=deprecated-declarations)
add_compile_options(-Wno-error=sign-compare)
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0)
add_compile_options(-Wno-error=deprecated-copy)
endif()
#######################################################################################
#options
OPTION (Simox_USE_RBDL_LIB "Use RBDL" ON)
OPTION (Simox_USE_NLOPT "Use NLOPT" ON)
OPTION(SimDynamics_USE_BULLET "Use Bullet Physics Engine" ON)
OPTION(Simox_USE_COIN_VISUALIZATION "Use Coin3D for visualization" ON)
OPTION(Simox_USE_OPENSCENEGRAPH_VISUALIZATION "Use OpenSceneGraph for visualization" OFF)
OPTION(Simox_COLLISION_CHECKER_PQP "Build and use the PQP Collision Detection library (located in ExternalDependencies)" ON)
#######################################################################################
MESSAGE(STATUS "******************** Configuring Simox ************************")
set (SIMOX_BUILD_DIRECTORY ${CMAKE_BINARY_DIR} CACHE STRING "Simox build directory")
set (Simox_BUILD_VirtualRobot TRUE CACHE BOOL "Build Virtual Robot library")
set (Simox_BUILD_Saba TRUE CACHE BOOL "Build Motion Planning library")
set (Simox_BUILD_GraspStudio TRUE CACHE BOOL "Build Grasp Planning library")
set (Simox_BUILD_SimDynamics TRUE CACHE BOOL "Build Dynamic Simulation")
set (Simox_BUILD_GeometricPlanning TRUE CACHE BOOL "Build Geometric Planning Library")
MESSAGE (STATUS "** SIMOX BUILD SimoxUtility: TRUE (can't be turned off)")
MESSAGE (STATUS "** SIMOX BUILD SimoxQtUtility: TRUE (can't be turned off)")
MESSAGE (STATUS "** SIMOX BUILD VirtualRobot: ${Simox_BUILD_VirtualRobot}")
MESSAGE (STATUS "** SIMOX BUILD Saba : ${Simox_BUILD_Saba}")
MESSAGE (STATUS "** SIMOX BUILD GraspStudio : ${Simox_BUILD_GraspStudio}")
MESSAGE (STATUS "** SIMOX BUILD SimDynamics : ${Simox_BUILD_SimDynamics}")
MESSAGE (STATUS "** SIMOX BUILD GeometricPlanning : ${GeometricPlanning}")
############################# SETUP PATHS #############################
if(WIN32 AND NOT CYGWIN)
set(INSTALL_CMAKE_DIR CMake CACHE PATH "Installation directory for CMake files")
else()
set(INSTALL_CMAKE_DIR share/Simox/cmake CACHE PATH "Installation directory for CMake files")
endif()
SET(Simox_LIB_DIR ${Simox_BINARY_DIR}/lib)
SET(Simox_BIN_DIR ${Simox_BINARY_DIR}/bin)
SET(Simox_DATA_DIR ${Simox_SOURCE_DIR}/VirtualRobot/data)
MESSAGE (STATUS "** SIMOX LIB DIR: ${Simox_LIB_DIR}")
MESSAGE (STATUS "** SIMOX BIN DIR: ${Simox_BIN_DIR}")
MESSAGE (STATUS "** SIMOX DATA DIR: ${Simox_DATA_DIR}")
SET(Simox_INSTALL_LIB_DIR lib)
SET(Simox_INSTALL_BIN_DIR bin)
SET(Simox_INSTALL_DATA_DIR data)
SET(Simox_INSTALL_HEADER_DIR include)
MESSAGE (STATUS "** SIMOX INSTALL LIB DIR : ${Simox_INSTALL_LIB_DIR}")
MESSAGE (STATUS "** SIMOX INSTALL BIN DIR : ${Simox_INSTALL_BIN_DIR}")
MESSAGE (STATUS "** SIMOX INSTALL DATA DIR : ${Simox_INSTALL_DATA_DIR}")
MESSAGE (STATUS "** SIMOX INSTALL HEADER DIR: ${Simox_INSTALL_HEADER_DIR}")
MESSAGE(STATUS "** Simox build directory: ${CMAKE_BINARY_DIR}")
###########################################################
include(SearchForTinyXML)
FIND_PACKAGE(urdfdom)
########################### IDE settings ################################
# use virtual folders for grouping projects in IDEs
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
############################# Set OS specific options #############################
set(Simox_OS_compile_options)
IF(UNIX)
# We are on Linux
SET(Simox_TEST_DIR ${Simox_BIN_DIR}/tests)
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
set(Simox_OS_compile_options ${Simox_OS_compile_options} -fPIC)
ENDIF()
IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
MESSAGE(STATUS "Configuring Debug build")
set(Simox_OS_compile_options ${Simox_OS_compile_options} -D_DEBUG)
ELSE()
MESSAGE(STATUS "Configuring Release build")
ENDIF()
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "${Simox_INSTALL_LIB_DIR}")
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${Simox_INSTALL_LIB_DIR}" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${Simox_INSTALL_LIB_DIR}")
ENDIF()
ELSE()
# We are on Windows
SET(Simox_TEST_DIR ${Simox_BIN_DIR})
set(Simox_OS_compile_options
-D_CRT_SECURE_NO_WARNINGS
-DWIN32_LEAN_AND_MEAN # avoid errors with winsock / winsock2 includes
)
# On MSVC we compile with /MP flag (use multiple threads)
IF(MSVC)
set(Simox_OS_compile_options ${Simox_OS_compile_options} /MP)
ENDIF()
ENDIF()
#######################################################################
# Setup for testing
ENABLE_TESTING()
INCLUDE(CTest)
MESSAGE(STATUS "** Test output directory: ${Simox_TEST_DIR}")
ADD_DEFINITIONS(-DSimox_TEST_DIR=\"${Simox_TEST_DIR}/\")
set (SIMOX_EXPORT_TARGET_LIST "")
if (Simox_USE_RBDL_LIB)
# message(STATUS "Using rbdl")
# add_subdirectory(3rdParty/rbdl)
# list (APPEND SIMOX_EXPORT_TARGET_LIST rbdl)
# list (APPEND Simox_LIBRARIES rbdl)
endif()
#######################################################################################
add_subdirectory(SimoxUtility)
list (APPEND SIMOX_EXPORT_TARGET_LIST SimoxUtility)
list (APPEND Simox_LIBRARIES SimoxUtility)
add_subdirectory(SimoxQtUtility)
list (APPEND SIMOX_EXPORT_TARGET_LIST SimoxQtUtility)
list (APPEND Simox_LIBRARIES SimoxQtUtility)
#######################################################################################
if (Simox_BUILD_VirtualRobot)
add_subdirectory(VirtualRobot)
list(APPEND SIMOX_EXPORT_TARGET_LIST VirtualRobot assimp_interface)
list(APPEND Simox_LIBRARIES VirtualRobot)
endif()
#######################################################################################
if (Simox_BUILD_Saba)
add_subdirectory(MotionPlanning)
list(APPEND SIMOX_EXPORT_TARGET_LIST Saba)
list (APPEND Simox_LIBRARIES Saba)
endif()
#######################################################################################
if (Simox_BUILD_GraspStudio)
add_subdirectory(GraspPlanning)
list(APPEND SIMOX_EXPORT_TARGET_LIST GraspStudio)
list (APPEND Simox_LIBRARIES GraspStudio)
endif()
#######################################################################################
if (Simox_BUILD_GeometricPlanning)
add_subdirectory(GeometricPlanning)
list(APPEND SIMOX_EXPORT_TARGET_LIST GeometricPlanning)
list (APPEND Simox_LIBRARIES GeometricPlanning)
endif()
#######################################################################################
if (Simox_BUILD_SimDynamics)
find_package(Bullet QUIET)
if(BULLET_FOUND)
add_subdirectory(SimDynamics)
list(APPEND SIMOX_EXPORT_TARGET_LIST SimDynamics)
list (APPEND Simox_LIBRARIES SimDynamics)
if (SimDynamics_BULLET_OpenGL)
list(APPEND SIMOX_EXPORT_TARGET_LIST BulletOpenGLSupport)
endif()
else()
message("NOT building SimDynamics since bullet was not found")
endif()
endif()
add_subdirectory(doc)
#######################################################################################
# Setup for installation
MESSAGE (STATUS "** Simox: Generating CMake files for build and install setup")
# Add all targets to the build-tree export set
export(
TARGETS
${SIMOX_EXPORT_TARGET_LIST}
NAMESPACE
Simox::
FILE
"${PROJECT_BINARY_DIR}/SimoxTargets.cmake"
)
export(
TARGETS
${SIMOX_EXPORT_TARGET_LIST}
# NAMESPACE
# Simox::
FILE
"${PROJECT_BINARY_DIR}/SimoxTargetsLegacy.cmake"
)
# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
export(PACKAGE Simox)
# Create the SimoxConfig.cmake and SimoxVersion files
# ... for the build tree
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
set(Simox_DATA_PATH ${Simox_DATA_DIR})
set(Simox_MACROS_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/CMakeModules")
configure_file(CMakeModules/SimoxBuildTreeSettings.cmake.in
"${PROJECT_BINARY_DIR}/SimoxBuildTreeSettings.cmake" @ONLY)
MESSAGE ("INSTALL_CMAKE_DIR:${INSTALL_CMAKE_DIR}")
# ... for the install tree
file(RELATIVE_PATH RELATIVE_INSTALL_DIR
"${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR}"
"${CMAKE_INSTALL_PREFIX}")
set(CONF_INCLUDE_DIRS "include")
set(Simox_DATA_PATH "${Simox_INSTALL_DATA_DIR}")
set(Simox_MACROS_INCLUDE_DIR "\${Simox_CMAKE_DIR}")
configure_file(CMakeModules/SimoxConfig.cmake.in
"${PROJECT_BINARY_DIR}/SimoxConfig.cmake" @ONLY)
# ... for both
configure_file(CMakeModules/SimoxConfigVersion.cmake.in
"${PROJECT_BINARY_DIR}/SimoxConfigVersion.cmake" @ONLY)
# Install the SimoxBuildTreeSettings.cmake, SimoxConfig.cmake, and SimoxConfigVersion.cmake
install(FILES
"${PROJECT_BINARY_DIR}/SimoxBuildTreeSettings.cmake"
"${PROJECT_BINARY_DIR}/SimoxConfig.cmake"
"${PROJECT_BINARY_DIR}/SimoxConfigVersion.cmake"
DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)
install(FILES
"${PROJECT_SOURCE_DIR}/CMakeModules/SimoxMacros.cmake"
DESTINATION "${INSTALL_CMAKE_DIR}"
COMPONENT ApplicationData
)
# Install the export set for use with the install-tree
install(
EXPORT
SimoxTargets
DESTINATION "${INSTALL_CMAKE_DIR}"
COMPONENT dev
)
install(
EXPORT SimoxTargets
FILE SimoxTargetsLegacy.cmake
DESTINATION "${INSTALL_CMAKE_DIR}"
COMPONENT dev
)
#######################################################################################
# PACKAGING (DEB)
# git version not used any more!
find_package(Git QUIET)
if(GIT_FOUND)
# output format <tag>-<commit-id>-dirty or <tag>-<commit-id> or <commit-id>
execute_process(COMMAND ${GIT_EXECUTABLE} describe --long --tags --dirty --always
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_EXIT_STATUS
OUTPUT_VARIABLE SIMOX_PACKAGE_GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT GIT_EXIT_STATUS EQUAL 0)
message(WARNING "no git repository or unable to run git describe")
set(Project_WC_REVISION "Unknown")
else()
# string(REGEX REPLACE "\n" "" SIMOX_PACKAGE_GIT_VERSION ${SIMOX_PACKAGE_GIT_VERSION})
message(STATUS "simox git version: ${SIMOX_PACKAGE_GIT_VERSION}")
set(Project_WC_REVISION ${SIMOX_PACKAGE_GIT_VERSION})
endif()
endif()
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
SET(CPACK_DEBIAN_ARCHITECTURE "amd64")
ELSE()
SET(CPACK_DEBIAN_ARCHITECTURE "i386")
ENDIF()
INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_SET_DESTDIR "on")
SET(CPACK_PACKAGING_INSTALL_PREFIX "/tmp")
SET(CPACK_DEBIAN_PACKAGE_NAME "simox")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_PACKAGE_DESCRIPTION "Simox - A Robot Simulation, Motion and Grasp Planning Toolbox")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Simox - A Robot Simulation, Motion and Grasp Planning Toolbox")
SET(CPACK_PACKAGE_VENDOR "KIT")
SET(CPACK_PACKAGE_CONTACT "Nikolaus Vahrenkamp <vahrenkamp@kit.edu>")
message("simox version: ${Simox_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MAJOR "${Simox_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${Simox_VERSION_MINOR}")
#SET(CPACK_PACKAGE_VERSION_PATCH "${Simox_PATCH_VERSION}-r${Project_WC_REVISION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${Simox_VERSION_PATCH}")
SET(CPACK_PACKAGE_FILE_NAME "simox_${Project_WC_REVISION}_${CPACK_DEBIAN_ARCHITECTURE}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "simox_${Project_WC_REVISION}")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
#GET_PROPERTY(result GLOBAL ENABLED_FEATURES)
#message(" enabled features: ${result}")
set(CPACK_COMPONENT_APPLICATIONS_DISPLAY_NAME "Simox Examples")
set(CPACK_COMPONENT_APPLICATIONDATA_DISPLAY_NAME "Simox Data")
set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Simox Libraries")
set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Simox C++ Headers")
INCLUDE (config.cmake)
#set(CPACK_DEBIAN_PACKAGE_DEPENDS "libbullet-dev, libbulletmultithreaded2.82, libqhull-dev, libnlopt-dev")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
SET(CPACK_COMPONENTS_ALL Applications Headers Libraries ApplicationData)
INCLUDE(CPack)
MESSAGE(STATUS "\n** SETTING Simox target directory to: ${SIMOX_BUILD_DIRECTORY}")
add_subdirectory(VirtualRobot)
add_subdirectory(MotionPlanning)
add_subdirectory(GraspPlanning)
#######################################################################################
# STYLE
FIND_PACKAGE(AStyle QUIET)
if(AStyle_FOUND)
add_custom_target(astyle
COMMAND ${AStyle_EXECUTABLE} --options="${PROJECT_SOURCE_DIR}/armarx.astylerc" --recursive --preserve-date --formatted "*.cpp" "*.h" "*.hpp"
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
COMMENT "Formatting source files in: ${PROJECT_SOURCE_DIR}")
else()
add_custom_target(astyle
COMMENT "Unable to format source files: AStyle was not found!")
endif()
macro(BulletCheckPrecision)
message(STATUS "Testing Bullet for use of double precision...")
try_compile(
_resultDouble
${PROJECT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/CMakeModules/BulletCheckPrecision.cpp
CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES:string=${BULLET_INCLUDE_DIRS}"
"-DLINK_LIBRARIES:string=${BULLET_LIBRARIES}"
"-DCMAKE_CXX_FLAGS:string=-std=c++17"
COMPILE_DEFINITIONS
"-DBT_USE_DOUBLE_PRECISION"
OUTPUT_VARIABLE _buildOutDouble
)
if( _resultDouble )
message(STATUS "Bullet double precision detected. Automatically defining BT_USE_DOUBLE_PRECISION")
set(BULLET_USE_SINGLE_PRECISION OFF CACHE BOOL "" FORCE)
add_definitions(-DBT_USE_DOUBLE_PRECISION)
else()
# Try it *without* -DBT_USE_DOUBLE_PRECISION to make sure it's single...
try_compile(
_resultSingle
${PROJECT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/CMakeModules/BulletCheckPrecision.cpp
CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES:string=${BULLET_INCLUDE_DIRS}"
"-DLINK_LIBRARIES:string=${BULLET_LIBRARIES}"
OUTPUT_VARIABLE _buildOutSingle
)
if( _resultSingle )
message(STATUS "Bullet single precision detected. Not defining BT_USE_DOUBLE_PRECISION")
set(BULLET_USE_SINGLE_PRECISION ON CACHE BOOL "" FORCE)
else()
message(ERROR "Unable to determine single or double precision.")
message(STATUS "----------------------------------")
message(STATUS "Build config for double precision:")
message(STATUS " CMAKE_FLAGS")
message(STATUS " -DINCLUDE_DIRECTORIES:string=${BULLET_INCLUDE_DIRS}")
message(STATUS " -DLINK_LIBRARIES:string=${BULLET_LIBRARIES}")
message(STATUS " -DCMAKE_CXX_FLAGS:string=-std=c++17")
message(STATUS " COMPILE_DEFINITIONS")
message(STATUS " -DBT_USE_DOUBLE_PRECISION")
message(STATUS "Build output for double precision:")
message(STATUS "${_buildOutDouble}")
message(STATUS "----------------------------------")
message(STATUS "Build config for single precision:")
message(STATUS " CMAKE_FLAGS")
message(STATUS " -DINCLUDE_DIRECTORIES:string=${BULLET_INCLUDE_DIRS}")
message(STATUS " -DLINK_LIBRARIES:string=${BULLET_LIBRARIES}")
message(STATUS "Build output for single precision:")
message(STATUS "${_buildOutSingle}")
message(FATAL_ERROR "Unable to determine single or double precision.")
endif()
endif()
endmacro()
#pragma GCC diagnostic ignored "-Wunused-variable"
#include <btBulletCollisionCommon.h>
int
main()
{
btVector3 vec(0.0, 1.0, 0.0);
btStaticPlaneShape(vec, 0.0);
return 0;
}
# - Find Coin3D (Open Inventor)
# Coin3D is an implementation of the Open Inventor API.
# It provides data structures and algorithms for 3D visualization
# http://www.coin3d.org/
#
# This module defines the following variables
# COIN3D_FOUND - system has Coin3D - Open Inventor
# COIN3D_INCLUDE_DIRS - where the Inventor include directory can be found
# COIN3D_LIBRARIES - Link to this to use Coin3D
#
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF (WIN32)
IF (CYGWIN)
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h)
FIND_LIBRARY(COIN3D_LIBRARIES Coin)
ELSE (CYGWIN)
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
)
FIND_LIBRARY(COIN3D_LIBRARY_DEBUG coin2d
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
)
FIND_LIBRARY(COIN3D_LIBRARY_RELEASE coin2
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
)
IF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
SET(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
debug ${COIN3D_LIBRARY_DEBUG})
ELSE (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
IF (COIN3D_LIBRARY_DEBUG)
SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
ENDIF (COIN3D_LIBRARY_DEBUG)
IF (COIN3D_LIBRARY_RELEASE)
SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
ENDIF (COIN3D_LIBRARY_RELEASE)
ENDIF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
ENDIF (CYGWIN)
ELSE (WIN32)
IF(APPLE)
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
/Library/Frameworks/Inventor.framework/Headers
)
FIND_LIBRARY(COIN3D_LIBRARIES Coin
/Library/Frameworks/Inventor.framework/Libraries
)
SET(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
ELSE(APPLE)
find_path( COIN3D_INCLUDE_DIRS NAMES Inventor/So.h PATHS $ENV{Coin3D_DIR}/include /usr/include /usr/local/include NO_DEFAULT_PATH )
find_library( COIN3D_LIBRARIES NAMES Coin PATHS $ENV{Coin3D_DIR}/lib /usr/lib /usr/local/lib NO_DEFAULT_PATH )
#FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h $ENV{COIN3D_DIR}/include)
#FIND_LIBRARY(COIN3D_LIBRARIES Coin $ENV{COIN3D_DIR}/lib)
ENDIF(APPLE)
ENDIF (WIN32)
# handle the QUIETLY and REQUIRED arguments and set COIN3D_FOUND to TRUE if
# all listed variables are TRUE
#INCLUDE("${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake")
INCLUDE( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Coin3D DEFAULT_MSG COIN3D_LIBRARIES COIN3D_INCLUDE_DIRS)
MARK_AS_ADVANCED(COIN3D_INCLUDE_DIRS COIN3D_LIBRARIES )
# - Try to find Eigen3 lib
#
# This module supports requiring a minimum version, e.g. you can do
# find_package(Eigen3 3.1.2)
# to require version 3.1.2 or newer of Eigen3.
#
# Once done this will define
#
# Eigen3_FOUND - system has eigen lib with correct version
# Eigen3_INCLUDE_DIR - the eigen include directory
# Eigen3_VERSION - eigen version
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
# Copyright (c) 2011 Manfred Kroehnert <Manfred.Kroehnert@kit.edu> "No all uppercase variable names"
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
if(NOT Eigen3_FIND_VERSION)
if(NOT Eigen3_FIND_VERSION_MAJOR)
set(Eigen3_FIND_VERSION_MAJOR 2)
endif(NOT Eigen3_FIND_VERSION_MAJOR)
if(NOT Eigen3_FIND_VERSION_MINOR)
set(Eigen3_FIND_VERSION_MINOR 91)
endif(NOT Eigen3_FIND_VERSION_MINOR)
if(NOT Eigen3_FIND_VERSION_PATCH)
set(Eigen3_FIND_VERSION_PATCH 0)
endif(NOT Eigen3_FIND_VERSION_PATCH)
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
endif(NOT Eigen3_FIND_VERSION)
macro(_eigen3_check_version)
file(READ "${Eigen3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
set(Eigen3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
if(${Eigen3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
set(Eigen3_VERSION_OK FALSE)
else(${Eigen3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
set(Eigen3_VERSION_OK TRUE)
endif(${Eigen3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
if(NOT Eigen3_VERSION_OK)
message(STATUS "Eigen3 version ${Eigen3_VERSION} found in ${Eigen3_INCLUDE_DIR}, "
"but at least version ${Eigen3_FIND_VERSION} is required")
endif(NOT Eigen3_VERSION_OK)
endmacro(_eigen3_check_version)
if (Eigen3_INCLUDE_DIR)
# in cache already
_eigen3_check_version()
set(Eigen3_FOUND ${Eigen3_VERSION_OK})
else (Eigen3_INCLUDE_DIR)
find_path(Eigen3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
PATHS
${CMAKE_INSTALL_PREFIX}/include
${KDE4_INCLUDE_DIR}
${Eigen3_DIR}
$ENV{Eigen3_DIR}
/org/share/archive/SFB588_RefDist/eigen3/
PATH_SUFFIXES eigen3 eigen
)
if(Eigen3_INCLUDE_DIR)
_eigen3_check_version()
set(Eigen3_FOUND ${Eigen3_VERSION_OK})
endif(Eigen3_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Eigen3 DEFAULT_MSG Eigen3_INCLUDE_DIR Eigen3_VERSION_OK)
mark_as_advanced(Eigen3_INCLUDE_DIR)
endif(Eigen3_INCLUDE_DIR)
# - Try to find RapidXML lib
# Once done this will define
#
# RapidXML_FOUND - system has eigen lib
# RapidXML_INCLUDE_DIR - the eigen include directory
# Copyright (c) 2010, Manfred Kroehnert, <mkroehnert _at_ users _dot_ sourceforge _dot_ net>
# Redistribution and use is allowed according to the terms of the BSD license.
IF (RapidXML_INCLUDE_DIR)
SET(RapidXML_FOUND TRUE)
ELSE (RapidXML_INCLUDE_DIR)
FIND_PATH(RapidXML_INCLUDE_DIR NAMES rapidxml.hpp
HINTS
${INCLUDE_INSTALL_DIR}
${KDE4_INCLUDE_DIR}
)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(RapidXML DEFAULT_MSG RapidXML_INCLUDE_DIR )
MARK_AS_ADVANCED(RapidXML_INCLUDE_DIR)
ENDIF (RapidXML_INCLUDE_DIR)
# - Find SoQt (Open Inventor Qt Integration)
# SoQt is an implementation of the Open Inventor API.
# It provides data structures and algorithms for 3D visualization
# http://www.coin3d.org/
#
# This module defines the following variables
# SoQt_FOUND - system has SoQt - Open Inventor Qt Integration
# SoQt_INCLUDE_DIRS - where the SoQt include directory can be found
# SoQt_LIBRARIES - Link to this to use SoQt
#
IF (WIN32)
IF (CYGWIN)
FIND_PATH(SoQt_INCLUDE_DIRS Inventor/Qt/SoQt.h)
FIND_LIBRARY(SoQt_LIBRARIES SoQt)
ELSE (CYGWIN)
FIND_PATH(SoQt_INCLUDE_DIRS Inventor/Qt/SoQt.h "$ENV{COINDIR}/include")
FIND_LIBRARY(SoQt_LIBRARY_RELEASE soqt1 "$ENV{COINDIR}/lib")
FIND_LIBRARY(SoQt_LIBRARY_DEBUG soqt1d "$ENV{COINDIR}/lib")
IF (SoQt_LIBRARY_DEBUG AND SoQt_LIBRARY_RELEASE)
SET(SoQt_LIBRARIES optimized ${SoQt_LIBRARY_RELEASE}
debug ${SoQt_LIBRARY_DEBUG})
ELSE (SoQt_LIBRARY_DEBUG AND SoQt_LIBRARY_RELEASE)
IF (SoQt_LIBRARY_DEBUG)
SET (SoQt_LIBRARIES ${SoQt_LIBRARY_DEBUG})
ENDIF (SoQt_LIBRARY_DEBUG)
IF (SoQt_LIBRARY_RELEASE)
SET (SoQt_LIBRARIES ${SoQt_LIBRARY_RELEASE})
ENDIF (SoQt_LIBRARY_RELEASE)
ENDIF (SoQt_LIBRARY_DEBUG AND SoQt_LIBRARY_RELEASE)
ENDIF (CYGWIN)
ELSE (WIN32)
IF(APPLE)
FIND_PATH(SoQt_INCLUDE_DIRS Inventor/Qt/SoQt.h
/Library/Frameworks/Inventor.framework/Headers
)
FIND_LIBRARY(SoQt_LIBRARIES SoQt
/Library/Frameworks/Inventor.framework/Libraries
)
SET(SoQt_LIBRARIES "-framework SoQt" CACHE STRING "SoQt library for OSX")
ELSE(APPLE)
FIND_PATH(SoQt_INCLUDE_DIRS NAMES Inventor/Qt/SoQt.h PATHS "$ENV{SoQt_DIR}/include" "$ENV{COIN3D_DIR}/include" /usr/include /usr/local/include NO_DEFAULT_PATH)
FIND_LIBRARY(SoQt_LIBRARIES NAMES SoQt PATHS "$ENV{SoQt_DIR}/lib" "$ENV{COIN3D_DIR}/lib" /usr/lib /usr/local/lib NO_DEFAULT_PATH)
#FIND_PATH(SoQt_INCLUDE_DIRS Inventor/Qt/SoQt.h $ENV{SoQt_DIR}/include)
#FIND_LIBRARY(SoQt_LIBRARIES SoQt $ENV{SoQt_DIR}/lib)
ENDIF(APPLE)
ENDIF (WIN32)
# handle the QUIETLY and REQUIRED arguments and set SoQt_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SoQt DEFAULT_MSG SoQt_LIBRARIES SoQt_INCLUDE_DIRS)
MARK_AS_ADVANCED(SoQt_INCLUDE_DIRS SoQt_LIBRARIES )
find_library(tinyxml_library tinyxml)
if (tinyxml_library)
message (STATUS " ** Looking for libtinyxml - found")
set(tinyxml_libraries ${tinyxml_library})
endif ()
find_path(tinyxml_include_dirs NAMES tinyxml.h PATH_SUFFIXES tinyxml)
if (NOT tinyxml_include_dirs)
message (STATUS " ** Looking for tinyxml/tinyxml.hpp or tinyxml/tinyxml.h - not found.")
endif ()
if (NOT tinyxml_include_dirs OR NOT tinyxml_libraries)
include (FindPkgConfig)
if (PKG_CONFIG_FOUND)
# Find tinyxml
pkg_check_modules(tinyxml tinyxml)
else()
MESSAGE(STATUS " ** tinyxml not found")
endif()
endif ()
## Copyright (c) 2014, Nikolaus Vahrenkamp (Karlsruhe Institute of Technology)
# set the parameters which are different for an in-source build
set(Simox_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
set(Simox_DATA_PATH "@Simox_DATA_PATH@")
set(Simox_MACROS_INCLUDE_DIR "@Simox_MACROS_INCLUDE_DIR@")
## Copyright (c) 2014, Nikolaus Vahrenkamp (Karlsruhe Institute of Technology)
# - Config file for the Simox package
# It defines the following variables
# Simox_INCLUDE_DIRS - include directories for Simox
# Simox_LIBRARIES - libraries to link against
# Simox_EXECUTABLE - the executables
# Simox_VISUALIZATION - if visualization is enabled
# Simox_USE_COIN_VISUALIZATION - if Coin3D visualization was selected
# Simox_USE_OPENSCENEGRAPH_VISUALIZATION - if osg visualization was selected
# Simox_USE_NLOPT - if NLopt was selected
# SimDynamics_USE_BULLET - if SimDynamics is build and BULLET is selected as physics engine
# SimDynamics_USE_BULLET_DOUBLE_PRECISION - if Bullet is build with double precision support
if(Simox_FOUND)
return()
endif()
set(Simox_FOUND TRUE)
# Compute paths
get_filename_component(Simox_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
# Our library dependencies (contains definitions for IMPORTED targets)
if(NOT TARGET Simox AND NOT Simox_BINARY_DIR)
include("${Simox_CMAKE_DIR}/SimoxTargets.cmake")
include("${Simox_CMAKE_DIR}/SimoxTargetsLegacy.cmake")
endif()
# These are IMPORTED targets created by SimoxTargets.cmake
set(Simox_LIBRARIES "@Simox_LIBRARIES@")
set(Simox_EXECUTABLE "@Simox_EXECUTABLE@")
if(EXISTS "${Simox_CMAKE_DIR}/CMakeCache.txt")
# In build tree
message(STATUS "Using Simox Source-Build from: ${Simox_CMAKE_DIR}")
include("${Simox_CMAKE_DIR}/SimoxBuildTreeSettings.cmake")
# Provide access to CMake helper scripts, e.g., Find... scripts.
# They might be needed as they define specific targets.
list(APPEND CMAKE_MODULE_PATH "${Simox_MACROS_INCLUDE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${Simox_MACROS_INCLUDE_DIR}/find_modules")
else()
# Installed project
message(STATUS "Using Simox Binary Package from: ${Simox_CMAKE_DIR}")
set(Simox_INCLUDE_DIRS "")
foreach (INCLUDE_DIR @CONF_INCLUDE_DIRS@)
LIST(APPEND Simox_INCLUDE_DIRS "${Simox_CMAKE_DIR}/@RELATIVE_INSTALL_DIR@/${INCLUDE_DIR}")
endforeach ()
set(Simox_DATA_PATH "${Simox_CMAKE_DIR}/@RELATIVE_INSTALL_DIR@/@Simox_DATA_PATH@")
set(Simox_MACROS_INCLUDE_DIR "${Simox_CMAKE_DIR}")
endif()
SET(Simox_VISUALIZATION "@Simox_VISUALIZATION@")
SET(Simox_USE_COIN_VISUALIZATION "@Simox_USE_COIN_VISUALIZATION@")
SET(Simox_USE_OPENSCENEGRAPH_VISUALIZATION "@Simox_USE_OPENSCENEGRAPH_VISUALIZATION@")
SET(Simox_USE_COLLADA "@Simox_USE_COLLADA@")
SET(Simox_USE_RBDL_LIB "@Simox_USE_RBDL_LIB@")
SET(Simox_USE_QT5 "ON") # this variable legacy support (Qt5 is now required)
SET(Simox_USE_NLOPT "@Simox_USE_NLOPT@")
SET(SimDynamics_USE_BULLET "@SimDynamics_USE_BULLET@")
SET(SimDynamics_USE_BULLET_DOUBLE_PRECISION "@SimDynamics_USE_BULLET_DOUBLE_PRECISION@")
SET(Simox_BOOST_VERSION "@Simox_BOOST_VERSION@")
FIND_PACKAGE(Eigen3 QUIET)
FIND_PACKAGE(Qt5 5.5.0 COMPONENTS OpenGL Core Gui Widgets QUIET)
FIND_PACKAGE(Boost ${Simox_BOOST_VERSION} EXACT COMPONENTS
filesystem
system
program_options
thread
unit_test_framework
regex
QUIET)
find_package(difflib QUIET)
find_package(doctest QUIET)
find_package(nlohmann_json 3.11.3 REQUIRED)
find_package(RBDL QUIET)
find_package(pugixml QUIET)
FIND_PACKAGE(SoQt QUIET)
if (NOT (Simox_FIND_QUIETLY OR VirtualRobot_FIND_QUIETLY))
MESSAGE(STATUS " * Including ${Simox_MACROS_INCLUDE_DIR}/SimoxMacros.cmake")
endif()
include(${Simox_MACROS_INCLUDE_DIR}/SimoxMacros.cmake)
## Copyright (c) 2011, Karlsruhe Institute of Technology (Manfred Kroehnert)
set(PACKAGE_VERSION "@VIRTUAL_ROBOT_VERSION@")
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
\ No newline at end of file
## Copyright (c) 2014, Nikolaus Vahrenkamp (Karlsruhe Institute of Technology)
set(PACKAGE_VERSION "@Simox_VERSION@")
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
# Build and helper macros
function(VirtualRobotApplication name srcs incs)
################################## EXECUTABLE ##############################
ADD_EXECUTABLE(${name} ${srcs} ${incs})
target_include_directories(${name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
TARGET_LINK_LIBRARIES(${name} PUBLIC VirtualRobot)
endfunction()
function(VirtualRobotQtApplication name srcs incs mocFiles uiFiles)
set(CMAKE_AUTOMOC "YES")
set(CMAKE_AUTOUIC "YES")
set(generatedUiFiles ${uiFiles})
set(generatedMocFiles ${mocFiles})
################################## EXECUTABLE ##############################
ADD_EXECUTABLE(${name} ${srcs} ${incs} ${generatedUiFiles} ${generatedMocFiles})
target_include_directories(${name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
FIND_PACKAGE(SoQt REQUIRED)
TARGET_LINK_LIBRARIES(${name} PUBLIC VirtualRobot SoQt::SoQt)
endfunction()
function(VirtualRobotQtLibrary name srcs incs mocFiles uiFiles)
set(generatedUiFiles ${uiFiles})
set(generatedMocFiles ${mocFiles})
set(CMAKE_AUTOMOC "YES")
set(CMAKE_AUTOUIC "YES")
################################## LIBRARY ##############################
ADD_LIBRARY(${name} SHARED ${srcs} ${incs} ${generatedUiFiles} ${generatedMocFiles})
target_include_directories(${name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
TARGET_LINK_LIBRARIES(${name} PUBLIC VirtualRobot)
endfunction()
function(SimoxApplication name srcs incs)
VirtualRobotApplication("${name}" "${srcs}" "${incs}")
# add Saba and GraspStudio
TARGET_LINK_LIBRARIES(${name} PUBLIC GraspStudio Saba)
endfunction()
function(SimoxQtApplication name srcs incs mocFiles uiFiles)
VirtualRobotQtApplication("${name}" "${srcs}" "${incs}" "${mocFiles}" "${uiFiles}")
# add Saba and GraspStudio
TARGET_LINK_LIBRARIES(${name} PUBLIC GraspStudio Saba)
endfunction()
function(SimoxQtLibrary name srcs incs mocFiles uiFiles)
VirtualRobotQtLibrary("${name}" "${srcs}" "${incs}" "${mocFiles}" "${uiFiles}")
# add Saba and GraspStudio
TARGET_LINK_LIBRARIES(${name} PUBLIC GraspStudio Saba)
endfunction()
function(simox_subdirs RESULT DIRECTORY)
file(GLOB CHILDREN ${DIRECTORY}/*)
# message("## children of ${DIRECTORY}: ${CHILDREN}")
set(DIR_CHILDREN "")
foreach(CHILD ${CHILDREN})
if (IS_DIRECTORY "${CHILD}")
list(APPEND DIR_CHILDREN ${CHILD})
endif()
endforeach()
set(${RESULT} "${DIR_CHILDREN}" PARENT_SCOPE)
endfunction()
function(simox_subdirs_recursive RESULT DIRECTORY)
simox_subdirs(TOP_CHILDREN "${DIRECTORY}")
set(ALL_CHILDREN ${TOP_CHILDREN})
foreach(TOP_CHILD ${TOP_CHILDREN})
simox_subdirs_recursive(REC_CHILDREN ${TOP_CHILD})
list(APPEND ALL_CHILDREN ${REC_CHILDREN})
endforeach()
set(${RESULT} "${ALL_CHILDREN}" PARENT_SCOPE)
endfunction()
macro(simox_update_file file content) #macro since we want to provide simox_file_up_to_date
set(simox_file_up_to_date 0)
if(EXISTS "${file}")
file(SHA512 "${file}" _simox_file_sha)
string(SHA512 _simox_cont_sha "${content}")
if("${_simox_cont_sha}" STREQUAL "${_simox_file_sha}")
set(simox_file_up_to_date 1)
endif()
endif()
#write file
if(${simox_file_up_to_date} EQUAL 0)
file(WRITE "${file}" "${content}")
endif()
endmacro()
macro(simox_generate_subdir_headers dir prefix_to_remove out_headers)
string(REPLACE "//" "/" prefix_to_remove_fixed "${prefix_to_remove}/")
string(REPLACE "${prefix_to_remove_fixed}" "" dir_rel "${dir}")
_simox_generate_subdir_headers_impl("${dir}" "${prefix_to_remove_fixed}" ${out_headers})
endmacro()
macro(_simox_generate_subdir_headers_impl dir prefix_to_remove out_headers)
simox_subdirs(subdirs ${dir})
foreach(subdir ${subdirs})
#recurse
_simox_generate_subdir_headers_impl("${subdir}" "${prefix_to_remove}" ${out_headers})
file(GLOB headers ${subdir}/*.h)
list(LENGTH headers n)
string(REGEX REPLACE ".*/" "" subdir_name "${subdir}")
if(
NOT ${n} EQUAL 0 AND
NOT "${subdir_name}" STREQUAL "detail" AND
NOT "${subdir_name}" STREQUAL "_detail" AND
NOT "${subdir_name}" STREQUAL "internal" AND
NOT "${subdir_name}" STREQUAL "_internal"
)
set(subdir_header_abs "${subdir}.h")
string(REPLACE "${prefix_to_remove}" "" subdir_header "${subdir_header_abs}")
list(APPEND ${out_headers} ${subdir_header})
#create file content
set(content "#pragma once\n\n// This file is generated!\n\n")
foreach(header ${headers})
string(REPLACE "${subdir}/" "${subdir_name}/" h "${header}")
set(content "${content}#include \"${h}\" // IWYU pragma: export\n")
endforeach()
#check for file change
simox_update_file("${subdir_header_abs}" "${content}")
endif()
endforeach()
endmacro()
# Macros for Simox executables
function(simox_add_executable PROJECT_NAME SOURCES HEADERS GUI_MOC_HDRS GUI_UIS)
LINK_DIRECTORIES(${SIMOX_LIB_DIR})
# QT stuff
qt4_wrap_cpp(SOURCES ${GUI_MOC_HDRS})
qt4_wrap_ui(UI_HEADER ${GUI_UIS})
get_filename_component(UI_HEADER_DIR ${UI_HEADER} PATH)
list(APPEND HEADERS ${UI_HEADER})
include_directories(${UI_HEADER_DIR})
# setup target
ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES} ${HEADERS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SIMOX_BIN_DIR})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} VirtualRobot Saba GraspStudio ${QT_LIBRARIES} ${COIN3D_LIBRARIES} ${SoQt_LIBRARIES})
INCLUDE_DIRECTORIES(${SoQt_INCLUDE_DIRS})
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(-DSOQT_DLL)
MESSAGE( STATUS ${PROJECT_NAME} " will be placed into " ${SIMOX_BIN_DIR})
endfunction()
// This file is generated using cmake configure_file!
#pragma once
#include <type_traits> // IWYU pragma: keep
//implementation namespace
namespace simox::meta::member::method::@NAME@::impl
{
template<class Class, class RType, class...Ps>
RType type_fn(RType(Class::*)(Ps...));
template<class T>
using ret_t = decltype(type_fn(&T::@NAME@));
template<class T, class = void>
struct member_rtype {};
template<class T>
struct member_rtype<T, std::void_t<ret_t<T>>>
{
using type = ret_t<T>;
};
template<class T, class = void>
struct member_exists : std::false_type {};
template<class T>
struct member_exists<T, std::void_t<ret_t<T>>> : std::true_type {};
}
//meta fncs namespaced by class
namespace simox::meta::member::method::@NAME@
{
template<class T> using exists = impl::member_exists<T>;
template<class T> static constexpr bool exists_v = exists<T>::value;
template<class T> using return_type = impl::member_rtype<T>;
template<class T> using return_type_t = typename return_type<T>::type;
}
//exists_v
namespace simox::meta::member::method::exists_v
{
template<class T>
static constexpr bool @NAME@ = ::simox::meta::member::method::@NAME@::exists_v<T>;
}
//concept
namespace simox::meta::member::method::ccept
{
template<class T>
concept @NAME@ = ::simox::meta::member::method::@NAME@::exists_v<T>;
}
//return_type_t
namespace simox::meta::member::method::return_type_t
{
template<class T>
using @NAME@ = simox::meta::member::method::@NAME@::return_type_t<T>;
}
// This file is generated using cmake configure_file!
#pragma once
#include <type_traits> // IWYU pragma: keep
//implementation namespace
namespace simox::meta::member::static_method::@NAME@::impl
{
template<class RType, class...Ps>
RType type_fn(RType(*)(Ps...));
template<class T>
using ret_t = decltype(type_fn(&T::@NAME@));
template<class T, class = void>
struct member_rtype {};
template<class T>
struct member_rtype<T, std::void_t<ret_t<T>>>
{
using type = ret_t<T>;
};
template<class T, class = void>
struct member_exists : std::false_type {};
template<class T>
struct member_exists<T, std::void_t<ret_t<T>>> : std::true_type {};
}
//meta fncs namespaced by class
namespace simox::meta::member::static_method::@NAME@
{
template<class T> using exists = impl::member_exists<T>;
template<class T> static constexpr bool exists_v = exists<T>::value;
template<class T> using return_type = impl::member_rtype<T>;
template<class T> using return_type_t = typename return_type<T>::type;
}
//exists_v
namespace simox::meta::member::static_method::exists_v
{
template<class T>
static constexpr bool @NAME@ = ::simox::meta::member::static_method::@NAME@::exists_v<T>;
}
//concept
namespace simox::meta::member::static_method::ccept
{
template<class T>
concept @NAME@ = ::simox::meta::member::static_method::@NAME@::exists_v<T>;
}
//return_type_t
namespace simox::meta::member::static_method::return_type_t
{
template<class T>
using @NAME@ = simox::meta::member::static_method::@NAME@::return_type_t<T>;
}