From 2efd6da597c34dab76b3432f55c30ea64d24d965 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Tue, 9 Nov 2021 17:23:17 +0800 Subject: [PATCH 01/29] migrated main lib and unit tests Signed-off-by: Teo Koon Peng --- CMakeLists.txt | 314 +++--------------- cmake/SDFUtils.cmake | 31 +- cmake/SearchForStuff.cmake | 53 +-- cmake/cpack_options.cmake.in | 23 -- cmake/sdf_config.cmake.in | 44 --- cmake/sdf_cpack.cmake | 25 -- include/CMakeLists.txt | 1 + include/sdf/CMakeLists.txt | 74 +---- .../sdf/config.hh.in | 0 src/CMakeLists.txt | 93 +++--- test/CMakeLists.txt | 4 +- test/integration/CMakeLists.txt | 2 +- test/performance/CMakeLists.txt | 2 +- 13 files changed, 120 insertions(+), 546 deletions(-) delete mode 100644 cmake/cpack_options.cmake.in delete mode 100644 cmake/sdf_config.cmake.in delete mode 100644 cmake/sdf_cpack.cmake create mode 100644 include/CMakeLists.txt rename cmake/sdf_config.h.in => include/sdf/config.hh.in (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8df75d17d..e762558c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ if(UNIX AND NOT WIN32) endif(CMAKE_UNAME) endif() -project (sdformat13) +project (sdformat13 VERSION 13.0) # The protocol version has nothing to do with the package version set below. # It represents the current version of sdformat implement by the software @@ -45,15 +45,6 @@ set (project_cmake_dir ${PROJECT_SOURCE_DIR}/cmake message (STATUS "${PROJECT_NAME} version ${SDF_VERSION_FULL}") set (CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) -#============================================================================ -# We turn off extensions because (1) we do not ever want to use non-standard -# compiler extensions, and (2) this variable is on by default, causing cmake -# to choose the flag -std=gnu++14 instead of -std=c++14 when the C++14 -# features are requested. Explicitly turning this flag off will force cmake to -# choose -std=c++14. -# See https://github.com/ignitionrobotics/ign-cmake/issues/13 for more info. -set(CMAKE_CXX_EXTENSIONS off) - # Include GNUInstallDirs to get canonical paths include(GNUInstallDirs) @@ -72,38 +63,15 @@ endif() set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/sdformat-${SDF_VERSION}/sdf") set (LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING "Installation directory for libraries (relative to CMAKE_INSTALL_PREFIX)") set (BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR} CACHE STRING "Installation directory for binaries (relative to CMAKE_INSTALL_PREFIX)") -set (USE_FULL_RPATH OFF CACHE BOOL "Set to true to enable full rpath") - -set(PKG_NAME SDFormat) -set(sdf_target sdformat${SDF_MAJOR_VERSION}) -set(sdf_config_install_dir "${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME_LOWER}/") -set(sdf_import_target_name ${PROJECT_EXPORT_NAME}::${sdf_target}) -set(sdf_target_output_filename "${sdf_target}-targets.cmake") +# set(PKG_NAME SDFormat) +# set(sdf_target sdformat${SDF_MAJOR_VERSION}) +# set(sdf_config_install_dir "${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME_LOWER}/") +# set(sdf_import_target_name ${PROJECT_EXPORT_NAME}::${sdf_target}) +# set(sdf_target_output_filename "${sdf_target}-targets.cmake") OPTION(SDFORMAT_DISABLE_CONSOLE_LOGFILE "Disable the sdformat console logfile" OFF) -if (USE_FULL_RPATH) - # 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 "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_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 its not a system directory - list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}" isSystemDir) - if("${isSystemDir}" STREQUAL "-1") - set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}") - endif("${isSystemDir}" STREQUAL "-1") -endif() - set (BUILD_SDF ON CACHE INTERNAL "Build SDF" FORCE) set (build_errors "" CACHE INTERNAL "build errors" FORCE) set (build_warnings "" CACHE INTERNAL "build warnings" FORCE) @@ -116,248 +84,58 @@ include (${sdf_cmake_dir}/SDFUtils.cmake) include (${sdf_cmake_dir}/SearchForStuff.cmake) message (STATUS "----------------------------------------\n") -##################################### -# Set the default build type -if (NOT CMAKE_BUILD_TYPE) - set (CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING - "Choose the type of build, options are: Debug Release RelWithDebInfo Profile Check" FORCE) -endif (NOT CMAKE_BUILD_TYPE) -string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPERCASE) - -set (BUILD_TYPE_PROFILE FALSE) -set (BUILD_TYPE_RELEASE FALSE) -set (BUILD_TYPE_RELWITHDEBINFO FALSE) -set (BUILD_TYPE_DEBUG FALSE) - -if ("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "PROFILE") - set (BUILD_TYPE_PROFILE TRUE) -elseif ("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "RELEASE") - set (BUILD_TYPE_RELEASE TRUE) -elseif ("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "RELWITHDEBINFO") - set (BUILD_TYPE_RELWITHDEBINFO TRUE) -elseif ("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "DEBUG") - set (BUILD_TYPE_DEBUG TRUE) -elseif ("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "COVERAGE") - include (${project_cmake_dir}/CodeCoverage.cmake) - set (BUILD_TYPE_DEBUG TRUE) - SETUP_TARGET_FOR_COVERAGE(coverage ctest coverage) -else() - # NONE is a valid CMAKE_BUILD_TYPE - if (NOT "${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "NONE") - build_error("CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} unknown. Valid options are: Debug Release RelWithDebInfo Profile Coverage None") - endif() -endif() - -#============================================================================ -# Ask whether we should make a shared or static library. -option(BUILD_SHARED_LIBS "Set this to true to generate shared libraries (recommended), or false for static libraries" ON) - -##################################### -# Handle CFlags -unset (CMAKE_C_FLAGS_ALL CACHE) - -# USE_HOST_CFLAGS (default TRUE) -# Will check building host machine for proper cflags -if(NOT DEFINED USE_HOST_CFLAGS OR USE_HOST_CFLAGS) - message(STATUS "Enable host CFlags") - include (${project_cmake_dir}/HostCFlags.cmake) -endif() - -# USE_UPSTREAM_CFLAGS (default TRUE) -# Will use predefined ignition developers cflags -if(NOT DEFINED USE_UPSTREAM_CFLAGS OR USE_UPSTREAM_CFLAGS) - message(STATUS "Enable upstream CFlags") - include(${project_cmake_dir}/DefaultCFlags.cmake) -endif() - -# Check if warning options are avaliable for the compiler and return WARNING_CXX_FLAGS variable -if (MSVC) - set(WARN_LEVEL "/W4") - - # Unable to be filtered flags (failing due to limitations in filter_valid_compiler_warnings) - # Handling exceptions rightly and ignore unknown pragmas - set(UNFILTERED_FLAGS "/EHsc /wd4068") -else() - # Equivalent to Wall (according to man gcc) but removed the unknown pragmas since we use - # MSVC only pragmas all over the code - list(APPEND WARN_LEVEL -Waddress -Warray-bounds -Wcomment -Wformat -Wnonnull) - list(APPEND WARN_LEVEL -Wparentheses -Wreorder -Wreturn-type) - list(APPEND WARN_LEVEL -Wsequence-point -Wsign-compare -Wstrict-aliasing) - list(APPEND WARN_LEVEL -Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wuninitialized) - list(APPEND WARN_LEVEL -Wunused-function -Wunused-label -Wunused-value) - list(APPEND WARN_LEVEL -Wunused-variable -Wvolatile-register-var) - - # Unable to be filtered flags (failing due to limitations in filter_valid_compiler_warnings) - set(UNFILTERED_FLAGS "-Wc++17-compat") -endif() - -filter_valid_compiler_warnings(${WARN_LEVEL} -Wextra -Wno-long-long - -Wno-unused-value -Wno-unused-value -Wno-unused-value -Wno-unused-value - -Wfloat-equal -Wshadow -Winit-self -Wswitch-default - -Wmissing-include-dirs -pedantic -Wno-pragmas) -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${WARNING_CXX_FLAGS} ${UNFILTERED_FLAGS}") - ################################################# # OS Specific initialization -if (UNIX) - sdf_setup_unix() -endif () - if (WIN32) sdf_setup_windows() endif () -if (APPLE) - sdf_setup_apple() -endif () - -################################################# -# Print warnings and errors -if ( build_warnings ) - message(WARNING "-- BUILD WARNINGS") - foreach (msg ${build_warnings}) - message(WARNING "-- ${msg}") - endforeach () - message(WARNING "-- END BUILD WARNINGS\n") -endif (build_warnings) - -########### Add uninstall target ############### -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake" - IMMEDIATE @ONLY) -add_custom_target(uninstall - "${CMAKE_COMMAND}" -P - "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake") - -if (build_errors) - message(SEND_ERROR "-- BUILD ERRORS: These must be resolved before compiling.") - foreach (msg ${build_errors}) - message(SEND_ERROR "-- ${msg}") - endforeach () - message(SEND_ERROR "-- END BUILD ERRORS\n") - message (FATAL_ERROR "Errors encountered in build. Please see the BUILD ERRORS above.") - -else (build_errors) - - ######################################## - # Write the config.h file - configure_file (${sdf_cmake_dir}/sdf_config.h.in - ${PROJECT_BINARY_DIR}/sdf/sdf_config.h) - sdf_install_includes("" ${PROJECT_BINARY_DIR}/sdf/sdf_config.h) - - message (STATUS "C Flags:${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}") - message (STATUS "Build Type: ${CMAKE_BUILD_TYPE}") - message (STATUS "Install path: ${CMAKE_INSTALL_PREFIX}") - - if (BUILD_SDF) - include_directories(include - ${PROJECT_BINARY_DIR} - ${PROJECT_BINARY_DIR}/include - ) - - link_directories(${PROJECT_BINARY_DIR}/src) - - if (NOT DEFINED BUILD_TESTING OR BUILD_TESTING) - set(BUILD_SDF_TEST TRUE) - else() - set(BUILD_SDF_TEST FALSE) - endif() - - if (BUILD_SDF_TEST) - add_subdirectory(test) - endif() - add_subdirectory(src) - add_subdirectory(include/sdf) - add_subdirectory(sdf) - add_subdirectory(conf) - add_subdirectory(doc) - endif(BUILD_SDF) - - ######################################## - # Setup Codecheck - include (IgnCodeCheck) - set(CPPCHECK_DIRS - ${PROJECT_SOURCE_DIR}/src - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_SOURCE_DIR}/test/integration - ${PROJECT_SOURCE_DIR}/test/performance) - - set(CPPCHECK_INCLUDE_DIRS +if (BUILD_SDF) + include_directories(include ${PROJECT_BINARY_DIR} - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_SOURCE_DIR}/test/integration - ${PROJECT_SOURCE_DIR}/test/performance) - - # Ignore vendored directories. - file(WRITE ${PROJECT_BINARY_DIR}/cppcheck.suppress - "*:${PROJECT_SOURCE_DIR}/src/urdf/*\n" + ${PROJECT_BINARY_DIR}/include ) - ign_setup_target_for_codecheck() - - ######################################## - # Make the package config file - set(PC_CONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/pkgconfig) - file(RELATIVE_PATH - PC_CONFIG_RELATIVE_PATH_TO_PREFIX - "${CMAKE_INSTALL_PREFIX}/${PC_CONFIG_INSTALL_DIR}" - "${CMAKE_INSTALL_PREFIX}" - ) - configure_file(${CMAKE_SOURCE_DIR}/cmake/sdformat_pc.in - ${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME_LOWER}.pc @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME_LOWER}.pc DESTINATION - ${PC_CONFIG_INSTALL_DIR} COMPONENT pkgconfig) - ######################################## - # Configure documentation uploader - configure_file("${CMAKE_SOURCE_DIR}/cmake/upload_doc.sh.in" - ${CMAKE_BINARY_DIR}/upload_doc.sh @ONLY) + link_directories(${PROJECT_BINARY_DIR}/src) - ######################################## - # Make the cmake config files - set(sdf_config_input "${CMAKE_CURRENT_SOURCE_DIR}/cmake/sdf_config.cmake.in") - set(sdf_config_output "cmake/${sdf_target}-config.cmake") - set(sdf_version_output "cmake/${sdf_target}-config-version.cmake") - set(sdf_config_install_dir "${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME_LOWER}/") - - include(CMakePackageConfigHelpers) - #-------------------------------------- - # Configure and install the config file - configure_package_config_file( - ${sdf_config_input} - ${sdf_config_output} - INSTALL_DESTINATION ${sdf_config_install_dir} - NO_CHECK_REQUIRED_COMPONENTS_MACRO) - - #-------------------------------------- - # Configure and install the version file - write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/${sdf_version_output} - VERSION "${SDF_VERSION_FULL}" - COMPATIBILITY SameMajorVersion) + if (NOT DEFINED BUILD_TESTING OR BUILD_TESTING) + set(BUILD_SDF_TEST TRUE) + else() + set(BUILD_SDF_TEST FALSE) + endif() - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${sdf_config_output} - ${CMAKE_CURRENT_BINARY_DIR}/${sdf_version_output} - DESTINATION ${sdf_config_install_dir} - COMPONENT cmake) + ign_configure_project(NO_IGNITION_PREFIX) + ign_configure_build(QUIT_IF_BUILD_ERRORS) + ign_create_packages() + ign_create_docs() + + # TODO: add header that redirects "sdf/sdf_config.h" to "${ignitin_prefix}/sdformat/config.hh" + # install( + # FILES + # ${PROJECT_BINARY_DIR}/sdf/sdf_config.h + # DESTINATION + # ${IGN_INCLUDE_INSTALL_DIR_FULL}/sdf + # ) + + if (BUILD_SDF_TEST) + # add_subdirectory(test) + endif() + add_subdirectory(sdf) + add_subdirectory(conf) + add_subdirectory(doc) +endif(BUILD_SDF) - ######################################## - # Package Creation: - include (${sdf_cmake_dir}/sdf_cpack.cmake) - set (CPACK_PACKAGE_VERSION "${SDF_VERSION_FULL}") - set (CPACK_PACKAGE_VERSION_MAJOR "${SDF_MAJOR_VERSION}") - set (CPACK_PACKAGE_VERSION_MINOR "${SDF_MINOR_VERSION}") - set (CPACK_PACKAGE_VERSION_PATCH "${SDF_PATCH_VERSION}") +######################################## +# Setup Codecheck - if (CPACK_GENERATOR) - message(STATUS "Found CPack generators: ${CPACK_GENERATOR}") +# Ignore vendored directories. +file(WRITE ${PROJECT_BINARY_DIR}/cppcheck.suppress + "*:${PROJECT_SOURCE_DIR}/src/urdf/*\n" + ) - configure_file("${sdf_cmake_dir}/cpack_options.cmake.in" - ${SDF_CPACK_CFG_FILE} @ONLY) - set(CPACK_PROJECT_CONFIG_FILE ${SDF_CPACK_CFG_FILE}) - include (CPack) - endif() +######################################## +# Configure documentation uploader +configure_file("${CMAKE_SOURCE_DIR}/cmake/upload_doc.sh.in" + ${CMAKE_BINARY_DIR}/upload_doc.sh @ONLY) - message(STATUS "Configuration successful. Type make to compile sdf") -endif(build_errors) +message(STATUS "Configuration successful. Type make to compile sdf") diff --git a/cmake/SDFUtils.cmake b/cmake/SDFUtils.cmake index 21ac67827..6c8c51d2e 100644 --- a/cmake/SDFUtils.cmake +++ b/cmake/SDFUtils.cmake @@ -29,26 +29,6 @@ MACRO (LIST_TO_STRING _string _list) #STRING(STRIP ${${_string}} ${_string}) ENDMACRO (LIST_TO_STRING) -################################################# -# BUILD ERROR macro -macro (BUILD_ERROR) - foreach (str ${ARGN}) - SET (msg "\t${str}") - MESSAGE (STATUS ${msg}) - APPEND_TO_CACHED_LIST(build_errors "build errors" ${msg}) - endforeach () -endmacro (BUILD_ERROR) - -################################################# -# BUILD WARNING macro -macro (BUILD_WARNING) - foreach (str ${ARGN}) - SET (msg "\t${str}" ) - MESSAGE (STATUS ${msg} ) - APPEND_TO_CACHED_LIST(build_warnings "build warning" ${msg}) - endforeach (str ${ARGN}) -endmacro (BUILD_WARNING) - ################################################# macro (sdf_add_library _name) set(LIBS_DESTINATION ${PROJECT_BINARY_DIR}/src) @@ -107,24 +87,15 @@ macro (sdf_install_executable _name) install (TARGETS ${_name} DESTINATION ${BIN_INSTALL_DIR}) endmacro () -################################################# -macro (sdf_setup_unix) -endmacro() - ################################################# macro (sdf_setup_windows) # Need for M_PI constant - add_definitions(-D_USE_MATH_DEFINES -DWINDOWS_LEAN_AND_MEAN) + add_definitions(-D_USE_MATH_DEFINES) # And force linking to MSVC dynamic runtime set(CMAKE_C_FLAGS_DEBUG "/MDd ${CMAKE_C_FLAGS_DEBUG}") set(CMAKE_C_FLAGS_RELEASE "/MD ${CMAKE_C_FLAGS_RELEASE}") endmacro() -################################################# -macro (sdf_setup_apple) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined -Wl,dynamic_lookup") -endmacro() - ################################################# # VAR: SDF_BUILD_TESTS_EXTRA_EXE_SRCS # Hack: extra sources to build binaries can be supplied to gz_build_tests in diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 54bcc61db..224c9aba2 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -5,6 +5,11 @@ include (${project_cmake_dir}/TargetArch.cmake) target_architecture(ARCH) message(STATUS "Building for arch: ${ARCH}") +################################################# +# Find ign-cmake +find_package(ignition-cmake2 2.9 REQUIRED) +set(IGN_CMAKE_VER ${ignition-cmake2_VERSION_MAJOR}) + ################################################# # Find tinyxml2. list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") @@ -19,10 +24,10 @@ find_package(TinyXML2 REQUIRED) if (NOT PKG_CONFIG_FOUND) if (NOT DEFINED USE_INTERNAL_URDF) - BUILD_WARNING("Couldn't find pkg-config for urdfdom, using internal copy") + ign_build_warning("Couldn't find pkg-config for urdfdom, using internal copy") set(USE_INTERNAL_URDF true) elseif(NOT USE_INTERNAL_URDF) - BUILD_ERROR("Couldn't find pkg-config for urdfdom") + ign_build_error("Couldn't find pkg-config for urdfdom") endif() endif() @@ -41,7 +46,7 @@ if (NOT DEFINED USE_INTERNAL_URDF OR NOT USE_INTERNAL_URDF) message(STATUS "Couldn't find urdfdom >= 1.0, using internal copy") set(USE_INTERNAL_URDF true) else() - BUILD_ERROR("Couldn't find the urdfdom >= 1.0 system installation") + ign_build_error("Couldn't find the urdfdom >= 1.0 system installation") endif() else() # what am I doing here? pkg-config and cmake @@ -52,14 +57,7 @@ endif() ################################################# # Find ign command line utility: -find_package(ignition-tools) -if (IGNITION-TOOLS_BINARY_DIRS) - message(STATUS "Looking for ignition-tools-config.cmake - found") -else() - BUILD_WARNING ("ignition-tools not found, for command line utilities and for \ -generating aggregated SDFormat descriptions for sdformat.org, please install \ -ignition-tools.") -endif() +ign_find_package(ignition-tools) ################################################ # Find the Python interpreter for running the @@ -70,7 +68,7 @@ find_package(PythonInterp 3 QUIET) # Find psutil python package for memory tests find_python_module(psutil) if(NOT PY_PSUTIL) - BUILD_WARNING("Python psutil package not found. Memory leak tests will be skipped") + ign_build_warning("Python psutil package not found. Memory leak tests will be skipped") endif() ################################################ @@ -80,14 +78,14 @@ find_program(VALGRIND_PROGRAM NAMES valgrind PATH ${VALGRIND_ROOT}/bin) option(SDFORMAT_RUN_VALGRIND_TESTS "Run sdformat tests with Valgrind" FALSE) mark_as_advanced(SDFORMAT_RUN_VALGRIND_TESTS) if (SDFORMAT_RUN_VALGRIND_TESTS AND NOT VALGRIND_PROGRAM) - BUILD_WARNING("valgrind not found. Memory check tests will be skipped.") + ign_build_warning("valgrind not found. Memory check tests will be skipped.") endif() ################################################ # Find ruby executable to produce xml schemas find_program(RUBY ruby) if (NOT RUBY) - BUILD_ERROR ("Ruby version 1.9 is needed to build xml schemas") + ign_build_error ("Ruby version 1.9 is needed to build xml schemas") else() message(STATUS "Found ruby executable: ${RUBY}") endif() @@ -102,32 +100,17 @@ endmacro() ######################################## # Find ignition cmake2 -# Only for using the testing macros and creating the codecheck target, not -# really being use to configure the whole project -find_package(ignition-cmake2 2.3 REQUIRED) -set(IGN_CMAKE_VER ${ignition-cmake2_VERSION_MAJOR}) +find_package(ignition-cmake2 2.9 REQUIRED) + ######################################## # Find ignition math # Set a variable for generating ProjectConfig.cmake -find_package(ignition-math6 6.8 QUIET) -if (NOT ignition-math6_FOUND) - message(STATUS "Looking for ignition-math6-config.cmake - not found") - BUILD_ERROR ("Missing: Ignition math (libignition-math6-dev)") -else() - set(IGN_MATH_VER ${ignition-math6_VERSION_MAJOR}) - message(STATUS "Looking for ignition-math${IGN_MATH_VER}-config.cmake - found") -endif() +ign_find_package(ignition-math6 VERSION 6.8 QUIET) +set(IGN_MATH_VER ${ignition-math6_VERSION_MAJOR}) ######################################## # Find ignition utils # Set a variable for generating ProjectConfig.cmake -find_package(ignition-utils1 QUIET) -if (NOT ignition-utils1_FOUND) - message(STATUS "Looking for ignition-utils1-config.cmake - not found") - BUILD_ERROR ("Missing: Ignition utils(libignition-utils1-dev)") -else() - set(IGN_UTILS_VER ${ignition-utils1_VERSION_MAJOR}) - message(STATUS "Looking for ignition-utils${IGN_UTILS_VER}-config.cmake - found") -endif() - +ign_find_package(ignition-utils1 QUIET) +set(IGN_UTILS_VER ${ignition-utils1_VERSION_MAJOR}) diff --git a/cmake/cpack_options.cmake.in b/cmake/cpack_options.cmake.in deleted file mode 100644 index b5cb6d5c1..000000000 --- a/cmake/cpack_options.cmake.in +++ /dev/null @@ -1,23 +0,0 @@ -set(CPACK_PACKAGE_NAME "@PROJECT_NAME_NO_VERSION@") -set(CPACK_PACKAGE_VENDOR "sdformat.org") -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Scene Description Format (SDF)") -set(CPACK_PACKAGE_INSTALL_DIRECTORY "@PROJECT_NAME_NO_VERSION_LOWER@") -set(CPACK_RESOURCE_FILE_LICENSE "@CMAKE_CURRENT_SOURCE_DIR@/LICENSE") -set(CPACK_RESOURCE_FILE_README "@CMAKE_CURRENT_SOURCE_DIR@/README.md") -set(CPACK_PACKAGE_DESCRIPTION_FILE "@CMAKE_CURRENT_SOURCE_DIR@/README.md") -set(CPACK_PACKAGE_MAINTAINER "Nate Koenig ") -set(CPACK_PACKAGE_CONTACT "Nate Koenig ") - -set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "@DPKG_ARCH@") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "@DEBIAN_PACKAGE_DEPENDS@") -set(CPACK_DEBIAN_PACKAGE_SECTION "devel") -set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") -set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) -set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Format and parser for scene description files.") - -set(CPACK_RPM_PACKAGE_ARCHITECTURE "@DPKG_ARCH@") -set(CPACK_RPM_PACKAGE_REQUIRES "@DEBIAN_PACKAGE_DEPENDS@") -set(CPACK_RPM_PACKAGE_DESCRIPTION "Format and parser for scene description files.") - -set (CPACK_PACKAGE_FILE_NAME "@PROJECT_NAME_NO_VERSION_LOWER@-@SDF_VERSION_FULL@") -set (CPACK_SOURCE_PACKAGE_FILE_NAME "@PROJECT_NAME_NO_VERSION_LOWER@-@SDF_VERSION_FULL@") diff --git a/cmake/sdf_config.cmake.in b/cmake/sdf_config.cmake.in deleted file mode 100644 index eea1d4022..000000000 --- a/cmake/sdf_config.cmake.in +++ /dev/null @@ -1,44 +0,0 @@ -# We explicitly set the desired cmake version to ensure that the policy settings -# of users or of toolchains do not result in the wrong behavior for our modules. -# Note that the call to find_package(~) will PUSH a new policy stack before -# taking on these version settings, and then that stack will POP after the -# find_package(~) has exited, so this will not affect the cmake policy settings -# of a caller. -cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) - -if(@PKG_NAME@_CONFIG_INCLUDED) - return() -endif() -set(@PKG_NAME@_CONFIG_INCLUDED TRUE) - -@PACKAGE_INIT@ - -if(NOT TARGET @sdf_import_target_name@) - include("${CMAKE_CURRENT_LIST_DIR}/@sdf_target_output_filename@") -endif() - -list(APPEND @PKG_NAME@_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include/sdformat-@SDF_VERSION@") - -list(APPEND @PKG_NAME@_CFLAGS "-I${PACKAGE_PREFIX_DIR}/include/sdformat-@SDF_VERSION@") -if (NOT WIN32) - list(APPEND @PKG_NAME@_CXX_FLAGS "${@PKG_NAME@_CFLAGS} -std=c++17") -endif() - -list(APPEND @PKG_NAME@_LIBRARY_DIRS "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@") - -set(@PKG_NAME@_LIBRARIES @sdf_import_target_name@) - -# These variables are used by ignition-cmake to automatically configure the -# pkgconfig files for ignition projects. -set(@PROJECT_NAME_LOWER@_PKGCONFIG_ENTRY "@PROJECT_NAME_LOWER@") -set(@PROJECT_NAME_LOWER@_PKGCONFIG_TYPE PKGCONFIG_REQUIRES) - -find_package(ignition-math@IGN_MATH_VER@) -list(APPEND @PKG_NAME@_INCLUDE_DIRS ${IGNITION-MATH_INCLUDE_DIRS}) -list(APPEND @PKG_NAME@_LIBRARY_DIRS ${IGNITION-MATH_LIBRARY_DIRS}) - -find_package(ignition-utils@IGN_UTILS_VER@) -list(APPEND @PKG_NAME@_INCLUDE_DIRS ${IGNITION-UTILS_INCLUDE_DIRS}) -list(APPEND @PKG_NAME@_LIBRARY_DIRS ${IGNITION-UTILS_LIBRARY_DIRS}) - -list(APPEND @PKG_NAME@_LDFLAGS "-L${PACKAGE_PREFIX_DIR}/@LIB_INSTALL_DIR@") diff --git a/cmake/sdf_cpack.cmake b/cmake/sdf_cpack.cmake deleted file mode 100644 index 6267aae34..000000000 --- a/cmake/sdf_cpack.cmake +++ /dev/null @@ -1,25 +0,0 @@ -################################################################################ -#Find available package generators - -# DEB -if ("${CMAKE_SYSTEM}" MATCHES "Linux") - find_program(DPKG_PROGRAM dpkg) - if (EXISTS ${DPKG_PROGRAM}) - list (APPEND CPACK_GENERATOR "DEB") - endif(EXISTS ${DPKG_PROGRAM}) - - find_program(RPMBUILD_PROGRAM rpmbuild) -endif() - -list (APPEND CPACK_SOURCE_GENERATOR "TBZ2") -list (APPEND CPACK_SOURCE_GENERATOR "ZIP") -list (APPEND CPACK_SOURCE_IGNORE_FILES ";TODO;/.hg/;.swp$;/build/") - -include (InstallRequiredSystemLibraries) - -#execute_process(COMMAND dpkg --print-architecture _NPROCE) -set (DEBIAN_PACKAGE_DEPENDS "libtinyxml-dev") - -set (RPM_PACKAGE_DEPENDS "libtinyxml-dev") - -set (SDF_CPACK_CFG_FILE "${PROJECT_BINARY_DIR}/cpack_options.cmake") diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 000000000..722dbe56c --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(sdf) diff --git a/include/sdf/CMakeLists.txt b/include/sdf/CMakeLists.txt index e1422b316..439642e6b 100644 --- a/include/sdf/CMakeLists.txt +++ b/include/sdf/CMakeLists.txt @@ -1,73 +1 @@ -include (${sdf_cmake_dir}/SDFUtils.cmake) - -set (headers - Actor.hh - AirPressure.hh - Altimeter.hh - Assert.hh - Atmosphere.hh - Box.hh - Camera.hh - Capsule.hh - Collision.hh - Console.hh - Cylinder.hh - Element.hh - Ellipsoid.hh - Error.hh - Exception.hh - Filesystem.hh - ForceTorque.hh - Frame.hh - Geometry.hh - Gui.hh - Heightmap.hh - Imu.hh - InterfaceElements.hh - InterfaceFrame.hh - InterfaceJoint.hh - InterfaceLink.hh - InterfaceModel.hh - InterfaceModelPoseGraph.hh - Joint.hh - JointAxis.hh - Lidar.hh - Light.hh - Link.hh - Magnetometer.hh - Material.hh - Mesh.hh - Model.hh - NavSat.hh - Noise.hh - Param.hh - parser.hh - ParserConfig.hh - ParticleEmitter.hh - Pbr.hh - Physics.hh - Plane.hh - PrintConfig.hh - Root.hh - Scene.hh - SDFImpl.hh - SemanticPose.hh - Sensor.hh - Sky.hh - Sphere.hh - Surface.hh - Types.hh - system_util.hh - Visual.hh - World.hh -) - -set (sdf_headers "" CACHE INTERNAL "SDF headers" FORCE) -foreach (hdr ${headers}) - set(sdf_headers "${sdf_headers}#include \n") -endforeach() -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/sdf.hh.in - ${CMAKE_CURRENT_BINARY_DIR}/sdf.hh) - -sdf_install_includes("" ${headers} - ${CMAKE_CURRENT_BINARY_DIR}/sdf.hh) +ign_install_all_headers() diff --git a/cmake/sdf_config.h.in b/include/sdf/config.hh.in similarity index 100% rename from cmake/sdf_config.h.in rename to include/sdf/config.hh.in diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1e3c67eb2..a8a081e3c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -155,74 +155,81 @@ if (BUILD_SDF_TEST) ) endif() - include_directories(${PROJECT_SOURCE_DIR}/test) - sdf_build_tests(${gtest_sources}) - - if (TARGET UNIT_ign_TEST) - # Link the libraries that we always need. - target_link_libraries("UNIT_ign_TEST" - PUBLIC - ignition-cmake${IGN_CMAKE_VER}::utilities - ) + if (NOT WIN32) + # set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Utils.cc) + set(gtest_sources ${gtest_sources} Utils_TEST.cc) endif() if (NOT WIN32) - set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Utils.cc) - sdf_build_tests(Utils_TEST.cc) + # set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS XmlUtils.cc) + set(gtest_sources ${gtest_sources} XmlUtils_TEST.cc) endif() if (NOT WIN32) - set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS XmlUtils.cc) - sdf_build_tests(XmlUtils_TEST.cc) - target_link_libraries(UNIT_XmlUtils_TEST PRIVATE - ${TinyXML2_LIBRARIES}) + # set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS FrameSemantics.cc) + set(gtest_sources ${gtest_sources} FrameSemantics_TEST.cc) endif() if (NOT WIN32) - set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS FrameSemantics.cc) - sdf_build_tests(FrameSemantics_TEST.cc) + # set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Converter.cc EmbeddedSdf.cc XmlUtils.cc) + set(gtest_sources ${gtest_sources} Converter_TEST.cc) endif() if (NOT WIN32) - set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Converter.cc EmbeddedSdf.cc XmlUtils.cc) - sdf_build_tests(Converter_TEST.cc) - target_link_libraries(UNIT_Converter_TEST PRIVATE - ${TinyXML2_LIBRARIES}) + # set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS SDFExtension.cc parser_urdf.cc XmlUtils.cc) + set(gtest_sources ${gtest_sources} parser_urdf_TEST.cc) endif() if (NOT WIN32) - set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS SDFExtension.cc parser_urdf.cc XmlUtils.cc) - sdf_build_tests(parser_urdf_TEST.cc) + # set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS ParamPassing.cc XmlUtils.cc parser.cc + # parser_urdf.cc FrameSemantics.cc Converter.cc EmbeddedSdf.cc SDFExtension.cc Utils.cc) + set(gtest_sources ${gtest_sources} ParamPassing_TEST.cc) + endif() + + ign_build_tests( + TYPE UNIT + SOURCES ${gtest_sources} + # FIXME: This adds dependencies to ALL tests. + INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/test + ) + + if (TARGET UNIT_ign_TEST) + target_link_libraries(UNIT_ign_TEST ignition-cmake${IGN_CMAKE_VER}::utilities) + endif() + + if (TARGET UNIT_XmlUtils_TEST) + target_link_libraries(UNIT_XmlUtils_TEST ${TinyXML2_LIBRARIES}) + endif() + + if (TARGET UNIT_Converter_TEST) + target_link_libraries(UNIT_Converter_TEST ${TinyXML2_LIBRARIES}) + endif() + + if (TARGET UNIT_parser_urdf_TEST) if (NOT USE_INTERNAL_URDF) target_compile_options(UNIT_parser_urdf_TEST PRIVATE ${URDF_CFLAGS}) if (${CMAKE_VERSION} VERSION_GREATER 3.13) target_link_options(UNIT_parser_urdf_TEST PRIVATE ${URDF_LDFLAGS}) endif() - target_link_libraries(UNIT_parser_urdf_TEST PRIVATE ${URDF_LIBRARIES}) + target_link_libraries(UNIT_parser_urdf_TEST ${URDF_LIBRARIES}) endif() - target_link_libraries(UNIT_parser_urdf_TEST PRIVATE - ${TinyXML2_LIBRARIES}) + target_link_libraries(UNIT_parser_urdf_TEST ${TinyXML2_LIBRARIES}) endif() - if (NOT WIN32) - set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS ParamPassing.cc XmlUtils.cc parser.cc - parser_urdf.cc FrameSemantics.cc Converter.cc EmbeddedSdf.cc SDFExtension.cc Utils.cc) - sdf_build_tests(ParamPassing_TEST.cc) + if (TARGET UNIT_ParamPassing_TEST) if (NOT USE_INTERNAL_URDF) target_compile_options(UNIT_ParamPassing_TEST PRIVATE ${URDF_CFLAGS}) if (${CMAKE_VERSION} VERSION_GREATER 3.13) target_link_options(UNIT_ParamPassing_TEST PRIVATE ${URDF_LDFLAGS}) endif() - target_link_libraries(UNIT_ParamPassing_TEST PRIVATE ${URDF_LIBRARIES}) + target_link_libraries(UNIT_ParamPassing_TEST ${URDF_LIBRARIES}) endif() - target_link_libraries(UNIT_ParamPassing_TEST PRIVATE - ${TinyXML2_LIBRARIES}) + target_link_libraries(UNIT_ParamPassing_TEST ${TinyXML2_LIBRARIES}) endif() endif() -sdf_add_library(${sdf_target} ${sources}) -target_compile_features(${sdf_target} PUBLIC cxx_std_17) -target_link_libraries(${sdf_target} +ign_create_core_library(SOURCES ${sources} CXX_STANDARD 17) +target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER} ignition-utils${IGN_UTILS_VER}::ignition-utils${IGN_UTILS_VER} @@ -230,10 +237,10 @@ target_link_libraries(${sdf_target} ${TinyXML2_LIBRARIES}) if (WIN32) - target_compile_definitions(${sdf_target} PRIVATE URDFDOM_STATIC) + target_compile_definitions(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE URDFDOM_STATIC) endif() -target_include_directories(${sdf_target} +target_include_directories(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC $ $ @@ -243,15 +250,13 @@ message (STATUS "URDF_LIBRARY_DIRS=${URDF_LIBRARY_DIRS}") message (STATUS "URDF_LIBRARIES=${URDF_LIBRARIES}") if (NOT USE_INTERNAL_URDF) - target_compile_options(${sdf_target} PRIVATE ${URDF_CFLAGS}) + target_compile_options(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE ${URDF_CFLAGS}) if (${CMAKE_VERSION} VERSION_GREATER 3.13) - target_link_options(${sdf_target} PRIVATE ${URDF_LDFLAGS}) + target_link_options(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE ${URDF_LDFLAGS}) endif() - target_link_libraries(${sdf_target} PRIVATE ${URDF_LIBRARIES}) + target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE ${URDF_LIBRARIES}) endif() -sdf_install_library(${sdf_target}) - if(NOT WIN32) - add_subdirectory(cmd) + # add_subdirectory(cmd) endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 22926fd5a..2c2ad7f7e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -29,5 +29,5 @@ execute_process(COMMAND cmake -E remove_directory ${CMAKE_BINARY_DIR}/test_resul execute_process(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test_results) include_directories(${GTEST_INCLUDE_DIRS}) -add_subdirectory(integration) -add_subdirectory(performance) +# add_subdirectory(integration) +# add_subdirectory(performance) diff --git a/test/integration/CMakeLists.txt b/test/integration/CMakeLists.txt index ddfb34936..58beeb7b7 100644 --- a/test/integration/CMakeLists.txt +++ b/test/integration/CMakeLists.txt @@ -67,7 +67,7 @@ endif() link_directories(${PROJECT_BINARY_DIR}/test) -sdf_build_tests(${tests}) +# sdf_build_tests(${tests}) if (EXISTS ${XMLLINT_EXE}) # Need to run schema target (build .xsd files) before running schema_test diff --git a/test/performance/CMakeLists.txt b/test/performance/CMakeLists.txt index 8df89ac74..31fb66451 100644 --- a/test/performance/CMakeLists.txt +++ b/test/performance/CMakeLists.txt @@ -6,4 +6,4 @@ set(tests link_directories(${PROJECT_BINARY_DIR}/test) -sdf_build_tests(${tests}) +# sdf_build_tests(${tests}) From 109e5bc2f830cf23be08f2117c957172ba748a62 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 10 Nov 2021 09:38:46 +0800 Subject: [PATCH 02/29] add cmd Signed-off-by: Teo Koon Peng --- src/CMakeLists.txt | 2 +- src/cmd/CMakeLists.txt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a8a081e3c..c48d25864 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -258,5 +258,5 @@ if (NOT USE_INTERNAL_URDF) endif() if(NOT WIN32) - # add_subdirectory(cmd) + add_subdirectory(cmd) endif() diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index 89534f7aa..e831d413a 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -2,12 +2,12 @@ # Generate the ruby script for internal testing. # Note that the major version of the library is included in the name. # Ex: cmdsdformat0.rb -set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${sdf_target}.rb") +set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${PROJECT_NAME}.rb") set(cmd_script_configured_test "${cmd_script_generated_test}.configured") # Set the library_location variable to the full path of the library file within # the build directory. -set(library_location "$") +set(library_location "$") configure_file( "cmd${PROJECT_NAME_NO_VERSION_LOWER}.rb.in" @@ -24,12 +24,12 @@ file(GENERATE # Generate the ruby script that gets installed. # Note that the major version of the library is included in the name. # Ex: cmdsdformat0.rb -set(cmd_script_generated "${CMAKE_CURRENT_BINARY_DIR}/cmd${sdf_target}.rb") +set(cmd_script_generated "${CMAKE_CURRENT_BINARY_DIR}/cmd${PROJECT_NAME}.rb") set(cmd_script_configured "${cmd_script_generated}.configured") # Set the library_location variable to the relative path to the library file # within the install directory structure. -set(library_location "../../../${CMAKE_INSTALL_LIBDIR}/$") +set(library_location "../../../${CMAKE_INSTALL_LIBDIR}/$") configure_file( "cmd${PROJECT_NAME_NO_VERSION_LOWER}.rb.in" From 6b6ca930907321edb82aacaceb03e93597f5adf5 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 10 Nov 2021 10:48:46 +0800 Subject: [PATCH 03/29] update config file and master header location Signed-off-by: Teo Koon Peng --- CMakeLists.txt | 16 +++---- cmake/SDFUtils.cmake | 45 ------------------- cmake/sdformat_pc.in | 10 ----- examples/simple.cc | 2 +- include/sdf/Actor.hh | 2 +- include/sdf/AirPressure.hh | 2 +- include/sdf/Altimeter.hh | 2 +- include/sdf/Atmosphere.hh | 2 +- include/sdf/Box.hh | 2 +- include/sdf/Camera.hh | 2 +- include/sdf/Capsule.hh | 2 +- include/sdf/Collision.hh | 2 +- include/sdf/Console.hh | 2 +- include/sdf/Cylinder.hh | 2 +- include/sdf/Element.hh | 2 +- include/sdf/Ellipsoid.hh | 2 +- include/sdf/Error.hh | 2 +- include/sdf/Exception.hh | 2 +- include/sdf/Filesystem.hh | 2 +- include/sdf/ForceTorque.hh | 2 +- include/sdf/Frame.hh | 2 +- include/sdf/Geometry.hh | 2 +- include/sdf/Gui.hh | 2 +- include/sdf/Heightmap.hh | 2 +- include/sdf/Imu.hh | 2 +- include/sdf/InterfaceElements.hh | 2 +- include/sdf/InterfaceFrame.hh | 2 +- include/sdf/InterfaceJoint.hh | 2 +- include/sdf/InterfaceLink.hh | 2 +- include/sdf/InterfaceModel.hh | 2 +- include/sdf/InterfaceModelPoseGraph.hh | 2 +- include/sdf/Joint.hh | 2 +- include/sdf/JointAxis.hh | 2 +- include/sdf/Lidar.hh | 2 +- include/sdf/Light.hh | 2 +- include/sdf/Link.hh | 2 +- include/sdf/Magnetometer.hh | 2 +- include/sdf/Material.hh | 2 +- include/sdf/Mesh.hh | 2 +- include/sdf/Model.hh | 2 +- include/sdf/NavSat.hh | 2 +- include/sdf/Noise.hh | 2 +- include/sdf/Param.hh | 2 +- include/sdf/ParserConfig.hh | 2 +- include/sdf/ParticleEmitter.hh | 2 +- include/sdf/Pbr.hh | 2 +- include/sdf/Physics.hh | 2 +- include/sdf/Plane.hh | 2 +- include/sdf/PrintConfig.hh | 2 +- include/sdf/Root.hh | 2 +- include/sdf/SDFImpl.hh | 2 +- include/sdf/Scene.hh | 2 +- include/sdf/SemanticPose.hh | 2 +- include/sdf/Sensor.hh | 2 +- include/sdf/Sky.hh | 2 +- include/sdf/Sphere.hh | 2 +- include/sdf/Surface.hh | 2 +- include/sdf/Types.hh | 2 +- include/sdf/Visual.hh | 2 +- include/sdf/World.hh | 2 +- include/sdf/parser.hh | 2 +- include/sdf/sdf.hh.in | 2 +- src/Console.cc | 2 +- src/Converter.hh | 2 +- src/Error_TEST.cc | 2 +- src/FrameSemantics_TEST.cc | 2 +- src/ParamPassing.cc | 2 +- src/Root.cc | 2 +- src/Root_TEST.cc | 2 +- src/SDF.cc | 2 +- src/SDFExtension.hh | 2 +- src/ScopedGraph.hh | 2 +- src/Surface.cc | 2 +- src/ign.cc | 2 +- src/ign.hh | 2 +- src/ign_TEST.cc | 2 +- src/parser.cc | 2 +- src/parser_private.hh | 2 +- src/parser_urdf.cc | 2 +- src/parser_urdf.hh | 2 +- src/parser_urdf_TEST.cc | 2 +- test/integration/audio.cc | 2 +- test/integration/category_bitmask.cc | 2 +- .../cfm_damping_implicit_spring_damper.cc | 2 +- test/integration/converter.cc | 2 +- .../disable_fixed_joint_reduction.cc | 2 +- test/integration/element_memory_leak.cc | 2 +- test/integration/fixed_joint_reduction.cc | 2 +- test/integration/force_torque_sensor.cc | 2 +- test/integration/frame.cc | 2 +- test/integration/include.cc | 2 +- test/integration/joint_axis_frame.cc | 2 +- test/integration/link_light.cc | 2 +- test/integration/locale_fix.cc | 2 +- test/integration/locale_fix_cxx.cc | 2 +- test/integration/material.cc | 2 +- test/integration/material_pbr.cc | 2 +- test/integration/model_versions.cc | 2 +- test/integration/nested_model.cc | 2 +- test/integration/parser_error_detection.cc | 2 +- test/integration/plugin_attribute.cc | 2 +- test/integration/plugin_bool.cc | 2 +- test/integration/plugin_include.cc | 2 +- test/integration/provide_feedback.cc | 2 +- test/integration/schema_test.cc | 2 +- test/integration/sdf_basic.cc | 2 +- test/integration/sdf_custom.cc | 2 +- test/integration/unknown.cc | 2 +- test/integration/urdf_gazebo_extensions.cc | 2 +- test/integration/urdf_joint_parameters.cc | 2 +- test/performance/parser_urdf.cc | 2 +- 111 files changed, 113 insertions(+), 174 deletions(-) delete mode 100644 cmake/sdformat_pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index e762558c7..31e46b7c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,24 +90,18 @@ if (WIN32) sdf_setup_windows() endif () +configure_file (include/sdf/config.hh.in + include/sdf/config.hh) + if (BUILD_SDF) include_directories(include - ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/include ) - link_directories(${PROJECT_BINARY_DIR}/src) - - if (NOT DEFINED BUILD_TESTING OR BUILD_TESTING) - set(BUILD_SDF_TEST TRUE) - else() - set(BUILD_SDF_TEST FALSE) - endif() - - ign_configure_project(NO_IGNITION_PREFIX) + ign_configure_project(INCLUDE_DIR sdf NO_IGNITION_PREFIX) ign_configure_build(QUIT_IF_BUILD_ERRORS) ign_create_packages() - ign_create_docs() + # ign_create_docs() # TODO: add header that redirects "sdf/sdf_config.h" to "${ignitin_prefix}/sdformat/config.hh" # install( diff --git a/cmake/SDFUtils.cmake b/cmake/SDFUtils.cmake index 6c8c51d2e..5b12c1b97 100644 --- a/cmake/SDFUtils.cmake +++ b/cmake/SDFUtils.cmake @@ -34,9 +34,6 @@ macro (sdf_add_library _name) set(LIBS_DESTINATION ${PROJECT_BINARY_DIR}/src) add_library(${_name} ${ARGN}) set_target_properties(${_name} PROPERTIES DEFINE_SYMBOL "BUILDING_SDFORMAT_SHARED") - if(NOT BUILD_SHARED_LIBS) - target_compile_definitions(${_name} PUBLIC SDFORMAT_STATIC_DEFINE) - endif() set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBS_DESTINATION}) if (MSVC) set_target_properties( ${_name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${LIBS_DESTINATION}) @@ -45,48 +42,6 @@ macro (sdf_add_library _name) endif () endmacro () -################################################# -macro (sdf_add_executable _name) - add_executable(${_name} ${ARGN}) -endmacro () - - -################################################# -macro (sdf_install_includes _subdir) - install(FILES ${ARGN} DESTINATION ${INCLUDE_INSTALL_DIR}/${_subdir} COMPONENT headers) -endmacro() - -################################################# -macro (sdf_install_library _name) - set_target_properties(${_name} PROPERTIES SOVERSION ${SDF_MAJOR_VERSION} VERSION ${SDF_VERSION_FULL}) - install ( - TARGETS ${_name} - EXPORT ${_name} - ARCHIVE DESTINATION ${LIB_INSTALL_DIR} - LIBRARY DESTINATION ${LIB_INSTALL_DIR} - RUNTIME DESTINATION ${BIN_INSTALL_DIR} - COMPONENT shlib) - -# Export and install target -export( - EXPORT ${_name} - FILE ${PROJECT_BINARY_DIR}/cmake/${sdf_target_output_filename} - NAMESPACE ${PROJECT_EXPORT_NAME}::) - -install( - EXPORT ${_name} - DESTINATION ${sdf_config_install_dir} - FILE ${sdf_target_output_filename} - NAMESPACE ${PROJECT_EXPORT_NAME}::) - -endmacro () - -################################################# -macro (sdf_install_executable _name) - set_target_properties(${_name} PROPERTIES VERSION ${SDF_VERSION_FULL}) - install (TARGETS ${_name} DESTINATION ${BIN_INSTALL_DIR}) -endmacro () - ################################################# macro (sdf_setup_windows) # Need for M_PI constant diff --git a/cmake/sdformat_pc.in b/cmake/sdformat_pc.in deleted file mode 100644 index 621509b53..000000000 --- a/cmake/sdformat_pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=${pcfiledir}/@PC_CONFIG_RELATIVE_PATH_TO_PREFIX@ -libdir=${prefix}/@LIB_INSTALL_DIR@ -includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ - -Name: SDF -Description: Robot Modeling Language (SDF) -Version: @SDF_VERSION_FULL@ -Requires: ignition-math@IGN_MATH_VER@, ignition-utils@IGN_UTILS_VER@ -Libs: -L${libdir} -lsdformat@SDF_MAJOR_VERSION@ -CFlags: -I${includedir}/sdformat-@SDF_VERSION@ -std=c++17 diff --git a/examples/simple.cc b/examples/simple.cc index bf94bf461..6dff97dfc 100644 --- a/examples/simple.cc +++ b/examples/simple.cc @@ -15,7 +15,7 @@ * */ #include -#include +#include int main(int argc, char **argv) { diff --git a/include/sdf/Actor.hh b/include/sdf/Actor.hh index d14cd04f1..6d054a93d 100644 --- a/include/sdf/Actor.hh +++ b/include/sdf/Actor.hh @@ -27,7 +27,7 @@ #include "sdf/Types.hh" #include "sdf/Link.hh" #include "sdf/Joint.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/AirPressure.hh b/include/sdf/AirPressure.hh index 05f656a5d..63b9dfed8 100644 --- a/include/sdf/AirPressure.hh +++ b/include/sdf/AirPressure.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Altimeter.hh b/include/sdf/Altimeter.hh index 03bbbf0fa..68e232304 100644 --- a/include/sdf/Altimeter.hh +++ b/include/sdf/Altimeter.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Atmosphere.hh b/include/sdf/Atmosphere.hh index 3cee963ba..76b06e49d 100644 --- a/include/sdf/Atmosphere.hh +++ b/include/sdf/Atmosphere.hh @@ -22,7 +22,7 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" diff --git a/include/sdf/Box.hh b/include/sdf/Box.hh index 9ac7fa219..05891da14 100644 --- a/include/sdf/Box.hh +++ b/include/sdf/Box.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Camera.hh b/include/sdf/Camera.hh index 054822323..306abe25b 100644 --- a/include/sdf/Camera.hh +++ b/include/sdf/Camera.hh @@ -24,7 +24,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Capsule.hh b/include/sdf/Capsule.hh index 76a91f077..3ee7c311e 100644 --- a/include/sdf/Capsule.hh +++ b/include/sdf/Capsule.hh @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Collision.hh b/include/sdf/Collision.hh index 342985ff7..125e54b27 100644 --- a/include/sdf/Collision.hh +++ b/include/sdf/Collision.hh @@ -24,7 +24,7 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Console.hh b/include/sdf/Console.hh index 04856e900..539bb77cc 100644 --- a/include/sdf/Console.hh +++ b/include/sdf/Console.hh @@ -23,7 +23,7 @@ #include #include -#include +#include #include "sdf/system_util.hh" #ifdef _WIN32 diff --git a/include/sdf/Cylinder.hh b/include/sdf/Cylinder.hh index 9a48b59a5..631caefd4 100644 --- a/include/sdf/Cylinder.hh +++ b/include/sdf/Cylinder.hh @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Element.hh b/include/sdf/Element.hh index 0a0d3fbb9..9b606d215 100644 --- a/include/sdf/Element.hh +++ b/include/sdf/Element.hh @@ -27,7 +27,7 @@ #include "sdf/Param.hh" #include "sdf/PrintConfig.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" #include "sdf/Types.hh" diff --git a/include/sdf/Ellipsoid.hh b/include/sdf/Ellipsoid.hh index fadd4ed81..ef4895c66 100644 --- a/include/sdf/Ellipsoid.hh +++ b/include/sdf/Ellipsoid.hh @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Error.hh b/include/sdf/Error.hh index fb920ec72..3794f35ee 100644 --- a/include/sdf/Error.hh +++ b/include/sdf/Error.hh @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "sdf/system_util.hh" #ifdef _WIN32 diff --git a/include/sdf/Exception.hh b/include/sdf/Exception.hh index 1ada5e8bb..6947f7ead 100644 --- a/include/sdf/Exception.hh +++ b/include/sdf/Exception.hh @@ -25,7 +25,7 @@ #include #include -#include +#include #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Filesystem.hh b/include/sdf/Filesystem.hh index a1e454c64..8bfed2c54 100644 --- a/include/sdf/Filesystem.hh +++ b/include/sdf/Filesystem.hh @@ -22,7 +22,7 @@ #include #include -#include +#include #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/ForceTorque.hh b/include/sdf/ForceTorque.hh index 172e63ade..7a96d3b31 100644 --- a/include/sdf/ForceTorque.hh +++ b/include/sdf/ForceTorque.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Frame.hh b/include/sdf/Frame.hh index 3c327dab9..ab8b5bb1e 100644 --- a/include/sdf/Frame.hh +++ b/include/sdf/Frame.hh @@ -24,7 +24,7 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Geometry.hh b/include/sdf/Geometry.hh index 6223a1737..3e321d8af 100644 --- a/include/sdf/Geometry.hh +++ b/include/sdf/Geometry.hh @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Gui.hh b/include/sdf/Gui.hh index eec65d134..52be7e67e 100644 --- a/include/sdf/Gui.hh +++ b/include/sdf/Gui.hh @@ -20,7 +20,7 @@ #include #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Heightmap.hh b/include/sdf/Heightmap.hh index 11a664b56..8511de173 100644 --- a/include/sdf/Heightmap.hh +++ b/include/sdf/Heightmap.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Imu.hh b/include/sdf/Imu.hh index 85b690701..d26b0b6d9 100644 --- a/include/sdf/Imu.hh +++ b/include/sdf/Imu.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/InterfaceElements.hh b/include/sdf/InterfaceElements.hh index a8debb7c4..e79a87264 100644 --- a/include/sdf/InterfaceElements.hh +++ b/include/sdf/InterfaceElements.hh @@ -27,7 +27,7 @@ #include "sdf/InterfaceModel.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/InterfaceFrame.hh b/include/sdf/InterfaceFrame.hh index 4bd9a1882..94d640d57 100644 --- a/include/sdf/InterfaceFrame.hh +++ b/include/sdf/InterfaceFrame.hh @@ -23,7 +23,7 @@ #include #include -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/InterfaceJoint.hh b/include/sdf/InterfaceJoint.hh index 2840929fd..2f8b0e687 100644 --- a/include/sdf/InterfaceJoint.hh +++ b/include/sdf/InterfaceJoint.hh @@ -23,7 +23,7 @@ #include #include -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/InterfaceLink.hh b/include/sdf/InterfaceLink.hh index 35ccaea7d..3462449da 100644 --- a/include/sdf/InterfaceLink.hh +++ b/include/sdf/InterfaceLink.hh @@ -23,7 +23,7 @@ #include #include -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/InterfaceModel.hh b/include/sdf/InterfaceModel.hh index ef89bfaf8..cd76e39d0 100644 --- a/include/sdf/InterfaceModel.hh +++ b/include/sdf/InterfaceModel.hh @@ -32,7 +32,7 @@ #include "sdf/InterfaceModelPoseGraph.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/InterfaceModelPoseGraph.hh b/include/sdf/InterfaceModelPoseGraph.hh index 1c1e84fd5..ca45bcaf6 100644 --- a/include/sdf/InterfaceModelPoseGraph.hh +++ b/include/sdf/InterfaceModelPoseGraph.hh @@ -27,7 +27,7 @@ #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Joint.hh b/include/sdf/Joint.hh index fc1eabaa6..5c4d7db0e 100644 --- a/include/sdf/Joint.hh +++ b/include/sdf/Joint.hh @@ -24,7 +24,7 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/JointAxis.hh b/include/sdf/JointAxis.hh index d788d6f2d..fea979697 100644 --- a/include/sdf/JointAxis.hh +++ b/include/sdf/JointAxis.hh @@ -24,7 +24,7 @@ #include "sdf/Element.hh" #include "sdf/Exception.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Lidar.hh b/include/sdf/Lidar.hh index 1595fb8bd..4293dd448 100644 --- a/include/sdf/Lidar.hh +++ b/include/sdf/Lidar.hh @@ -23,7 +23,7 @@ #include #include #include -#include +#include namespace sdf diff --git a/include/sdf/Light.hh b/include/sdf/Light.hh index 11e5dceb8..2f5a56e7b 100644 --- a/include/sdf/Light.hh +++ b/include/sdf/Light.hh @@ -26,7 +26,7 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Link.hh b/include/sdf/Link.hh index 97751166a..86d5988c5 100644 --- a/include/sdf/Link.hh +++ b/include/sdf/Link.hh @@ -24,7 +24,7 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Magnetometer.hh b/include/sdf/Magnetometer.hh index 642960dfe..b431e7566 100644 --- a/include/sdf/Magnetometer.hh +++ b/include/sdf/Magnetometer.hh @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Material.hh b/include/sdf/Material.hh index 0e1b3b8f1..7d4a5160b 100644 --- a/include/sdf/Material.hh +++ b/include/sdf/Material.hh @@ -21,7 +21,7 @@ #include #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Mesh.hh b/include/sdf/Mesh.hh index b75349200..c4fd8e67c 100644 --- a/include/sdf/Mesh.hh +++ b/include/sdf/Mesh.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Model.hh b/include/sdf/Model.hh index 8b1f7771c..abaca0473 100644 --- a/include/sdf/Model.hh +++ b/include/sdf/Model.hh @@ -25,7 +25,7 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/NavSat.hh b/include/sdf/NavSat.hh index 66b9b4b39..2fa1acbd0 100644 --- a/include/sdf/NavSat.hh +++ b/include/sdf/NavSat.hh @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include diff --git a/include/sdf/Noise.hh b/include/sdf/Noise.hh index c0d8382f8..f8139cd45 100644 --- a/include/sdf/Noise.hh +++ b/include/sdf/Noise.hh @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Param.hh b/include/sdf/Param.hh index 2fc931a60..472075ab9 100644 --- a/include/sdf/Param.hh +++ b/include/sdf/Param.hh @@ -37,7 +37,7 @@ #include "sdf/Console.hh" #include "sdf/PrintConfig.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" #include "sdf/Types.hh" diff --git a/include/sdf/ParserConfig.hh b/include/sdf/ParserConfig.hh index 2850a2c0b..9c83d1c66 100644 --- a/include/sdf/ParserConfig.hh +++ b/include/sdf/ParserConfig.hh @@ -27,7 +27,7 @@ #include "sdf/Error.hh" #include "sdf/InterfaceElements.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" diff --git a/include/sdf/ParticleEmitter.hh b/include/sdf/ParticleEmitter.hh index d15eaa639..5d457addc 100644 --- a/include/sdf/ParticleEmitter.hh +++ b/include/sdf/ParticleEmitter.hh @@ -25,7 +25,7 @@ #include "sdf/Material.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Pbr.hh b/include/sdf/Pbr.hh index acc906dc8..d1636b039 100644 --- a/include/sdf/Pbr.hh +++ b/include/sdf/Pbr.hh @@ -21,7 +21,7 @@ #include #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Physics.hh b/include/sdf/Physics.hh index 58331113b..f860a1159 100644 --- a/include/sdf/Physics.hh +++ b/include/sdf/Physics.hh @@ -22,7 +22,7 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Plane.hh b/include/sdf/Plane.hh index c0ea5a4d7..8f5a91227 100644 --- a/include/sdf/Plane.hh +++ b/include/sdf/Plane.hh @@ -23,7 +23,7 @@ #include #include #include -#include +#include namespace sdf { diff --git a/include/sdf/PrintConfig.hh b/include/sdf/PrintConfig.hh index d9d3d507c..2f4332ca1 100644 --- a/include/sdf/PrintConfig.hh +++ b/include/sdf/PrintConfig.hh @@ -19,7 +19,7 @@ #include -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Root.hh b/include/sdf/Root.hh index 415016041..cfd17aa63 100644 --- a/include/sdf/Root.hh +++ b/include/sdf/Root.hh @@ -22,7 +22,7 @@ #include "sdf/SDFImpl.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/SDFImpl.hh b/include/sdf/SDFImpl.hh index 864f971f6..a2a922336 100644 --- a/include/sdf/SDFImpl.hh +++ b/include/sdf/SDFImpl.hh @@ -26,7 +26,7 @@ #include "sdf/ParserConfig.hh" #include "sdf/PrintConfig.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" #ifdef _WIN32 diff --git a/include/sdf/Scene.hh b/include/sdf/Scene.hh index 2a137760c..cf3796aca 100644 --- a/include/sdf/Scene.hh +++ b/include/sdf/Scene.hh @@ -23,7 +23,7 @@ #include "sdf/Element.hh" #include "sdf/Sky.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/SemanticPose.hh b/include/sdf/SemanticPose.hh index 6692d8c04..924802228 100644 --- a/include/sdf/SemanticPose.hh +++ b/include/sdf/SemanticPose.hh @@ -24,7 +24,7 @@ #include #include -#include +#include #include "sdf/system_util.hh" #ifdef _WIN32 diff --git a/include/sdf/Sensor.hh b/include/sdf/Sensor.hh index f8ac4adcd..226cfbefd 100644 --- a/include/sdf/Sensor.hh +++ b/include/sdf/Sensor.hh @@ -24,7 +24,7 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Sky.hh b/include/sdf/Sky.hh index cd76cfd47..e1e2e9349 100644 --- a/include/sdf/Sky.hh +++ b/include/sdf/Sky.hh @@ -23,7 +23,7 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Sphere.hh b/include/sdf/Sphere.hh index 10d91b897..2ab0538be 100644 --- a/include/sdf/Sphere.hh +++ b/include/sdf/Sphere.hh @@ -22,7 +22,7 @@ #include #include -#include +#include namespace sdf { diff --git a/include/sdf/Surface.hh b/include/sdf/Surface.hh index dd39aea94..cdcd17cca 100644 --- a/include/sdf/Surface.hh +++ b/include/sdf/Surface.hh @@ -20,7 +20,7 @@ #include #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/Types.hh b/include/sdf/Types.hh index c0e964ced..8ad08a9fe 100644 --- a/include/sdf/Types.hh +++ b/include/sdf/Types.hh @@ -25,7 +25,7 @@ #include #include -#include +#include #include "sdf/system_util.hh" #include "sdf/Error.hh" diff --git a/include/sdf/Visual.hh b/include/sdf/Visual.hh index fce9e6de2..f8eae7291 100644 --- a/include/sdf/Visual.hh +++ b/include/sdf/Visual.hh @@ -29,7 +29,7 @@ #include "sdf/SemanticPose.hh" #include "sdf/Sphere.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/World.hh b/include/sdf/World.hh index b0d4d6515..0fe26a77a 100644 --- a/include/sdf/World.hh +++ b/include/sdf/World.hh @@ -29,7 +29,7 @@ #include "sdf/Gui.hh" #include "sdf/Scene.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" namespace sdf diff --git a/include/sdf/parser.hh b/include/sdf/parser.hh index 920e6d3c2..82b036a8d 100644 --- a/include/sdf/parser.hh +++ b/include/sdf/parser.hh @@ -20,7 +20,7 @@ #include #include "sdf/SDFImpl.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" /// \ingroup sdf_parser diff --git a/include/sdf/sdf.hh.in b/include/sdf/sdf.hh.in index 11fb7d63b..744e631cc 100644 --- a/include/sdf/sdf.hh.in +++ b/include/sdf/sdf.hh.in @@ -1,3 +1,3 @@ // Automatically generated ${sdf_headers} -#include +#include diff --git a/src/Console.cc b/src/Console.cc index c0f4c4edd..14b9c4531 100644 --- a/src/Console.cc +++ b/src/Console.cc @@ -24,7 +24,7 @@ #include "sdf/Console.hh" #include "sdf/Filesystem.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" using namespace sdf; diff --git a/src/Converter.hh b/src/Converter.hh index 5c3badb17..444c9d8a4 100644 --- a/src/Converter.hh +++ b/src/Converter.hh @@ -22,7 +22,7 @@ #include #include -#include +#include #include "sdf/system_util.hh" namespace sdf diff --git a/src/Error_TEST.cc b/src/Error_TEST.cc index 5696039ec..a177ec38e 100644 --- a/src/Error_TEST.cc +++ b/src/Error_TEST.cc @@ -17,7 +17,7 @@ #include #include -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/Error.hh" ///////////////////////////////////////////////// diff --git a/src/FrameSemantics_TEST.cc b/src/FrameSemantics_TEST.cc index 16323c0b6..7c5ead11f 100644 --- a/src/FrameSemantics_TEST.cc +++ b/src/FrameSemantics_TEST.cc @@ -29,7 +29,7 @@ #include "sdf/SDFImpl.hh" #include "sdf/World.hh" #include "sdf/parser.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "FrameSemantics.hh" #include "ScopedGraph.hh" diff --git a/src/ParamPassing.cc b/src/ParamPassing.cc index 2e56dca73..fdee035af 100644 --- a/src/ParamPassing.cc +++ b/src/ParamPassing.cc @@ -20,7 +20,7 @@ #include "sdf/Filesystem.hh" #include "sdf/parser.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "ParamPassing.hh" #include "parser_private.hh" diff --git a/src/Root.cc b/src/Root.cc index 23b5379a1..526e0967f 100644 --- a/src/Root.cc +++ b/src/Root.cc @@ -27,7 +27,7 @@ #include "sdf/Types.hh" #include "sdf/World.hh" #include "sdf/parser.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "FrameSemantics.hh" #include "ScopedGraph.hh" #include "Utils.hh" diff --git a/src/Root_TEST.cc b/src/Root_TEST.cc index d687f6e2b..647d867ce 100644 --- a/src/Root_TEST.cc +++ b/src/Root_TEST.cc @@ -17,7 +17,7 @@ #include #include "sdf/Actor.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/Collision.hh" #include "sdf/Error.hh" #include "sdf/Link.hh" diff --git a/src/SDF.cc b/src/SDF.cc index 394bb0099..dd04f4e14 100644 --- a/src/SDF.cc +++ b/src/SDF.cc @@ -30,7 +30,7 @@ #include "sdf/Filesystem.hh" #include "sdf/SDFImpl.hh" #include "SDFImplPrivate.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "EmbeddedSdf.hh" namespace sdf diff --git a/src/SDFExtension.hh b/src/SDFExtension.hh index 77bd032ac..93cfe6a08 100644 --- a/src/SDFExtension.hh +++ b/src/SDFExtension.hh @@ -26,7 +26,7 @@ #include -#include +#include #include "sdf/Types.hh" namespace sdf diff --git a/src/ScopedGraph.hh b/src/ScopedGraph.hh index ff0d57be6..f129da796 100644 --- a/src/ScopedGraph.hh +++ b/src/ScopedGraph.hh @@ -27,7 +27,7 @@ #include #include -#include "sdf/sdf_config.h" +#include "sdf/config.hh" namespace sdf { diff --git a/src/Surface.cc b/src/Surface.cc index 7e7283906..52ee23cbf 100644 --- a/src/Surface.cc +++ b/src/Surface.cc @@ -18,7 +18,7 @@ #include "sdf/Element.hh" #include "sdf/Surface.hh" #include "sdf/Types.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" using namespace sdf; diff --git a/src/ign.cc b/src/ign.cc index e046d6fc1..f8dae4991 100644 --- a/src/ign.cc +++ b/src/ign.cc @@ -20,7 +20,7 @@ #include #include -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/Filesystem.hh" #include "sdf/Root.hh" #include "sdf/parser.hh" diff --git a/src/ign.hh b/src/ign.hh index 3db17a72a..0c74b4755 100644 --- a/src/ign.hh +++ b/src/ign.hh @@ -20,7 +20,7 @@ #include -#include +#include #include "sdf/system_util.hh" // Inline bracket to help doxygen filtering. diff --git a/src/ign_TEST.cc b/src/ign_TEST.cc index f1d269ecf..cca55d604 100644 --- a/src/ign_TEST.cc +++ b/src/ign_TEST.cc @@ -24,7 +24,7 @@ #include "sdf/parser.hh" #include "sdf/SDFImpl.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "test_config.h" #ifdef _WIN32 diff --git a/src/parser.cc b/src/parser.cc index 5f29f93d9..3ff3ad508 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -36,7 +36,7 @@ #include "sdf/World.hh" #include "sdf/parser.hh" #include "sdf/ParserConfig.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "Converter.hh" #include "FrameSemantics.hh" diff --git a/src/parser_private.hh b/src/parser_private.hh index c1b8d963f..576d40d22 100644 --- a/src/parser_private.hh +++ b/src/parser_private.hh @@ -22,7 +22,7 @@ #include #include "sdf/SDFImpl.hh" -#include "sdf/sdf_config.h" +#include "sdf/config.hh" #include "sdf/system_util.hh" /// \ingroup sdf_parser diff --git a/src/parser_urdf.cc b/src/parser_urdf.cc index 851a367b3..b18c61106 100644 --- a/src/parser_urdf.cc +++ b/src/parser_urdf.cc @@ -31,7 +31,7 @@ #include #include -#include "sdf/sdf.hh" +#include "sdformat.hh" #include "XmlUtils.hh" #include "SDFExtension.hh" diff --git a/src/parser_urdf.hh b/src/parser_urdf.hh index 8f703169c..3badb4cc4 100644 --- a/src/parser_urdf.hh +++ b/src/parser_urdf.hh @@ -18,7 +18,7 @@ #define SDFORMAT_URDF2SDF_HH_ #include -#include +#include #include diff --git a/src/parser_urdf_TEST.cc b/src/parser_urdf_TEST.cc index cf65e1845..74df38a89 100644 --- a/src/parser_urdf_TEST.cc +++ b/src/parser_urdf_TEST.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "sdformat.hh" #include "parser_urdf.hh" ///////////////////////////////////////////////// diff --git a/test/integration/audio.cc b/test/integration/audio.cc index 57a5bd642..53ed8fd04 100644 --- a/test/integration/audio.cc +++ b/test/integration/audio.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/category_bitmask.cc b/test/integration/category_bitmask.cc index e983631b3..f99975a1c 100644 --- a/test/integration/category_bitmask.cc +++ b/test/integration/category_bitmask.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" ///////////////////////////////////////////////// TEST(CategoryBitmask, WasSpecified) diff --git a/test/integration/cfm_damping_implicit_spring_damper.cc b/test/integration/cfm_damping_implicit_spring_damper.cc index 5112e1366..936833ebb 100644 --- a/test/integration/cfm_damping_implicit_spring_damper.cc +++ b/test/integration/cfm_damping_implicit_spring_damper.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/converter.cc b/test/integration/converter.cc index 2f52019e8..f85251419 100644 --- a/test/integration/converter.cc +++ b/test/integration/converter.cc @@ -20,7 +20,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/disable_fixed_joint_reduction.cc b/test/integration/disable_fixed_joint_reduction.cc index 8d4cd7f4a..fd7b53a5c 100644 --- a/test/integration/disable_fixed_joint_reduction.cc +++ b/test/integration/disable_fixed_joint_reduction.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/element_memory_leak.cc b/test/integration/element_memory_leak.cc index 9632f13f8..a01af3972 100644 --- a/test/integration/element_memory_leak.cc +++ b/test/integration/element_memory_leak.cc @@ -20,7 +20,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/fixed_joint_reduction.cc b/test/integration/fixed_joint_reduction.cc index 0475db78b..d03995595 100644 --- a/test/integration/fixed_joint_reduction.cc +++ b/test/integration/fixed_joint_reduction.cc @@ -20,7 +20,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/force_torque_sensor.cc b/test/integration/force_torque_sensor.cc index f5e2f18b9..08c912307 100644 --- a/test/integration/force_torque_sensor.cc +++ b/test/integration/force_torque_sensor.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/frame.cc b/test/integration/frame.cc index a1fd535a5..8f40136d1 100644 --- a/test/integration/frame.cc +++ b/test/integration/frame.cc @@ -30,7 +30,7 @@ #include "sdf/SDFImpl.hh" #include "sdf/World.hh" #include "sdf/parser.hh" -#include "sdf/sdf_config.h" +#include "ignition/sdformat/config.hh" #include "test_config.h" diff --git a/test/integration/include.cc b/test/integration/include.cc index 02b1f2b8e..b42eafe55 100644 --- a/test/integration/include.cc +++ b/test/integration/include.cc @@ -20,7 +20,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/joint_axis_frame.cc b/test/integration/joint_axis_frame.cc index 31b54bdb6..c5ede36ee 100644 --- a/test/integration/joint_axis_frame.cc +++ b/test/integration/joint_axis_frame.cc @@ -20,7 +20,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" std::string get_sdf_string(const std::string &_version) { diff --git a/test/integration/link_light.cc b/test/integration/link_light.cc index b4dc6d916..e2e23ec7a 100644 --- a/test/integration/link_light.cc +++ b/test/integration/link_light.cc @@ -18,7 +18,7 @@ #include #include #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/locale_fix.cc b/test/integration/locale_fix.cc index bb2cbd323..a04f1854c 100644 --- a/test/integration/locale_fix.cc +++ b/test/integration/locale_fix.cc @@ -20,7 +20,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/locale_fix_cxx.cc b/test/integration/locale_fix_cxx.cc index f2fbd20df..f33455d01 100644 --- a/test/integration/locale_fix_cxx.cc +++ b/test/integration/locale_fix_cxx.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" TEST(CheckFixForLocal, CheckFixForCxxLocal) { diff --git a/test/integration/material.cc b/test/integration/material.cc index ff872e067..75d8f85c5 100644 --- a/test/integration/material.cc +++ b/test/integration/material.cc @@ -20,7 +20,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" void ExpectInvalidWithMessage(sdf::Errors &_errors, std::string _compType) diff --git a/test/integration/material_pbr.cc b/test/integration/material_pbr.cc index 067b70807..89e529a85 100644 --- a/test/integration/material_pbr.cc +++ b/test/integration/material_pbr.cc @@ -17,7 +17,7 @@ #include #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "sdf/Pbr.hh" #include "test_config.h" diff --git a/test/integration/model_versions.cc b/test/integration/model_versions.cc index a091a598b..03be6e029 100644 --- a/test/integration/model_versions.cc +++ b/test/integration/model_versions.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/nested_model.cc b/test/integration/nested_model.cc index 904115114..7111c59e5 100644 --- a/test/integration/nested_model.cc +++ b/test/integration/nested_model.cc @@ -23,7 +23,7 @@ #include #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/parser_error_detection.cc b/test/integration/parser_error_detection.cc index 3d6fc752f..047a0ab68 100644 --- a/test/integration/parser_error_detection.cc +++ b/test/integration/parser_error_detection.cc @@ -20,7 +20,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" std::string get_sdf_string() { diff --git a/test/integration/plugin_attribute.cc b/test/integration/plugin_attribute.cc index 02af21046..f2280774f 100644 --- a/test/integration/plugin_attribute.cc +++ b/test/integration/plugin_attribute.cc @@ -20,7 +20,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" std::string get_sdf_string() { diff --git a/test/integration/plugin_bool.cc b/test/integration/plugin_bool.cc index 55139b2a7..de4b14d8d 100644 --- a/test/integration/plugin_bool.cc +++ b/test/integration/plugin_bool.cc @@ -20,7 +20,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" std::string get_sdf_string() { diff --git a/test/integration/plugin_include.cc b/test/integration/plugin_include.cc index 4ad0420bc..c14c3b0e8 100644 --- a/test/integration/plugin_include.cc +++ b/test/integration/plugin_include.cc @@ -17,7 +17,7 @@ #include #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/provide_feedback.cc b/test/integration/provide_feedback.cc index 582a39c3f..04508a09d 100644 --- a/test/integration/provide_feedback.cc +++ b/test/integration/provide_feedback.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/schema_test.cc b/test/integration/schema_test.cc index 999fef8cb..f144a5c5a 100644 --- a/test/integration/schema_test.cc +++ b/test/integration/schema_test.cc @@ -21,7 +21,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/sdf_basic.cc b/test/integration/sdf_basic.cc index 6ea82b44c..e168198a7 100644 --- a/test/integration/sdf_basic.cc +++ b/test/integration/sdf_basic.cc @@ -16,7 +16,7 @@ */ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/sdf_custom.cc b/test/integration/sdf_custom.cc index 2b29d4f67..cffa28e1f 100644 --- a/test/integration/sdf_custom.cc +++ b/test/integration/sdf_custom.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/unknown.cc b/test/integration/unknown.cc index 35ade31b6..377b698a3 100644 --- a/test/integration/unknown.cc +++ b/test/integration/unknown.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "sdf/Error.hh" #include "test_config.h" diff --git a/test/integration/urdf_gazebo_extensions.cc b/test/integration/urdf_gazebo_extensions.cc index df7a53b33..2b1d6c655 100644 --- a/test/integration/urdf_gazebo_extensions.cc +++ b/test/integration/urdf_gazebo_extensions.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/integration/urdf_joint_parameters.cc b/test/integration/urdf_joint_parameters.cc index e6ae97d87..3f2cfdc76 100644 --- a/test/integration/urdf_joint_parameters.cc +++ b/test/integration/urdf_joint_parameters.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" diff --git a/test/performance/parser_urdf.cc b/test/performance/parser_urdf.cc index d19d230e9..f19ca6e90 100644 --- a/test/performance/parser_urdf.cc +++ b/test/performance/parser_urdf.cc @@ -19,7 +19,7 @@ #include -#include "sdf/sdf.hh" +#include "ignition/sdformat.hh" #include "test_config.h" From b56c9e4e2d58c5c73e299c63d94a651ea68d1a51 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 10 Nov 2021 11:41:16 +0800 Subject: [PATCH 04/29] cleanup more stuffs that have been moved to ign-cmake Signed-off-by: Teo Koon Peng --- CMakeLists.txt | 75 +++--------------- cmake/HostCFlags.cmake | 27 ------- cmake/SearchForStuff.cmake | 18 +---- cmake/TargetArch.cmake | 158 ------------------------------------- include/sdf/config.hh.in | 22 +++--- 5 files changed, 24 insertions(+), 276 deletions(-) delete mode 100644 cmake/HostCFlags.cmake delete mode 100644 cmake/TargetArch.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 31e46b7c3..e2edc0419 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,21 +4,6 @@ if(COMMAND CMAKE_POLICY) CMAKE_POLICY(SET CMP0003 NEW) CMAKE_POLICY(SET CMP0004 NEW) endif(COMMAND CMAKE_POLICY) -enable_testing() - -# with -fPIC -if(UNIX AND NOT WIN32) - set (CMAKE_INSTALL_PREFIX "/usr" CACHE STRING "Install Prefix") - find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin ) - if(CMAKE_UNAME) - exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR) - set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL - "processor type (i386 and x86_64)") - if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - ADD_DEFINITIONS(-fPIC) - endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - endif(CMAKE_UNAME) -endif() project (sdformat13 VERSION 13.0) @@ -26,63 +11,22 @@ project (sdformat13 VERSION 13.0) # It represents the current version of sdformat implement by the software set (SDF_PROTOCOL_VERSION 1.9) -set (SDF_MAJOR_VERSION 13) -set (SDF_MINOR_VERSION 0) -set (SDF_PATCH_VERSION 0) - -set (SDF_VERSION ${SDF_MAJOR_VERSION}.${SDF_MINOR_VERSION}) -set (SDF_VERSION_FULL ${SDF_MAJOR_VERSION}.${SDF_MINOR_VERSION}.${SDF_PATCH_VERSION}~pre1) - -string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) -string(REGEX REPLACE "[0-9]+" "" PROJECT_NAME_NO_VERSION ${PROJECT_NAME}) -string(TOLOWER ${PROJECT_NAME_NO_VERSION} PROJECT_NAME_NO_VERSION_LOWER) -set(PROJECT_EXPORT_NAME ${PROJECT_NAME_LOWER}) -set(PROJECT_LIBRARY_TARGET_NAME ${PROJECT_NAME_LOWER}) - set (project_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") -message (STATUS "${PROJECT_NAME} version ${SDF_VERSION_FULL}") -set (CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) - -# Include GNUInstallDirs to get canonical paths -include(GNUInstallDirs) - -# Default test type for test all over source -set(TEST_TYPE "UNIT") - -# developer's option to cache PKG_CONFIG_PATH and -# LD_LIBRARY_PATH for local installs -if(PKG_CONFIG_PATH) - set (ENV{PKG_CONFIG_PATH} ${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}) -endif() -if(LD_LIBRARY_PATH) - set (ENV{LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}:$ENV{LD_LIBRARY_PATH}) -endif() - -set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/sdformat-${SDF_VERSION}/sdf") -set (LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING "Installation directory for libraries (relative to CMAKE_INSTALL_PREFIX)") -set (BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR} CACHE STRING "Installation directory for binaries (relative to CMAKE_INSTALL_PREFIX)") - -# set(PKG_NAME SDFormat) -# set(sdf_target sdformat${SDF_MAJOR_VERSION}) -# set(sdf_config_install_dir "${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME_LOWER}/") -# set(sdf_import_target_name ${PROJECT_EXPORT_NAME}::${sdf_target}) -# set(sdf_target_output_filename "${sdf_target}-targets.cmake") +message (STATUS "${PROJECT_NAME} version ${PROJECT_VERSION_FULL}") OPTION(SDFORMAT_DISABLE_CONSOLE_LOGFILE "Disable the sdformat console logfile" OFF) set (BUILD_SDF ON CACHE INTERNAL "Build SDF" FORCE) -set (build_errors "" CACHE INTERNAL "build errors" FORCE) -set (build_warnings "" CACHE INTERNAL "build warnings" FORCE) set (sdf_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") -message (STATUS "\n\n====== Finding 3rd Party Packages ======") -include (${sdf_cmake_dir}/SDFUtils.cmake) -include (${sdf_cmake_dir}/SearchForStuff.cmake) -message (STATUS "----------------------------------------\n") +################################################# +# Find ign-cmake +find_package(ignition-cmake2 2.9 REQUIRED) +set(IGN_CMAKE_VER ${ignition-cmake2_VERSION_MAJOR}) ################################################# # OS Specific initialization @@ -99,6 +43,12 @@ if (BUILD_SDF) ) ign_configure_project(INCLUDE_DIR sdf NO_IGNITION_PREFIX) + + message (STATUS "\n\n====== Finding 3rd Party Packages ======") + include (${sdf_cmake_dir}/SDFUtils.cmake) + include (${sdf_cmake_dir}/SearchForStuff.cmake) + message (STATUS "----------------------------------------\n") + ign_configure_build(QUIT_IF_BUILD_ERRORS) ign_create_packages() # ign_create_docs() @@ -111,9 +61,6 @@ if (BUILD_SDF) # ${IGN_INCLUDE_INSTALL_DIR_FULL}/sdf # ) - if (BUILD_SDF_TEST) - # add_subdirectory(test) - endif() add_subdirectory(sdf) add_subdirectory(conf) add_subdirectory(doc) diff --git a/cmake/HostCFlags.cmake b/cmake/HostCFlags.cmake deleted file mode 100644 index f38d8d7fd..000000000 --- a/cmake/HostCFlags.cmake +++ /dev/null @@ -1,27 +0,0 @@ -include (${project_cmake_dir}/FindSSE.cmake) - -if (SSE2_FOUND) - set (CMAKE_C_FLAGS_ALL "-msse -msse2 ${CMAKE_C_FLAGS_ALL}") - if (NOT APPLE) - set (CMAKE_C_FLAGS_ALL "-mfpmath=sse ${CMAKE_C_FLAGS_ALL}") - endif() -endif() - -if (SSE3_FOUND) - set (CMAKE_C_FLAGS_ALL "-msse3 ${CMAKE_C_FLAGS_ALL}") -endif() -if (SSSE3_FOUND) - set (CMAKE_C_FLAGS_ALL "-mssse3 ${CMAKE_C_FLAGS_ALL}") -endif() - -if (SSE4_1_FOUND OR SSE4_2_FOUND) - if (SSE4_1_FOUND) - set (CMAKE_C_FLAGS_ALL "-msse4.1 ${CMAKE_C_FLAGS_ALL}") - endif() - if (SSE4_2_FOUND) - set (CMAKE_C_FLAGS_ALL "-msse4.2 ${CMAKE_C_FLAGS_ALL}") - endif() -else() - message(STATUS "\nSSE4 disabled.\n") -endif() - diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 224c9aba2..df0aae754 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -1,19 +1,10 @@ include (FindPkgConfig) -# Detect the architecture -include (${project_cmake_dir}/TargetArch.cmake) -target_architecture(ARCH) message(STATUS "Building for arch: ${ARCH}") -################################################# -# Find ign-cmake -find_package(ignition-cmake2 2.9 REQUIRED) -set(IGN_CMAKE_VER ${ignition-cmake2_VERSION_MAJOR}) - ################################################# # Find tinyxml2. -list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") -find_package(TinyXML2 REQUIRED) +ign_find_package(TINYXML2 REQUIRED) ################################################ # Find urdfdom parser. Logic: @@ -62,7 +53,7 @@ ign_find_package(ignition-tools) ################################################ # Find the Python interpreter for running the # check_test_ran.py script -find_package(PythonInterp 3 QUIET) +ign_find_package(PythonInterp VERSION 3 QUIET) ################################################ # Find psutil python package for memory tests @@ -98,11 +89,6 @@ macro (check_gcc_visibility) check_cxx_compiler_flag(-fvisibility=hidden GCC_SUPPORTS_VISIBILITY) endmacro() -######################################## -# Find ignition cmake2 -find_package(ignition-cmake2 2.9 REQUIRED) - - ######################################## # Find ignition math # Set a variable for generating ProjectConfig.cmake diff --git a/cmake/TargetArch.cmake b/cmake/TargetArch.cmake deleted file mode 100644 index d50073c82..000000000 --- a/cmake/TargetArch.cmake +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright (c) 2012 Petroules Corporation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. Redistributions in binary -# form must reproduce the above copyright notice, this list of conditions and -# the following disclaimer in the documentation and/or other materials -# provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Based on the Qt 5 processor detection code, so should be very accurate -# https://qt.gitorious.org/qt/qtbase/blobs/master/src/corelib/global/qprocessordetection.h -# Currently handles arm (v5, v6, v7), x86 (32/64), ia64, and ppc (32/64) - -# Regarding POWER/PowerPC, just as is noted in the Qt source, -# "There are many more known variants/revisions that we do not handle/detect." - - - -set(archdetect_c_code " -#if defined(__arm__) || defined(__TARGET_ARCH_ARM) - #if defined(__ARM_ARCH_7__) \\ - || defined(__ARM_ARCH_7A__) \\ - || defined(__ARM_ARCH_7R__) \\ - || defined(__ARM_ARCH_7M__) \\ - || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7) - #error cmake_ARCH armv7 - #elif defined(__ARM_ARCH_6__) \\ - || defined(__ARM_ARCH_6J__) \\ - || defined(__ARM_ARCH_6T2__) \\ - || defined(__ARM_ARCH_6Z__) \\ - || defined(__ARM_ARCH_6K__) \\ - || defined(__ARM_ARCH_6ZK__) \\ - || defined(__ARM_ARCH_6M__) \\ - || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6) - #error cmake_ARCH armv6 - #elif defined(__ARM_ARCH_5TEJ__) \\ - || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5) - #error cmake_ARCH armv5 - #else - #error cmake_ARCH arm - #endif -#elif defined(__i386) || defined(__i386__) || defined(_M_IX86) - #error cmake_ARCH i386 -#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64) - #error cmake_ARCH x86_64 -#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64) - #error cmake_ARCH ia64 -#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\ - || defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\ - || defined(_M_MPPC) || defined(_M_PPC) - #if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__) - #error cmake_ARCH ppc64 - #else - #error cmake_ARCH ppc - #endif -#endif - -#error cmake_ARCH unknown -") - -# Set ppc_support to TRUE before including this file or ppc and ppc64 -# will be treated as invalid architectures since they are no longer supported by Apple - -function(target_architecture output_var) - if(APPLE AND CMAKE_OSX_ARCHITECTURES) - # On OS X we use CMAKE_OSX_ARCHITECTURES *if* it was set - # First let's normalize the order of the values - - # Note that it's not possible to compile PowerPC applications if you are using - # the OS X SDK version 10.6 or later - you'll need 10.4/10.5 for that, so we - # disable it by default - # See this page for more information: - # http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4 - - # Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime. - # On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise. - - foreach(osx_arch ${CMAKE_OSX_ARCHITECTURES}) - if("${osx_arch}" STREQUAL "ppc" AND ppc_support) - set(osx_arch_ppc TRUE) - elseif("${osx_arch}" STREQUAL "i386") - set(osx_arch_i386 TRUE) - elseif("${osx_arch}" STREQUAL "x86_64") - set(osx_arch_x86_64 TRUE) - elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support) - set(osx_arch_ppc64 TRUE) - else() - message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}") - endif() - endforeach() - - # Now add all the architectures in our normalized order - if(osx_arch_ppc) - list(APPEND ARCH ppc) - endif() - - if(osx_arch_i386) - list(APPEND ARCH i386) - endif() - - if(osx_arch_x86_64) - list(APPEND ARCH x86_64) - endif() - - if(osx_arch_ppc64) - list(APPEND ARCH ppc64) - endif() - else() - file(WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}") - - enable_language(C) - - # Detect the architecture in a rather creative way... - # This compiles a small C program which is a series of ifdefs that selects a - # particular #error preprocessor directive whose message string contains the - # target architecture. The program will always fail to compile (both because - # file is not a valid C program, and obviously because of the presence of the - # #error preprocessor directives... but by exploiting the preprocessor in this - # way, we can detect the correct target architecture even when cross-compiling, - # since the program itself never needs to be run (only the compiler/preprocessor) - try_run( - run_result_unused - compile_result_unused - "${CMAKE_BINARY_DIR}" - "${CMAKE_BINARY_DIR}/arch.c" - COMPILE_OUTPUT_VARIABLE ARCH - CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} - ) - - # Parse the architecture name from the compiler output - string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}") - - # Get rid of the value marker leaving just the architecture name - string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}") - - # If we are compiling with an unknown architecture this variable should - # already be set to "unknown" but in the case that it's empty (i.e. due - # to a typo in the code), then set it to unknown - if (NOT ARCH) - set(ARCH unknown) - endif() - endif() - - set(${output_var} "${ARCH}" PARENT_SCOPE) -endfunction() diff --git a/include/sdf/config.hh.in b/include/sdf/config.hh.in index 524088664..6c3bc1514 100644 --- a/include/sdf/config.hh.in +++ b/include/sdf/config.hh.in @@ -11,18 +11,18 @@ #define SDF_VERSION "${SDF_PROTOCOL_VERSION}" /* Package version number */ -#define SDF_MAJOR_VERSION ${SDF_MAJOR_VERSION} -#define SDF_MINOR_VERSION ${SDF_MINOR_VERSION} -#define SDF_PATCH_VERSION ${SDF_PATCH_VERSION} +#define SDF_MAJOR_VERSION ${PROJECT_VERSION_MAJOR} +#define SDF_MINOR_VERSION ${PROJECT_VERSION_MINOR} +#define SDF_PATCH_VERSION ${PROJECT_VERSION_PATCH} -#define SDF_MAJOR_VERSION_STR "${SDF_MAJOR_VERSION}" -#define SDF_MINOR_VERSION_STR "${SDF_MINOR_VERSION}" -#define SDF_PATCH_VERSION_STR "${SDF_PATCH_VERSION}" +#define SDF_MAJOR_VERSION_STR "${PROJECT_VERSION_MAJOR}" +#define SDF_MINOR_VERSION_STR "${PROJECT_VERSION_MINOR}" +#define SDF_PATCH_VERSION_STR "${PROJECT_VERSION_PATCH}" -#define SDF_PKG_VERSION "${SDF_VERSION}" -#define SDF_VERSION_FULL "${SDF_VERSION_FULL}" -#define SDF_VERSION_NAME ${SDF_VERSION_NAME} -#define SDF_VERSION_NAMESPACE v${SDF_MAJOR_VERSION} +#define SDF_PKG_VERSION "${PROJECT_VERSION}" +#define SDF_VERSION_FULL "${PROJECT_VERSION_FULL}" +#define SDF_VERSION_NAME ${PROJECT_VERSION_NAME} +#define SDF_VERSION_NAMESPACE v${PROJECT_VERSION_MAJOR} #define SDF_VERSION_HEADER "Simulation Description Format (SDF), version ${SDF_PROTOCOL_VERSION}\nCopyright (C) 2014 Open Source Robotics Foundation.\nReleased under the Apache 2 License.\nhttp://gazebosim.org/sdf\n\n" @@ -34,4 +34,4 @@ #cmakedefine SDFORMAT_DISABLE_CONSOLE_LOGFILE 1 #define SDF_SHARE_PATH "${CMAKE_INSTALL_FULL_DATAROOTDIR}/" -#define SDF_VERSION_PATH "${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/${SDF_PKG_VERSION}" +#define SDF_VERSION_PATH "${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}" From c6aeb0c4a10cb48052d003b6401d9420ea6039d4 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 10 Nov 2021 12:08:46 +0800 Subject: [PATCH 05/29] build integration and performance tests Signed-off-by: Teo Koon Peng --- CMakeLists.txt | 4 -- cmake/Modules/FindTinyXML2.cmake | 42 ------------------- src/CMakeLists.txt | 10 ++--- test/CMakeLists.txt | 27 ++++-------- test/integration/CMakeLists.txt | 6 +-- test/integration/audio.cc | 2 +- test/integration/category_bitmask.cc | 2 +- .../cfm_damping_implicit_spring_damper.cc | 2 +- test/integration/converter.cc | 2 +- .../disable_fixed_joint_reduction.cc | 2 +- test/integration/element_memory_leak.cc | 2 +- test/integration/fixed_joint_reduction.cc | 2 +- test/integration/force_torque_sensor.cc | 2 +- test/integration/frame.cc | 2 +- test/integration/include.cc | 2 +- test/integration/joint_axis_frame.cc | 2 +- test/integration/link_light.cc | 2 +- test/integration/locale_fix.cc | 2 +- test/integration/locale_fix_cxx.cc | 2 +- test/integration/material.cc | 2 +- test/integration/material_pbr.cc | 2 +- test/integration/model_versions.cc | 2 +- test/integration/nested_model.cc | 2 +- test/integration/parser_error_detection.cc | 2 +- test/integration/plugin_attribute.cc | 2 +- test/integration/plugin_bool.cc | 2 +- test/integration/plugin_include.cc | 2 +- test/integration/provide_feedback.cc | 2 +- test/integration/schema_test.cc | 2 +- test/integration/sdf_basic.cc | 2 +- test/integration/sdf_custom.cc | 2 +- test/integration/unknown.cc | 2 +- test/integration/urdf_gazebo_extensions.cc | 2 +- test/integration/urdf_joint_parameters.cc | 2 +- test/performance/CMakeLists.txt | 4 +- test/performance/parser_urdf.cc | 2 +- 36 files changed, 45 insertions(+), 108 deletions(-) delete mode 100644 cmake/Modules/FindTinyXML2.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index e2edc0419..744479075 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,10 +38,6 @@ configure_file (include/sdf/config.hh.in include/sdf/config.hh) if (BUILD_SDF) - include_directories(include - ${PROJECT_BINARY_DIR}/include - ) - ign_configure_project(INCLUDE_DIR sdf NO_IGNITION_PREFIX) message (STATUS "\n\n====== Finding 3rd Party Packages ======") diff --git a/cmake/Modules/FindTinyXML2.cmake b/cmake/Modules/FindTinyXML2.cmake deleted file mode 100644 index fd3571e9b..000000000 --- a/cmake/Modules/FindTinyXML2.cmake +++ /dev/null @@ -1,42 +0,0 @@ -# CMake Logic to find system TinyXML2, sourced from: -# ros2/tinyxml2_vendor -# https://github.com/ros2/tinyxml2_vendor/commit/fde8000d31d68ff555431d63af3c324afba9f117#diff-120198e331f1dd3e7806c31af0cfb425 - -# The CMake Logic here is licensed under Apache License 2.0 -# TinyXML2 itself is licensed under the zlib License - -# TinyXML2_FOUND -# TinyXML2_INCLUDE_DIRS -# TinyXML2_LIBRARIES - -# try to find the CMake config file for TinyXML2 first -find_package(TinyXML2 CONFIG NAMES tinyxml2 QUIET) -if(TinyXML2_FOUND) - message(STATUS "Found TinyXML2 via Config file: ${TinyXML2_DIR}") - if(NOT TINYXML2_LIBRARY) - # in this case, we're probably using TinyXML2 version 5.0.0 or greater - # in which case tinyxml2 is an exported target and we should use that - if(TARGET tinyxml2) - set(TINYXML2_LIBRARY tinyxml2) - elseif(TARGET tinyxml2::tinyxml2) - set(TINYXML2_LIBRARY tinyxml2::tinyxml2) - endif() - endif() -else() - find_path(TINYXML2_INCLUDE_DIR NAMES tinyxml2.h) - - find_library(TINYXML2_LIBRARY tinyxml2) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(TinyXML2 DEFAULT_MSG TINYXML2_LIBRARY TINYXML2_INCLUDE_DIR) - - mark_as_advanced(TINYXML2_INCLUDE_DIR TINYXML2_LIBRARY) -endif() - -# Set mixed case INCLUDE_DIRS and LIBRARY variables from upper case ones. -if(NOT TinyXML2_INCLUDE_DIRS) - set(TinyXML2_INCLUDE_DIRS ${TINYXML2_INCLUDE_DIR}) -endif() -if(NOT TinyXML2_LIBRARIES) - set(TinyXML2_LIBRARIES ${TINYXML2_LIBRARY}) -endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c48d25864..5249f03f3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -198,11 +198,11 @@ if (BUILD_SDF_TEST) endif() if (TARGET UNIT_XmlUtils_TEST) - target_link_libraries(UNIT_XmlUtils_TEST ${TinyXML2_LIBRARIES}) + target_link_libraries(UNIT_XmlUtils_TEST ${TINYXML2_LIBRARIES}) endif() if (TARGET UNIT_Converter_TEST) - target_link_libraries(UNIT_Converter_TEST ${TinyXML2_LIBRARIES}) + target_link_libraries(UNIT_Converter_TEST ${TINYXML2_LIBRARIES}) endif() if (TARGET UNIT_parser_urdf_TEST) @@ -213,7 +213,7 @@ if (BUILD_SDF_TEST) endif() target_link_libraries(UNIT_parser_urdf_TEST ${URDF_LIBRARIES}) endif() - target_link_libraries(UNIT_parser_urdf_TEST ${TinyXML2_LIBRARIES}) + target_link_libraries(UNIT_parser_urdf_TEST ${TINYXML2_LIBRARIES}) endif() if (TARGET UNIT_ParamPassing_TEST) @@ -224,7 +224,7 @@ if (BUILD_SDF_TEST) endif() target_link_libraries(UNIT_ParamPassing_TEST ${URDF_LIBRARIES}) endif() - target_link_libraries(UNIT_ParamPassing_TEST ${TinyXML2_LIBRARIES}) + target_link_libraries(UNIT_ParamPassing_TEST ${TINYXML2_LIBRARIES}) endif() endif() @@ -234,7 +234,7 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER} ignition-utils${IGN_UTILS_VER}::ignition-utils${IGN_UTILS_VER} PRIVATE - ${TinyXML2_LIBRARIES}) + ${TINYXML2_LIBRARIES}) if (WIN32) target_compile_definitions(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE URDFDOM_STATIC) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2c2ad7f7e..dc88f2ac4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,25 +1,12 @@ -include_directories ( - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_BINARY_DIR}/include - ${PROJECT_SOURCE_DIR}/test/gtest/include - ${PROJECT_SOURCE_DIR}/test/gtest - ${PROJECT_SOURCE_DIR}/test - ${IGNITION-MATH_INCLUDE_DIRS} -) - -link_directories( - ${IGNITION-MATH_LIBRARY_DIRS} -) - -if (USE_EXTERNAL_TINYXML) - include_directories(${tinyxml_INCLUDE_DIRS}) - link_directories(${tinyxml_LIBRARY_DIRS}) -endif() - configure_file(test_config.h.in ${PROJECT_BINARY_DIR}/test_config.h) # Build gtest add_library(gtest STATIC gtest/src/gtest-all.cc) +target_include_directories(gtest + PRIVATE + ${PROJECT_SOURCE_DIR}/test/gtest/include + ${PROJECT_SOURCE_DIR}/test/gtest +) add_library(gtest_main STATIC gtest/src/gtest_main.cc) target_link_libraries(gtest_main gtest) set(GTEST_LIBRARY "${PROJECT_BINARY_DIR}/test/libgtest.a") @@ -29,5 +16,5 @@ execute_process(COMMAND cmake -E remove_directory ${CMAKE_BINARY_DIR}/test_resul execute_process(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test_results) include_directories(${GTEST_INCLUDE_DIRS}) -# add_subdirectory(integration) -# add_subdirectory(performance) +add_subdirectory(integration) +add_subdirectory(performance) diff --git a/test/integration/CMakeLists.txt b/test/integration/CMakeLists.txt index 58beeb7b7..10b0519c0 100644 --- a/test/integration/CMakeLists.txt +++ b/test/integration/CMakeLists.txt @@ -62,12 +62,10 @@ find_program(XMLLINT_EXE xmllint) if (EXISTS ${XMLLINT_EXE}) set (tests ${tests} schema_test.cc) else() - BUILD_WARNING("xmllint not found. schema_test won't be run") + ign_build_warning("xmllint not found. schema_test won't be run") endif() -link_directories(${PROJECT_BINARY_DIR}/test) - -# sdf_build_tests(${tests}) +ign_build_tests(TYPE ${TEST_TYPE} SOURCES ${tests} INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/test) if (EXISTS ${XMLLINT_EXE}) # Need to run schema target (build .xsd files) before running schema_test diff --git a/test/integration/audio.cc b/test/integration/audio.cc index 53ed8fd04..e5c174d22 100644 --- a/test/integration/audio.cc +++ b/test/integration/audio.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/category_bitmask.cc b/test/integration/category_bitmask.cc index f99975a1c..33d1f0e76 100644 --- a/test/integration/category_bitmask.cc +++ b/test/integration/category_bitmask.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" ///////////////////////////////////////////////// TEST(CategoryBitmask, WasSpecified) diff --git a/test/integration/cfm_damping_implicit_spring_damper.cc b/test/integration/cfm_damping_implicit_spring_damper.cc index 936833ebb..d1eac2cf1 100644 --- a/test/integration/cfm_damping_implicit_spring_damper.cc +++ b/test/integration/cfm_damping_implicit_spring_damper.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/converter.cc b/test/integration/converter.cc index f85251419..f0aaec46f 100644 --- a/test/integration/converter.cc +++ b/test/integration/converter.cc @@ -20,7 +20,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/disable_fixed_joint_reduction.cc b/test/integration/disable_fixed_joint_reduction.cc index fd7b53a5c..fffb5d8bd 100644 --- a/test/integration/disable_fixed_joint_reduction.cc +++ b/test/integration/disable_fixed_joint_reduction.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/element_memory_leak.cc b/test/integration/element_memory_leak.cc index a01af3972..e98acde10 100644 --- a/test/integration/element_memory_leak.cc +++ b/test/integration/element_memory_leak.cc @@ -20,7 +20,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/fixed_joint_reduction.cc b/test/integration/fixed_joint_reduction.cc index d03995595..e444a6525 100644 --- a/test/integration/fixed_joint_reduction.cc +++ b/test/integration/fixed_joint_reduction.cc @@ -20,7 +20,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/force_torque_sensor.cc b/test/integration/force_torque_sensor.cc index 08c912307..018cdaabb 100644 --- a/test/integration/force_torque_sensor.cc +++ b/test/integration/force_torque_sensor.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/frame.cc b/test/integration/frame.cc index 8f40136d1..73fd42611 100644 --- a/test/integration/frame.cc +++ b/test/integration/frame.cc @@ -30,7 +30,7 @@ #include "sdf/SDFImpl.hh" #include "sdf/World.hh" #include "sdf/parser.hh" -#include "ignition/sdformat/config.hh" +#include "sdf/config.hh" #include "test_config.h" diff --git a/test/integration/include.cc b/test/integration/include.cc index b42eafe55..285a8a777 100644 --- a/test/integration/include.cc +++ b/test/integration/include.cc @@ -20,7 +20,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/joint_axis_frame.cc b/test/integration/joint_axis_frame.cc index c5ede36ee..dc2a9f375 100644 --- a/test/integration/joint_axis_frame.cc +++ b/test/integration/joint_axis_frame.cc @@ -20,7 +20,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" std::string get_sdf_string(const std::string &_version) { diff --git a/test/integration/link_light.cc b/test/integration/link_light.cc index e2e23ec7a..979a56185 100644 --- a/test/integration/link_light.cc +++ b/test/integration/link_light.cc @@ -18,7 +18,7 @@ #include #include #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/locale_fix.cc b/test/integration/locale_fix.cc index a04f1854c..dc001569f 100644 --- a/test/integration/locale_fix.cc +++ b/test/integration/locale_fix.cc @@ -20,7 +20,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/locale_fix_cxx.cc b/test/integration/locale_fix_cxx.cc index f33455d01..4c0e01f24 100644 --- a/test/integration/locale_fix_cxx.cc +++ b/test/integration/locale_fix_cxx.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" TEST(CheckFixForLocal, CheckFixForCxxLocal) { diff --git a/test/integration/material.cc b/test/integration/material.cc index 75d8f85c5..aecd1bcb4 100644 --- a/test/integration/material.cc +++ b/test/integration/material.cc @@ -20,7 +20,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" void ExpectInvalidWithMessage(sdf::Errors &_errors, std::string _compType) diff --git a/test/integration/material_pbr.cc b/test/integration/material_pbr.cc index 89e529a85..635d38279 100644 --- a/test/integration/material_pbr.cc +++ b/test/integration/material_pbr.cc @@ -17,7 +17,7 @@ #include #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "sdf/Pbr.hh" #include "test_config.h" diff --git a/test/integration/model_versions.cc b/test/integration/model_versions.cc index 03be6e029..33540b7c3 100644 --- a/test/integration/model_versions.cc +++ b/test/integration/model_versions.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/nested_model.cc b/test/integration/nested_model.cc index 7111c59e5..722b252cc 100644 --- a/test/integration/nested_model.cc +++ b/test/integration/nested_model.cc @@ -23,7 +23,7 @@ #include #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/parser_error_detection.cc b/test/integration/parser_error_detection.cc index 047a0ab68..0e750956d 100644 --- a/test/integration/parser_error_detection.cc +++ b/test/integration/parser_error_detection.cc @@ -20,7 +20,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" std::string get_sdf_string() { diff --git a/test/integration/plugin_attribute.cc b/test/integration/plugin_attribute.cc index f2280774f..000512bff 100644 --- a/test/integration/plugin_attribute.cc +++ b/test/integration/plugin_attribute.cc @@ -20,7 +20,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" std::string get_sdf_string() { diff --git a/test/integration/plugin_bool.cc b/test/integration/plugin_bool.cc index de4b14d8d..88684cb15 100644 --- a/test/integration/plugin_bool.cc +++ b/test/integration/plugin_bool.cc @@ -20,7 +20,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" std::string get_sdf_string() { diff --git a/test/integration/plugin_include.cc b/test/integration/plugin_include.cc index c14c3b0e8..e6234a3b1 100644 --- a/test/integration/plugin_include.cc +++ b/test/integration/plugin_include.cc @@ -17,7 +17,7 @@ #include #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/provide_feedback.cc b/test/integration/provide_feedback.cc index 04508a09d..a200c329b 100644 --- a/test/integration/provide_feedback.cc +++ b/test/integration/provide_feedback.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/schema_test.cc b/test/integration/schema_test.cc index f144a5c5a..a53807b28 100644 --- a/test/integration/schema_test.cc +++ b/test/integration/schema_test.cc @@ -21,7 +21,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/sdf_basic.cc b/test/integration/sdf_basic.cc index e168198a7..a4f5e674c 100644 --- a/test/integration/sdf_basic.cc +++ b/test/integration/sdf_basic.cc @@ -16,7 +16,7 @@ */ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/sdf_custom.cc b/test/integration/sdf_custom.cc index cffa28e1f..9898b952c 100644 --- a/test/integration/sdf_custom.cc +++ b/test/integration/sdf_custom.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/unknown.cc b/test/integration/unknown.cc index 377b698a3..f3b64a780 100644 --- a/test/integration/unknown.cc +++ b/test/integration/unknown.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "sdf/Error.hh" #include "test_config.h" diff --git a/test/integration/urdf_gazebo_extensions.cc b/test/integration/urdf_gazebo_extensions.cc index 2b1d6c655..552a97408 100644 --- a/test/integration/urdf_gazebo_extensions.cc +++ b/test/integration/urdf_gazebo_extensions.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/integration/urdf_joint_parameters.cc b/test/integration/urdf_joint_parameters.cc index 3f2cfdc76..dfb36f481 100644 --- a/test/integration/urdf_joint_parameters.cc +++ b/test/integration/urdf_joint_parameters.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" diff --git a/test/performance/CMakeLists.txt b/test/performance/CMakeLists.txt index 31fb66451..807cb38e6 100644 --- a/test/performance/CMakeLists.txt +++ b/test/performance/CMakeLists.txt @@ -4,6 +4,4 @@ set(tests parser_urdf.cc ) -link_directories(${PROJECT_BINARY_DIR}/test) - -# sdf_build_tests(${tests}) +ign_build_tests(TYPE ${TEST_TYPE} SOURCES ${tests} INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/test) diff --git a/test/performance/parser_urdf.cc b/test/performance/parser_urdf.cc index f19ca6e90..cb3a5df08 100644 --- a/test/performance/parser_urdf.cc +++ b/test/performance/parser_urdf.cc @@ -19,7 +19,7 @@ #include -#include "ignition/sdformat.hh" +#include "sdformat.hh" #include "test_config.h" From 63c90279ec64ca9e463d4ecbd1d91f3896cd3460 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 10 Nov 2021 12:19:40 +0800 Subject: [PATCH 06/29] cleanup usage of link_directories Signed-off-by: Teo Koon Peng --- cmake/SDFUtils.cmake | 90 ----------------------------------------- examples/CMakeLists.txt | 7 +--- src/CMakeLists.txt | 27 +++++++------ 3 files changed, 17 insertions(+), 107 deletions(-) diff --git a/cmake/SDFUtils.cmake b/cmake/SDFUtils.cmake index 5b12c1b97..94e12ebc4 100644 --- a/cmake/SDFUtils.cmake +++ b/cmake/SDFUtils.cmake @@ -51,96 +51,6 @@ macro (sdf_setup_windows) set(CMAKE_C_FLAGS_RELEASE "/MD ${CMAKE_C_FLAGS_RELEASE}") endmacro() -################################################# -# VAR: SDF_BUILD_TESTS_EXTRA_EXE_SRCS -# Hack: extra sources to build binaries can be supplied to gz_build_tests in -# the variable SDF_BUILD_TESTS_EXTRA_EXE_SRCS. This variable will be clean up -# at the end of the function -# -include_directories(${PROJECT_SOURCE_DIR}/test/gtest/include) -macro (sdf_build_tests) - # Build all the tests - foreach(GTEST_SOURCE_file ${ARGN}) - string(REGEX REPLACE ".cc" "" BINARY_NAME ${GTEST_SOURCE_file}) - set(BINARY_NAME ${TEST_TYPE}_${BINARY_NAME}) - - add_executable(${BINARY_NAME} - ${GTEST_SOURCE_file} - ${SDF_BUILD_TESTS_EXTRA_EXE_SRCS} - ) - - add_dependencies(${BINARY_NAME} - gtest gtest_main ${sdf_target} - ) - - link_directories(${IGNITION-MATH_LIBRARY_DIRS}) - target_link_libraries(${BINARY_NAME} ${tinyxml2_LIBRARIES}) - - if (UNIX) - target_link_libraries(${BINARY_NAME} PRIVATE - libgtest.a - libgtest_main.a - ${sdf_target} - pthread - ${IGNITION-MATH_LIBRARIES} - ) - elseif(WIN32) - target_link_libraries(${BINARY_NAME} PRIVATE - gtest.lib - gtest_main.lib - ${sdf_target} - ${IGNITION-MATH_LIBRARIES} - ) - - # Copy in sdformat library - add_custom_command(TARGET ${BINARY_NAME} - COMMAND ${CMAKE_COMMAND} -E copy_if_different - $ - $ VERBATIM) - - endif() - - add_test(${BINARY_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME} - --gtest_output=xml:${CMAKE_BINARY_DIR}/test_results/${BINARY_NAME}.xml) - - set (_env_vars) - set (sdf_paths) - - # Get all the sdf protocol directory names - file(GLOB dirs RELATIVE "${PROJECT_SOURCE_DIR}/sdf" - "${PROJECT_SOURCE_DIR}/sdf/*") - list(SORT dirs) - - # Add each sdf protocol to the sdf_path variable - foreach(dir ${dirs}) - if (IS_DIRECTORY ${PROJECT_SOURCE_DIR}/sdf/${dir}) - set(sdf_paths "${PROJECT_SOURCE_DIR}/sdf/${dir}:${sdf_paths}") - endif() - endforeach() - - # Set the SDF_PATH environment variable - list(APPEND _env_vars "SDF_PATH=${sdf_paths}") - - set_tests_properties(${BINARY_NAME} PROPERTIES - TIMEOUT 240 - ENVIRONMENT "${_env_vars}") - - if(PYTHONINTERP_FOUND) - # Check that the test produced a result and create a failure if it didn't. - # Guards against crashed and timed out tests. - add_test(check_${BINARY_NAME} ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/check_test_ran.py - ${CMAKE_BINARY_DIR}/test_results/${BINARY_NAME}.xml) - endif() - - if(SDFORMAT_RUN_VALGRIND_TESTS AND VALGRIND_PROGRAM) - add_test(memcheck_${BINARY_NAME} ${VALGRIND_PROGRAM} --leak-check=full - --error-exitcode=1 --show-leak-kinds=all ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}) - endif() - endforeach() - - set(GZ_BUILD_TESTS_EXTRA_EXE_SRCS "") -endmacro() - ################################################# # Macro to setup supported compiler warnings # Based on work of Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST. diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 39caedb85..995fa11ad 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -4,11 +4,8 @@ find_package(sdformat13 REQUIRED) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") -include_directories(${SDFormat_INCLUDE_DIRS}) -link_directories(${SDFormat_LIBRARY_DIRS}) - add_executable(simple simple.cc) -target_link_libraries(simple ${SDFormat_LIBRARIES}) +target_link_libraries(simple sdformat13) add_executable(dom dom.cc) -target_link_libraries(dom ${SDFormat_LIBRARIES}) +target_link_libraries(dom sdformat13) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5249f03f3..e8d0a4c96 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,13 +1,5 @@ include (${sdf_cmake_dir}/SDFUtils.cmake) -link_directories( - ${PROJECT_BINARY_DIR}/test -) - -if (NOT USE_INTERNAL_URDF) - link_directories(${URDF_LIBRARY_DIRS}) -endif() - set (sources Actor.cc AirPressure.cc @@ -79,7 +71,6 @@ set (sources include_directories(${CMAKE_CURRENT_SOURCE_DIR}) if (USE_INTERNAL_URDF) - include_directories(${CMAKE_CURRENT_SOURCE_DIR}/urdf) set(sources ${sources} urdf/urdf_parser/model.cpp urdf/urdf_parser/link.cpp @@ -89,8 +80,6 @@ if (USE_INTERNAL_URDF) urdf/urdf_parser/urdf_model_state.cpp urdf/urdf_parser/urdf_sensor.cpp urdf/urdf_parser/world.cpp) -else() - include_directories(${URDF_INCLUDE_DIRS}) endif() if (BUILD_SDF_TEST) @@ -229,12 +218,26 @@ if (BUILD_SDF_TEST) endif() ign_create_core_library(SOURCES ${sources} CXX_STANDARD 17) + target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER} ignition-utils${IGN_UTILS_VER}::ignition-utils${IGN_UTILS_VER} PRIVATE - ${TINYXML2_LIBRARIES}) + ${TINYXML2_LIBRARIES} +) + +if (USE_INTERNAL_URDF) + target_include_directories(${PROJECT_LIBRARY_TARGET_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/urdf + ) +else() + target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} + PRIVATE + ${URDF_LIBRARIES} + ) +endif() if (WIN32) target_compile_definitions(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE URDFDOM_STATIC) From b2f395de145668e84cfb4a69bb09cd35d0695157 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 10 Nov 2021 12:21:23 +0800 Subject: [PATCH 07/29] remove unused files Signed-off-by: Teo Koon Peng --- cmake/CodeCoverage.cmake | 135 --------------------------------- cmake/DefaultCFlags.cmake | 79 ------------------- cmake/FindSSE.cmake | 115 ---------------------------- cmake/cmake_uninstall.cmake.in | 21 ----- 4 files changed, 350 deletions(-) delete mode 100644 cmake/CodeCoverage.cmake delete mode 100644 cmake/DefaultCFlags.cmake delete mode 100644 cmake/FindSSE.cmake delete mode 100644 cmake/cmake_uninstall.cmake.in diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake deleted file mode 100644 index 7eb4f7c56..000000000 --- a/cmake/CodeCoverage.cmake +++ /dev/null @@ -1,135 +0,0 @@ -# -# 2012-01-31, Lars Bilke -# - Enable Code Coverage -# -# 2013-09-17, Joakim Söderberg -# - Added support for Clang. -# - Some additional usage instructions. -# -# USAGE: -# 1. Copy this file into your cmake modules path. -# -# 2. Add the following line to your CMakeLists.txt: -# INCLUDE(CodeCoverage) -# -# 3. Set compiler flags to turn off optimization and enable coverage: -# SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage") -# SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage") -# -# 3. Use the function SETUP_TARGET_FOR_COVERAGE to create a custom make target -# which runs your test executable and produces a lcov code coverage report: -# Example: -# SETUP_TARGET_FOR_COVERAGE( -# my_coverage_target # Name for custom target. -# test_driver # Name of the test driver executable that runs the tests. -# # NOTE! This should always have a ZERO as exit code -# # otherwise the coverage generation will not complete. -# coverage # Name of output directory. -# ) -# -# 4. Build a Debug build: -# cmake -DCMAKE_BUILD_TYPE=Debug .. -# make -# make my_coverage_target -# -# - -# Check prereqs - -FIND_PROGRAM( GCOV_PATH NAMES gcov-8 gcov ) -FIND_PROGRAM( LCOV_PATH lcov ) -FIND_PROGRAM( GREP_PATH grep ) -FIND_PROGRAM( GENHTML_PATH genhtml ) -FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests) - -IF(NOT GCOV_PATH) - MESSAGE(FATAL_ERROR "gcov not found! Aborting...") -ENDIF() # NOT GCOV_PATH - -IF(NOT CMAKE_COMPILER_IS_GNUCXX) - # Clang version 3.0.0 and greater now supports gcov as well. - MESSAGE(WARNING "Compiler is not GNU gcc! Clang Version 3.0.0 and greater supports gcov as well, but older versions don't.") - - IF(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...") - ENDIF() -ENDIF() # NOT CMAKE_COMPILER_IS_GNUCXX - -SET(CMAKE_CXX_FLAGS_COVERAGE - "-g -O0 --coverage -fprofile-arcs -ftest-coverage" - CACHE STRING "Flags used by the C++ compiler during coverage builds." - FORCE ) -SET(CMAKE_C_FLAGS_COVERAGE - "-g -O0 --coverage -fprofile-arcs -ftest-coverage" - CACHE STRING "Flags used by the C compiler during coverage builds." - FORCE ) -SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE - "" - CACHE STRING "Flags used for linking binaries during coverage builds." - FORCE ) -SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE - "" - CACHE STRING "Flags used by the shared libraries linker during coverage builds." - FORCE ) -MARK_AS_ADVANCED( - CMAKE_CXX_FLAGS_COVERAGE - CMAKE_C_FLAGS_COVERAGE - CMAKE_EXE_LINKER_FLAGS_COVERAGE - CMAKE_SHARED_LINKER_FLAGS_COVERAGE ) - -IF ( NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Coverage")) - MESSAGE( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" ) -ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug" - - -# Param _targetname The name of new the custom make target -# Param _testrunner The name of the target which runs the tests. -# MUST return ZERO always, even on errors. -# If not, no coverage report will be created! -# Param _outputname lcov output is generated as _outputname.info -# HTML report is generated in _outputname/index.html -# Optional fourth parameter is passed as arguments to _testrunner -# Pass them in list form, e.g.: "-j;2" for -j 2 -FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname) - - IF(NOT LCOV_PATH) - MESSAGE(FATAL_ERROR "lcov not found! Aborting...") - ENDIF() # NOT LCOV_PATH - - IF(NOT GENHTML_PATH) - MESSAGE(FATAL_ERROR "genhtml not found! Aborting...") - ENDIF() # NOT GENHTML_PATH - - IF(NOT GREP_PATH) - MESSAGE(FATAL_ERROR "grep not found! Run code coverage on linux or mac.") - ENDIF() - - # Setup target - ADD_CUSTOM_TARGET(${_targetname} - - COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info.cleaned - ${_outputname}.info - # Capturing lcov counters and generating report - COMMAND ${LCOV_PATH} -q --no-checksum --directory ${PROJECT_BINARY_DIR} - --gcov-tool ${GCOV_PATH} --capture --output-file ${_outputname}.info 2>/dev/null - COMMAND ${LCOV_PATH} -q --remove ${_outputname}.info - --gcov-tool ${GCOV_PATH} '*/test/*' '/usr/*' '*_TEST*' --output-file ${_outputname}.info.cleaned - COMMAND ${GENHTML_PATH} -q --legend -o ${_outputname} - ${_outputname}.info.cleaned - COMMAND ${LCOV_PATH} --summary ${_outputname}.info.cleaned 2>&1 | grep "lines" | cut -d ' ' -f 4 | cut -d '%' -f 1 > coverage/lines.txt - COMMAND ${LCOV_PATH} --summary ${_outputname}.info.cleaned 2>&1 | grep "functions" | cut -d ' ' -f 4 | cut -d '%' -f 1 > coverage/functions.txt - COMMAND ${CMAKE_COMMAND} -E rename ${_outputname}.info.cleaned - ${_outputname}.info - - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - COMMENT "Resetting code coverage counters to zero.\n" - "Processing code coverage counters and generating report." - ) - - # Show info where to find the report - ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD - COMMAND COMMAND ${LCOV_PATH} -q --zerocounters --directory ${PROJECT_BINARY_DIR}; - COMMENT "Open ./${_outputname}/index.html in your browser to view the coverage report." - ) - -ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE diff --git a/cmake/DefaultCFlags.cmake b/cmake/DefaultCFlags.cmake deleted file mode 100644 index be57d0a3d..000000000 --- a/cmake/DefaultCFlags.cmake +++ /dev/null @@ -1,79 +0,0 @@ -# Build type link flags -set (CMAKE_LINK_FLAGS_RELEASE " " CACHE INTERNAL "Link flags for release" FORCE) -set (CMAKE_LINK_FLAGS_RELWITHDEBINFO " " CACHE INTERNAL "Link flags for release with debug support" FORCE) -set (CMAKE_LINK_FLAGS_DEBUG " " CACHE INTERNAL "Link flags for debug" FORCE) -set (CMAKE_LINK_FLAGS_PROFILE " -pg" CACHE INTERNAL "Link flags for profile" FORCE) -set (CMAKE_LINK_FLAGS_COVERAGE " --coverage" CACHE INTERNAL "Link flags for static code coverage" FORCE) - -set (CMAKE_C_FLAGS_RELEASE "") -if (NOT "${CMAKE_CXX_COMPILER_ID} " STREQUAL "Clang " AND NOT MSVC) - # -s doesn't work with clang or Visual Studio, see alternative in link below: - # http://stackoverflow.com/questions/6085491/gcc-vs-clang-symbol-strippingu - set (CMAKE_C_FLAGS_RELEASE "-s") -endif() - -if (NOT MSVC) - set (CMAKE_C_FLAGS_RELEASE " ${CMAKE_C_FLAGS_RELEASE} -O3 -DNDEBUG ${CMAKE_C_FLAGS_ALL}" CACHE INTERNAL "C Flags for release" FORCE) - set (CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) - - set (CMAKE_C_FLAGS_RELWITHDEBINFO " -g -O2 ${CMAKE_C_FLAGS_ALL}" CACHE INTERNAL "C Flags for release with debug support" FORCE) - set (CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO}) - - set (CMAKE_C_FLAGS_DEBUG " -ggdb3 ${CMAKE_C_FLAGS_ALL}" CACHE INTERNAL "C Flags for debug" FORCE) - set (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) - - set (CMAKE_C_FLAGS_PROFILE " -fno-omit-frame-pointer -g -pg ${CMAKE_C_FLAGS_ALL}" CACHE INTERNAL "C Flags for profile" FORCE) - set (CMAKE_CXX_FLAGS_PROFILE ${CMAKE_C_FLAGS_PROFILE}) - - set (CMAKE_C_FLAGS_COVERAGE " -g -O0 -Wformat=2 --coverage -fno-inline ${CMAKE_C_FLAGS_ALL}" CACHE INTERNAL "C Flags for static code coverage" FORCE) - set (CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_C_FLAGS_COVERAGE}") - foreach(flag - -fno-default-inline - -fno-elide-constructors - -fno-implicit-inline-templates) - CHECK_CXX_COMPILER_FLAG(${flag} R${flag}) - if (R${flag}) - set (CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} ${flag}") - endif() - endforeach() -endif() - -##################################### -# Set all the global build flags -set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}") -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}") -set (CMAKE_CXX_EXTENSIONS off) -set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}") -set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}") -set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_LINK_FLAGS_${CMAKE_BUILD_TYPE_UPPERCASE}}") - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -if (UNIX) - # Add visibility in UNIX - check_gcc_visibility() - if (GCC_SUPPORTS_VISIBILITY) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") - endif() -endif() - -# Compiler-specific C++17 activation. -if ("${CMAKE_CXX_COMPILER_ID} " MATCHES "GNU ") - execute_process( - COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) - if (NOT (GCC_VERSION VERSION_GREATER_EQUAL 7.0)) - message(STATUS "Found version ${GCC_VERSION}") - message(FATAL_ERROR "${PROJECT_NAME} requires g++ 7.0 or greater.") - endif () -elseif ("${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang ") - if(APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - endif() -elseif ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "MSVC ") - if (MSVC_VERSION LESS 1914) - message(FATAL_ERROR "${PROJECT_NAME} requires VS 2017 or greater.") - endif() -else () - message(FATAL_ERROR "Your C++ compiler does not support C++17.") -endif () diff --git a/cmake/FindSSE.cmake b/cmake/FindSSE.cmake deleted file mode 100644 index cdbcfcc3d..000000000 --- a/cmake/FindSSE.cmake +++ /dev/null @@ -1,115 +0,0 @@ -# Check if SSE instructions are available on the machine where -# the project is compiled. - -IF (ARCH MATCHES "i386" OR ARCH MATCHES "x86_64") - IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - EXEC_PROGRAM(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO) - - STRING(REGEX REPLACE "^.*(sse2).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "sse2" "${SSE_THERE}" SSE2_TRUE) - IF (SSE2_TRUE) - set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") - ELSE (SSE2_TRUE) - set(SSE2_FOUND false CACHE BOOL "SSE2 available on host") - ENDIF (SSE2_TRUE) - - # /proc/cpuinfo apparently omits sse3 :( - STRING(REGEX REPLACE "^.*[^s](sse3).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "sse3" "${SSE_THERE}" SSE3_TRUE) - IF (NOT SSE3_TRUE) - STRING(REGEX REPLACE "^.*(T2300).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "T2300" "${SSE_THERE}" SSE3_TRUE) - ENDIF (NOT SSE3_TRUE) - - STRING(REGEX REPLACE "^.*(ssse3).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "ssse3" "${SSE_THERE}" SSSE3_TRUE) - IF (SSE3_TRUE OR SSSE3_TRUE) - set(SSE3_FOUND true CACHE BOOL "SSE3 available on host") - ELSE (SSE3_TRUE OR SSSE3_TRUE) - set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") - ENDIF (SSE3_TRUE OR SSSE3_TRUE) - IF (SSSE3_TRUE) - set(SSSE3_FOUND true CACHE BOOL "SSSE3 available on host") - ELSE (SSSE3_TRUE) - set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") - ENDIF (SSSE3_TRUE) - - STRING(REGEX REPLACE "^.*(sse4_1).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "sse4_1" "${SSE_THERE}" SSE41_TRUE) - IF (SSE41_TRUE) - set(SSE4_1_FOUND true CACHE BOOL "SSE4.1 available on host") - ELSE (SSE41_TRUE) - set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") - ENDIF (SSE41_TRUE) - - STRING(REGEX REPLACE "^.*(sse4_2).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "sse4_2" "${SSE_THERE}" SSE42_TRUE) - IF (SSE42_TRUE) - set(SSE4_2_FOUND true CACHE BOOL "SSE4.2 available on host") - ELSE (SSE42_TRUE) - set(SSE4_2_FOUND false CACHE BOOL "SSE4.2 available on host") - ENDIF (SSE42_TRUE) - - ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin") - EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE - CPUINFO) - - STRING(REGEX REPLACE "^.*[^S](SSE2).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "SSE2" "${SSE_THERE}" SSE2_TRUE) - IF (SSE2_TRUE) - set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") - ELSE (SSE2_TRUE) - set(SSE2_FOUND false CACHE BOOL "SSE2 available on host") - ENDIF (SSE2_TRUE) - - STRING(REGEX REPLACE "^.*[^S](SSE3).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "SSE3" "${SSE_THERE}" SSE3_TRUE) - IF (SSE3_TRUE) - set(SSE3_FOUND true CACHE BOOL "SSE3 available on host") - ELSE (SSE3_TRUE) - set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") - ENDIF (SSE3_TRUE) - - STRING(REGEX REPLACE "^.*(SSSE3).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "SSSE3" "${SSE_THERE}" SSSE3_TRUE) - IF (SSSE3_TRUE) - set(SSSE3_FOUND true CACHE BOOL "SSSE3 available on host") - ELSE (SSSE3_TRUE) - set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") - ENDIF (SSSE3_TRUE) - - STRING(REGEX REPLACE "^.*(SSE4.1).*$" "\\1" SSE_THERE ${CPUINFO}) - STRING(COMPARE EQUAL "SSE4.1" "${SSE_THERE}" SSE41_TRUE) - IF (SSE41_TRUE) - set(SSE4_1_FOUND true CACHE BOOL "SSE4.1 available on host") - ELSE (SSE41_TRUE) - set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") - ENDIF (SSE41_TRUE) - ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Windows") - # TODO - set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") - set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") - set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") - set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") - ELSE(CMAKE_SYSTEM_NAME MATCHES "Linux") - set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") - set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") - set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") - set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") - ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") -ENDIF(ARCH MATCHES "i386" OR ARCH MATCHES "x86_64") - -if(NOT SSE2_FOUND) - MESSAGE(STATUS "Could not find hardware support for SSE2 on this machine.") -endif(NOT SSE2_FOUND) -if(NOT SSE3_FOUND) - MESSAGE(STATUS "Could not find hardware support for SSE3 on this machine.") -endif(NOT SSE3_FOUND) -if(NOT SSSE3_FOUND) - MESSAGE(STATUS "Could not find hardware support for SSSE3 on this machine.") -endif(NOT SSSE3_FOUND) -if(NOT SSE4_1_FOUND) - MESSAGE(STATUS "Could not find hardware support for SSE4.1 on this machine.") -endif(NOT SSE4_1_FOUND) - -mark_as_advanced(SSE2_FOUND SSE3_FOUND SSSE3_FOUND SSE4_1_FOUND) diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in deleted file mode 100644 index 2037e3653..000000000 --- a/cmake/cmake_uninstall.cmake.in +++ /dev/null @@ -1,21 +0,0 @@ -if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") -endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - -file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) -string(REGEX REPLACE "\n" ";" files "${files}") -foreach(file ${files}) - message(STATUS "Uninstalling $ENV{DESTDIR}${file}") - if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" - OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval - ) - if(NOT "${rm_retval}" STREQUAL 0) - message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") - endif(NOT "${rm_retval}" STREQUAL 0) - else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - message(STATUS "File $ENV{DESTDIR}${file} does not exist.") - endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) From dfcdf84861f9b80d43cabc71c48374ae130bd41f Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 10 Nov 2021 17:49:58 +0800 Subject: [PATCH 08/29] use findURDF from ign-cmake Signed-off-by: Teo Koon Peng --- cmake/SearchForStuff.cmake | 36 +++++++++--------------------------- src/CMakeLists.txt | 17 +++-------------- 2 files changed, 12 insertions(+), 41 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index df0aae754..736157782 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -12,40 +12,22 @@ ign_find_package(TINYXML2 REQUIRED) # 1. if USE_INTERNAL_URDF is unset, try to use system installation, fallback to internal copy # 2. if USE_INTERNAL_URDF is set to True, use the internal copy # 3. if USE_INTERNAL_URDF is set to False, force to search system installation, fail on error - -if (NOT PKG_CONFIG_FOUND) - if (NOT DEFINED USE_INTERNAL_URDF) - ign_build_warning("Couldn't find pkg-config for urdfdom, using internal copy") - set(USE_INTERNAL_URDF true) - elseif(NOT USE_INTERNAL_URDF) - ign_build_error("Couldn't find pkg-config for urdfdom") - endif() -endif() - if (NOT DEFINED USE_INTERNAL_URDF OR NOT USE_INTERNAL_URDF) - # check for urdfdom with pkg-config - pkg_check_modules(URDF urdfdom>=1.0) - + ign_find_package(URDF VERSION 1.0 QUIET) if (NOT URDF_FOUND) - find_package(urdfdom QUIET) - if (urdfdom_FOUND) - set(URDF_INCLUDE_DIRS ${urdfdom_INCLUDE_DIRS}) - # ${urdfdom_LIBRARIES} already contains absolute library filenames - set(URDF_LIBRARY_DIRS "") - set(URDF_LIBRARIES ${urdfdom_LIBRARIES}) - elseif (NOT DEFINED USE_INTERNAL_URDF) - message(STATUS "Couldn't find urdfdom >= 1.0, using internal copy") - set(USE_INTERNAL_URDF true) - else() + if (DEFINED USE_INTERNAL_URDF AND NOT USE_INTERNAL_URDF) ign_build_error("Couldn't find the urdfdom >= 1.0 system installation") + else() + # fallback to internal urdf + set(USE_INTERNAL_URDF ON) endif() - else() - # what am I doing here? pkg-config and cmake - set(URDF_INCLUDE_DIRS ${URDF_INCLUDEDIR}) - set(URDF_LIBRARY_DIRS ${URDF_LIBDIR}) endif() endif() +if (USE_INTERNAL_URDF) + message(STATUS "Using internal URDF") +endif() + ################################################# # Find ign command line utility: ign_find_package(ignition-tools) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e8d0a4c96..824211b32 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -200,7 +200,7 @@ if (BUILD_SDF_TEST) if (${CMAKE_VERSION} VERSION_GREATER 3.13) target_link_options(UNIT_parser_urdf_TEST PRIVATE ${URDF_LDFLAGS}) endif() - target_link_libraries(UNIT_parser_urdf_TEST ${URDF_LIBRARIES}) + target_link_libraries(UNIT_parser_urdf_TEST URDF::URDF) endif() target_link_libraries(UNIT_parser_urdf_TEST ${TINYXML2_LIBRARIES}) endif() @@ -211,7 +211,7 @@ if (BUILD_SDF_TEST) if (${CMAKE_VERSION} VERSION_GREATER 3.13) target_link_options(UNIT_ParamPassing_TEST PRIVATE ${URDF_LDFLAGS}) endif() - target_link_libraries(UNIT_ParamPassing_TEST ${URDF_LIBRARIES}) + target_link_libraries(UNIT_ParamPassing_TEST URDF::URDF) endif() target_link_libraries(UNIT_ParamPassing_TEST ${TINYXML2_LIBRARIES}) endif() @@ -235,7 +235,7 @@ if (USE_INTERNAL_URDF) else() target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE - ${URDF_LIBRARIES} + URDF::URDF ) endif() @@ -249,17 +249,6 @@ target_include_directories(${PROJECT_LIBRARY_TARGET_NAME} $ ) -message (STATUS "URDF_LIBRARY_DIRS=${URDF_LIBRARY_DIRS}") -message (STATUS "URDF_LIBRARIES=${URDF_LIBRARIES}") - -if (NOT USE_INTERNAL_URDF) - target_compile_options(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE ${URDF_CFLAGS}) - if (${CMAKE_VERSION} VERSION_GREATER 3.13) - target_link_options(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE ${URDF_LDFLAGS}) - endif() - target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE ${URDF_LIBRARIES}) -endif() - if(NOT WIN32) add_subdirectory(cmd) endif() From e681c41bee142050f9e5837e85cd296710b94814 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Thu, 11 Nov 2021 09:49:22 +0800 Subject: [PATCH 09/29] update find urdf name Signed-off-by: Teo Koon Peng --- cmake/SearchForStuff.cmake | 4 ++-- src/CMakeLists.txt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 736157782..f4be09590 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -13,8 +13,8 @@ ign_find_package(TINYXML2 REQUIRED) # 2. if USE_INTERNAL_URDF is set to True, use the internal copy # 3. if USE_INTERNAL_URDF is set to False, force to search system installation, fail on error if (NOT DEFINED USE_INTERNAL_URDF OR NOT USE_INTERNAL_URDF) - ign_find_package(URDF VERSION 1.0 QUIET) - if (NOT URDF_FOUND) + ign_find_package(IgnURDFDOM VERSION 1.0 QUIET) + if (NOT IgnURDFDOM_FOUND) if (DEFINED USE_INTERNAL_URDF AND NOT USE_INTERNAL_URDF) ign_build_error("Couldn't find the urdfdom >= 1.0 system installation") else() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 824211b32..83376abe7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -200,7 +200,7 @@ if (BUILD_SDF_TEST) if (${CMAKE_VERSION} VERSION_GREATER 3.13) target_link_options(UNIT_parser_urdf_TEST PRIVATE ${URDF_LDFLAGS}) endif() - target_link_libraries(UNIT_parser_urdf_TEST URDF::URDF) + target_link_libraries(UNIT_parser_urdf_TEST IgnURDFDOM::IgnURDFDOM) endif() target_link_libraries(UNIT_parser_urdf_TEST ${TINYXML2_LIBRARIES}) endif() @@ -211,7 +211,7 @@ if (BUILD_SDF_TEST) if (${CMAKE_VERSION} VERSION_GREATER 3.13) target_link_options(UNIT_ParamPassing_TEST PRIVATE ${URDF_LDFLAGS}) endif() - target_link_libraries(UNIT_ParamPassing_TEST URDF::URDF) + target_link_libraries(UNIT_ParamPassing_TEST IgnURDFDOM::IgnURDFDOM) endif() target_link_libraries(UNIT_ParamPassing_TEST ${TINYXML2_LIBRARIES}) endif() @@ -235,7 +235,7 @@ if (USE_INTERNAL_URDF) else() target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE - URDF::URDF + IgnURDFDOM::IgnURDFDOM ) endif() From 4d7e1a22e098ef13e35cea4c08fcbc3136a9b9c7 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Thu, 11 Nov 2021 11:26:22 +0800 Subject: [PATCH 10/29] reverse condition check Signed-off-by: Teo Koon Peng --- cmake/SearchForStuff.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index f4be09590..4e1dbd062 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -15,11 +15,11 @@ ign_find_package(TINYXML2 REQUIRED) if (NOT DEFINED USE_INTERNAL_URDF OR NOT USE_INTERNAL_URDF) ign_find_package(IgnURDFDOM VERSION 1.0 QUIET) if (NOT IgnURDFDOM_FOUND) - if (DEFINED USE_INTERNAL_URDF AND NOT USE_INTERNAL_URDF) - ign_build_error("Couldn't find the urdfdom >= 1.0 system installation") - else() + if (NOT DEFINED USE_INTERNAL_URDF) # fallback to internal urdf set(USE_INTERNAL_URDF ON) + else() + ign_build_error("Couldn't find the urdfdom >= 1.0 system installation") endif() endif() endif() From ddce467d683fa724a4d78970d27563131abb0678 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Thu, 11 Nov 2021 11:36:48 +0800 Subject: [PATCH 11/29] moar cleanups Signed-off-by: Teo Koon Peng --- cmake/SDFUtils.cmake | 58 -------------------------------------- cmake/SearchForStuff.cmake | 10 ------- 2 files changed, 68 deletions(-) diff --git a/cmake/SDFUtils.cmake b/cmake/SDFUtils.cmake index 94e12ebc4..dc979f278 100644 --- a/cmake/SDFUtils.cmake +++ b/cmake/SDFUtils.cmake @@ -1,47 +1,3 @@ -################################################################################ -#APPEND_TO_CACHED_STRING(_string _cacheDesc [items...]) -# Appends items to a cached list. -MACRO (APPEND_TO_CACHED_STRING _string _cacheDesc) - FOREACH (newItem ${ARGN}) - SET (${_string} "${${_string}} ${newItem}" CACHE INTERNAL ${_cacheDesc} FORCE) - ENDFOREACH (newItem ${ARGN}) - #STRING(STRIP ${${_string}} ${_string}) -ENDMACRO (APPEND_TO_CACHED_STRING) - -################################################################################ -# APPEND_TO_CACHED_LIST (_list _cacheDesc [items...] -# Appends items to a cached list. -MACRO (APPEND_TO_CACHED_LIST _list _cacheDesc) - SET (tempList ${${_list}}) - FOREACH (newItem ${ARGN}) - LIST (APPEND tempList ${newItem}) - ENDFOREACH (newItem ${newItem}) - SET (${_list} ${tempList} CACHE INTERNAL ${_cacheDesc} FORCE) -ENDMACRO(APPEND_TO_CACHED_LIST) - -################################################# -# Macro to turn a list into a string (why doesn't CMake have this built-in?) -MACRO (LIST_TO_STRING _string _list) - SET (${_string}) - FOREACH (_item ${_list}) - SET (${_string} "${${_string}} ${_item}") - ENDFOREACH (_item) - #STRING(STRIP ${${_string}} ${_string}) -ENDMACRO (LIST_TO_STRING) - -################################################# -macro (sdf_add_library _name) - set(LIBS_DESTINATION ${PROJECT_BINARY_DIR}/src) - add_library(${_name} ${ARGN}) - set_target_properties(${_name} PROPERTIES DEFINE_SYMBOL "BUILDING_SDFORMAT_SHARED") - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBS_DESTINATION}) - if (MSVC) - set_target_properties( ${_name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${LIBS_DESTINATION}) - set_target_properties( ${_name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${LIBS_DESTINATION}) - set_target_properties( ${_name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${LIBS_DESTINATION}) - endif () -endmacro () - ################################################# macro (sdf_setup_windows) # Need for M_PI constant @@ -51,20 +7,6 @@ macro (sdf_setup_windows) set(CMAKE_C_FLAGS_RELEASE "/MD ${CMAKE_C_FLAGS_RELEASE}") endmacro() -################################################# -# Macro to setup supported compiler warnings -# Based on work of Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST. -include(CheckCXXCompilerFlag) - -macro(filter_valid_compiler_warnings) - foreach(flag ${ARGN}) - CHECK_CXX_COMPILER_FLAG(${flag} R${flag}) - if(${R${flag}}) - set(WARNING_CXX_FLAGS "${WARNING_CXX_FLAGS} ${flag}") - endif() - endforeach() -endmacro() - ################################################# # Copied from catkin/cmake/empy.cmake function(find_python_module module) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 4e1dbd062..8edbf4a46 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -1,5 +1,3 @@ -include (FindPkgConfig) - message(STATUS "Building for arch: ${ARCH}") ################################################# @@ -63,14 +61,6 @@ else() message(STATUS "Found ruby executable: ${RUBY}") endif() -################################################# -# Macro to check for visibility capability in compiler -# Original idea from: https://gitorious.org/ferric-cmake-stuff/ -macro (check_gcc_visibility) - include (CheckCXXCompilerFlag) - check_cxx_compiler_flag(-fvisibility=hidden GCC_SUPPORTS_VISIBILITY) -endmacro() - ######################################## # Find ignition math # Set a variable for generating ProjectConfig.cmake From 903f9e888d7be892f81d14c6450a7ae5bd77ebb7 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Thu, 11 Nov 2021 12:28:21 +0800 Subject: [PATCH 12/29] fix data install location Signed-off-by: Teo Koon Peng --- sdf/1.0/CMakeLists.txt | 2 +- sdf/1.2/CMakeLists.txt | 2 +- sdf/1.3/CMakeLists.txt | 2 +- sdf/1.4/CMakeLists.txt | 2 +- sdf/1.5/CMakeLists.txt | 4 ++-- sdf/1.6/CMakeLists.txt | 4 ++-- sdf/1.7/CMakeLists.txt | 4 ++-- sdf/1.8/CMakeLists.txt | 4 ++-- sdf/1.9/CMakeLists.txt | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sdf/1.0/CMakeLists.txt b/sdf/1.0/CMakeLists.txt index 1695588b1..dd62ae21c 100644 --- a/sdf/1.0/CMakeLists.txt +++ b/sdf/1.0/CMakeLists.txt @@ -27,4 +27,4 @@ set (sdfs world.sdf ) -install(FILES ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.0/) +install(FILES ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.0/) diff --git a/sdf/1.2/CMakeLists.txt b/sdf/1.2/CMakeLists.txt index a37e84191..051e49e55 100644 --- a/sdf/1.2/CMakeLists.txt +++ b/sdf/1.2/CMakeLists.txt @@ -28,4 +28,4 @@ set (sdfs world.sdf ) -install(FILES ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.2) +install(FILES ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.2) diff --git a/sdf/1.3/CMakeLists.txt b/sdf/1.3/CMakeLists.txt index b737f0e50..9325a7e19 100644 --- a/sdf/1.3/CMakeLists.txt +++ b/sdf/1.3/CMakeLists.txt @@ -29,4 +29,4 @@ set (sdfs world.sdf ) -install(FILES ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.3) +install(FILES ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.3) diff --git a/sdf/1.4/CMakeLists.txt b/sdf/1.4/CMakeLists.txt index a59f4ea68..657bd085e 100644 --- a/sdf/1.4/CMakeLists.txt +++ b/sdf/1.4/CMakeLists.txt @@ -44,4 +44,4 @@ set (sdfs world.sdf ) -install(FILES ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.4) +install(FILES ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.4) diff --git a/sdf/1.5/CMakeLists.txt b/sdf/1.5/CMakeLists.txt index 60fd6a15a..89e721573 100644 --- a/sdf/1.5/CMakeLists.txt +++ b/sdf/1.5/CMakeLists.txt @@ -76,5 +76,5 @@ add_custom_target(schema1_5 ALL DEPENDS ${SDF_SCHEMA}) set_source_files_properties(${SDF_SCHEMA} PROPERTIES GENERATED TRUE) -install(FILES 1_4.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.5) -install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.5) +install(FILES 1_4.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.5) +install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.5) diff --git a/sdf/1.6/CMakeLists.txt b/sdf/1.6/CMakeLists.txt index fe972e4c5..f386b30bf 100644 --- a/sdf/1.6/CMakeLists.txt +++ b/sdf/1.6/CMakeLists.txt @@ -80,5 +80,5 @@ add_custom_target(schema1_6 ALL DEPENDS ${SDF_SCHEMA}) set_source_files_properties(${SDF_SCHEMA} PROPERTIES GENERATED TRUE) -install(FILES 1_5.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.6) -install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.6) +install(FILES 1_5.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.6) +install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.6) diff --git a/sdf/1.7/CMakeLists.txt b/sdf/1.7/CMakeLists.txt index 516a7874b..4167a3b97 100644 --- a/sdf/1.7/CMakeLists.txt +++ b/sdf/1.7/CMakeLists.txt @@ -80,5 +80,5 @@ add_custom_target(schema1_7 ALL DEPENDS ${SDF_SCHEMA}) set_source_files_properties(${SDF_SCHEMA} PROPERTIES GENERATED TRUE) -install(FILES 1_6.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.7) -install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.7) +install(FILES 1_6.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.7) +install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.7) diff --git a/sdf/1.8/CMakeLists.txt b/sdf/1.8/CMakeLists.txt index d074806f5..30555b39a 100644 --- a/sdf/1.8/CMakeLists.txt +++ b/sdf/1.8/CMakeLists.txt @@ -82,5 +82,5 @@ add_custom_target(schema1_8 ALL DEPENDS ${SDF_SCHEMA}) set_source_files_properties(${SDF_SCHEMA} PROPERTIES GENERATED TRUE) -install(FILES 1_7.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.8) -install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.8) +install(FILES 1_7.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.8) +install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.8) diff --git a/sdf/1.9/CMakeLists.txt b/sdf/1.9/CMakeLists.txt index 209d63043..7778acafd 100644 --- a/sdf/1.9/CMakeLists.txt +++ b/sdf/1.9/CMakeLists.txt @@ -82,5 +82,5 @@ add_custom_target(schema1_9 ALL DEPENDS ${SDF_SCHEMA}) set_source_files_properties(${SDF_SCHEMA} PROPERTIES GENERATED TRUE) -install(FILES 1_8.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.9) -install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/1.9) +install(FILES 1_8.convert ${sdfs} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.9) +install(FILES ${SDF_SCHEMA} DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}/1.9) From e25a16341d673600babf10d366dbfa651300b2de Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Thu, 11 Nov 2021 14:37:42 +0800 Subject: [PATCH 13/29] add redirection headers for sdf_config.h and sdf.hh Signed-off-by: Teo Koon Peng --- CMakeLists.txt | 4 +--- include/sdf/CMakeLists.txt | 5 ++++- include/sdf/sdf.hh | 25 +++++++++++++++++++++++ include/sdf/sdf.hh.in | 3 --- include/sdf/sdf_config.h | 25 +++++++++++++++++++++++ src/CMakeLists.txt | 6 +++++- test/CMakeLists.txt | 3 --- test/integration/CMakeLists.txt | 3 ++- test/integration/deprecated_headers.cc | 28 ++++++++++++++++++++++++++ 9 files changed, 90 insertions(+), 12 deletions(-) create mode 100644 include/sdf/sdf.hh delete mode 100644 include/sdf/sdf.hh.in create mode 100644 include/sdf/sdf_config.h create mode 100644 test/integration/deprecated_headers.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index 744479075..8b06749e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,9 +34,6 @@ if (WIN32) sdf_setup_windows() endif () -configure_file (include/sdf/config.hh.in - include/sdf/config.hh) - if (BUILD_SDF) ign_configure_project(INCLUDE_DIR sdf NO_IGNITION_PREFIX) @@ -47,6 +44,7 @@ if (BUILD_SDF) ign_configure_build(QUIT_IF_BUILD_ERRORS) ign_create_packages() + # ign_create_docs() # TODO: add header that redirects "sdf/sdf_config.h" to "${ignitin_prefix}/sdformat/config.hh" diff --git a/include/sdf/CMakeLists.txt b/include/sdf/CMakeLists.txt index 439642e6b..f67bdf1a9 100644 --- a/include/sdf/CMakeLists.txt +++ b/include/sdf/CMakeLists.txt @@ -1 +1,4 @@ -ign_install_all_headers() +configure_file(config.hh.in + include/sdf/config.hh) + +ign_install_all_headers(EXCLUDE_FILES sdf.hh sdf_config.h) diff --git a/include/sdf/sdf.hh b/include/sdf/sdf.hh new file mode 100644 index 000000000..109d85c60 --- /dev/null +++ b/include/sdf/sdf.hh @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2021 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef SDF_SDF_HH_ +#define SDF_SDF_HH_ + +#pragma message("sdf/sdf.hh is deprecated, use sdformat.hh instead") + +#include + +#endif diff --git a/include/sdf/sdf.hh.in b/include/sdf/sdf.hh.in deleted file mode 100644 index 744e631cc..000000000 --- a/include/sdf/sdf.hh.in +++ /dev/null @@ -1,3 +0,0 @@ -// Automatically generated -${sdf_headers} -#include diff --git a/include/sdf/sdf_config.h b/include/sdf/sdf_config.h new file mode 100644 index 000000000..20330d1e2 --- /dev/null +++ b/include/sdf/sdf_config.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2021 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef SDF_SDF_CONFIG_H_ +#define SDF_SDF_CONFIG_H_ + +#pragma message("sdf/sdf_config.h is deprecated, use sdf/config.hh instead") + +#include + +#endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 83376abe7..365eb1e90 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -68,7 +68,6 @@ set (sources World.cc XmlUtils.cc ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) if (USE_INTERNAL_URDF) set(sources ${sources} @@ -219,6 +218,11 @@ endif() ign_create_core_library(SOURCES ${sources} CXX_STANDARD 17) +target_include_directories(${PROJECT_LIBRARY_TARGET_NAME} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} +) + target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC ignition-math${IGN_MATH_VER}::ignition-math${IGN_MATH_VER} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index dc88f2ac4..58ddad3d7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -9,12 +9,9 @@ target_include_directories(gtest ) add_library(gtest_main STATIC gtest/src/gtest_main.cc) target_link_libraries(gtest_main gtest) -set(GTEST_LIBRARY "${PROJECT_BINARY_DIR}/test/libgtest.a") -set(GTEST_MAIN_LIBRARY "${PROJECT_BINARY_DIR}/test/libgtest_main.a") execute_process(COMMAND cmake -E remove_directory ${CMAKE_BINARY_DIR}/test_results) execute_process(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test_results) -include_directories(${GTEST_INCLUDE_DIRS}) add_subdirectory(integration) add_subdirectory(performance) diff --git a/test/integration/CMakeLists.txt b/test/integration/CMakeLists.txt index 10b0519c0..ea0bdc043 100644 --- a/test/integration/CMakeLists.txt +++ b/test/integration/CMakeLists.txt @@ -8,6 +8,7 @@ set(tests collision_dom.cc converter.cc default_elements.cc + deprecated_headers.cc deprecated_specs.cc disable_fixed_joint_reduction.cc element_tracing.cc @@ -76,5 +77,5 @@ endif() if (UNIX AND NOT APPLE) configure_file(all_symbols_have_version.bash.in ${CMAKE_CURRENT_BINARY_DIR}/all_symbols_have_version.bash @ONLY) add_test(NAME INTEGRATION_versioned_symbols - COMMAND bash ${CMAKE_CURRENT_BINARY_DIR}/all_symbols_have_version.bash ${CMAKE_BINARY_DIR}/src/libsdformat${SDF_MAJOR_VERSION}.so) + COMMAND bash ${CMAKE_CURRENT_BINARY_DIR}/all_symbols_have_version.bash ${CMAKE_BINARY_DIR}/src/libsdformat${PROJECT_VERSION_MAJOR}.so) endif() diff --git a/test/integration/deprecated_headers.cc b/test/integration/deprecated_headers.cc new file mode 100644 index 000000000..17898a12e --- /dev/null +++ b/test/integration/deprecated_headers.cc @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2021 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * This simply tests if it builds with the deprecated headers. The downside of this + * is that it taints the build output with false positive warnings. + */ +#include +#include + +int main() +{ + return 0; +} From 2119536ef2b9b1b6d455a9b0d5546705763af1c4 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Thu, 11 Nov 2021 15:13:40 +0800 Subject: [PATCH 14/29] use ign-cmake's visibility macros instead Signed-off-by: Teo Koon Peng --- CMakeLists.txt | 8 --- include/sdf/Actor.hh | 10 ++-- include/sdf/AirPressure.hh | 2 +- include/sdf/Altimeter.hh | 2 +- include/sdf/Atmosphere.hh | 4 +- include/sdf/Box.hh | 2 +- include/sdf/Camera.hh | 2 +- include/sdf/Capsule.hh | 2 +- include/sdf/Collision.hh | 4 +- include/sdf/Console.hh | 6 +- include/sdf/Cylinder.hh | 2 +- include/sdf/Element.hh | 6 +- include/sdf/Ellipsoid.hh | 2 +- include/sdf/Error.hh | 6 +- include/sdf/Exception.hh | 8 +-- include/sdf/Filesystem.hh | 16 +++--- include/sdf/ForceTorque.hh | 2 +- include/sdf/Frame.hh | 4 +- include/sdf/Geometry.hh | 2 +- include/sdf/Gui.hh | 4 +- include/sdf/Heightmap.hh | 6 +- include/sdf/Imu.hh | 2 +- include/sdf/InterfaceElements.hh | 4 +- include/sdf/InterfaceFrame.hh | 4 +- include/sdf/InterfaceJoint.hh | 4 +- include/sdf/InterfaceLink.hh | 4 +- include/sdf/InterfaceModel.hh | 4 +- include/sdf/InterfaceModelPoseGraph.hh | 4 +- include/sdf/Joint.hh | 4 +- include/sdf/JointAxis.hh | 4 +- include/sdf/Lidar.hh | 2 +- include/sdf/Light.hh | 4 +- include/sdf/Link.hh | 4 +- include/sdf/Magnetometer.hh | 2 +- include/sdf/Material.hh | 4 +- include/sdf/Mesh.hh | 2 +- include/sdf/Model.hh | 4 +- include/sdf/NavSat.hh | 2 +- include/sdf/Noise.hh | 2 +- include/sdf/Param.hh | 10 ++-- include/sdf/ParserConfig.hh | 4 +- include/sdf/ParticleEmitter.hh | 4 +- include/sdf/Pbr.hh | 6 +- include/sdf/Physics.hh | 4 +- include/sdf/Plane.hh | 2 +- include/sdf/PrintConfig.hh | 4 +- include/sdf/Root.hh | 4 +- include/sdf/SDFImpl.hh | 14 ++--- include/sdf/Scene.hh | 4 +- include/sdf/SemanticPose.hh | 4 +- include/sdf/Sensor.hh | 4 +- include/sdf/Sky.hh | 4 +- include/sdf/Sphere.hh | 2 +- include/sdf/Surface.hh | 6 +- include/sdf/Types.hh | 20 +++---- include/sdf/Visual.hh | 4 +- include/sdf/World.hh | 4 +- include/sdf/parser.hh | 76 +++++++++++++------------- include/sdf/system_util.hh | 47 ---------------- src/Converter.hh | 2 +- src/ParamPassing.hh | 2 +- src/Surface.cc | 2 +- src/ign.cc | 12 ++-- src/ign.hh | 6 +- src/parser_private.hh | 2 +- src/parser_urdf.hh | 2 +- 66 files changed, 180 insertions(+), 235 deletions(-) delete mode 100644 include/sdf/system_util.hh diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b06749e2..8cab19ade 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,14 +47,6 @@ if (BUILD_SDF) # ign_create_docs() - # TODO: add header that redirects "sdf/sdf_config.h" to "${ignitin_prefix}/sdformat/config.hh" - # install( - # FILES - # ${PROJECT_BINARY_DIR}/sdf/sdf_config.h - # DESTINATION - # ${IGN_INCLUDE_INSTALL_DIR_FULL}/sdf - # ) - add_subdirectory(sdf) add_subdirectory(conf) add_subdirectory(doc) diff --git a/include/sdf/Actor.hh b/include/sdf/Actor.hh index 6d054a93d..e54ab8783 100644 --- a/include/sdf/Actor.hh +++ b/include/sdf/Actor.hh @@ -28,7 +28,7 @@ #include "sdf/Link.hh" #include "sdf/Joint.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -36,7 +36,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { // /// \brief Animation in Actor. - class SDFORMAT_VISIBLE Animation + class IGNITION_SDFORMAT_VISIBLE Animation { /// \brief Default constructor public: Animation(); @@ -94,7 +94,7 @@ namespace sdf }; /// \brief Waypoint for Trajectory. - class SDFORMAT_VISIBLE Waypoint + class IGNITION_SDFORMAT_VISIBLE Waypoint { /// \brief Default constructor public: Waypoint(); @@ -128,7 +128,7 @@ namespace sdf }; /// \brief Trajectory for Animation. - class SDFORMAT_VISIBLE Trajectory + class IGNITION_SDFORMAT_VISIBLE Trajectory { /// \brief Default constructor public: Trajectory(); @@ -187,7 +187,7 @@ namespace sdf /// \brief Provides a description of an actor. - class SDFORMAT_VISIBLE Actor + class IGNITION_SDFORMAT_VISIBLE Actor { /// \brief Default constructor public: Actor(); diff --git a/include/sdf/AirPressure.hh b/include/sdf/AirPressure.hh index 63b9dfed8..30bd503ee 100644 --- a/include/sdf/AirPressure.hh +++ b/include/sdf/AirPressure.hh @@ -31,7 +31,7 @@ namespace sdf /// \brief AirPressure contains information about a general /// purpose fluid pressure sensor. /// This sensor can be attached to a link. - class SDFORMAT_VISIBLE AirPressure + class IGNITION_SDFORMAT_VISIBLE AirPressure { /// \brief Default constructor public: AirPressure(); diff --git a/include/sdf/Altimeter.hh b/include/sdf/Altimeter.hh index 68e232304..e0350264c 100644 --- a/include/sdf/Altimeter.hh +++ b/include/sdf/Altimeter.hh @@ -30,7 +30,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Altimeter contains information about an altimeter sensor. /// This sensor can be attached to a link. - class SDFORMAT_VISIBLE Altimeter + class IGNITION_SDFORMAT_VISIBLE Altimeter { /// \brief Default constructor public: Altimeter(); diff --git a/include/sdf/Atmosphere.hh b/include/sdf/Atmosphere.hh index 76b06e49d..dc3c75c00 100644 --- a/include/sdf/Atmosphere.hh +++ b/include/sdf/Atmosphere.hh @@ -23,7 +23,7 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf @@ -42,7 +42,7 @@ namespace sdf /// an atmospheric model and related parameters such as temperature /// and pressure at sea level. An Atmosphere instance is optionally part of /// a World. - class SDFORMAT_VISIBLE Atmosphere + class IGNITION_SDFORMAT_VISIBLE Atmosphere { /// \brief Default constructor public: Atmosphere(); diff --git a/include/sdf/Box.hh b/include/sdf/Box.hh index 05891da14..1d4bc3cfa 100644 --- a/include/sdf/Box.hh +++ b/include/sdf/Box.hh @@ -30,7 +30,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Box represents a box shape, and is usually accessed through a /// Geometry. - class SDFORMAT_VISIBLE Box + class IGNITION_SDFORMAT_VISIBLE Box { /// \brief Constructor public: Box(); diff --git a/include/sdf/Camera.hh b/include/sdf/Camera.hh index 306abe25b..238a8ab35 100644 --- a/include/sdf/Camera.hh +++ b/include/sdf/Camera.hh @@ -57,7 +57,7 @@ namespace sdf }; /// \brief Information about a monocular camera sensor. - class SDFORMAT_VISIBLE Camera + class IGNITION_SDFORMAT_VISIBLE Camera { /// \brief Constructor public: Camera(); diff --git a/include/sdf/Capsule.hh b/include/sdf/Capsule.hh index 3ee7c311e..a48e8fb02 100644 --- a/include/sdf/Capsule.hh +++ b/include/sdf/Capsule.hh @@ -29,7 +29,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Capsule represents a capsule shape, and is usually accessed /// through a Geometry. - class SDFORMAT_VISIBLE Capsule + class IGNITION_SDFORMAT_VISIBLE Capsule { /// \brief Constructor public: Capsule(); diff --git a/include/sdf/Collision.hh b/include/sdf/Collision.hh index 125e54b27..080804211 100644 --- a/include/sdf/Collision.hh +++ b/include/sdf/Collision.hh @@ -25,7 +25,7 @@ #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -42,7 +42,7 @@ namespace sdf /// with a link. This can be different from the visual properties of a link. /// For example, simple collision models are often used to reduce /// computation time. - class SDFORMAT_VISIBLE Collision + class IGNITION_SDFORMAT_VISIBLE Collision { /// \brief Default constructor public: Collision(); diff --git a/include/sdf/Console.hh b/include/sdf/Console.hh index 539bb77cc..7b908ea42 100644 --- a/include/sdf/Console.hh +++ b/include/sdf/Console.hh @@ -24,7 +24,7 @@ #include #include -#include "sdf/system_util.hh" +#include "sdf/Export.hh" #ifdef _WIN32 // Disable warning C4251 which is triggered by @@ -65,10 +65,10 @@ namespace sdf typedef std::shared_ptr ConsolePtr; /// \brief Message, error, warning, and logging functionality - class SDFORMAT_VISIBLE Console + class IGNITION_SDFORMAT_VISIBLE Console { /// \brief An ostream-like class that we'll use for logging. - public: class SDFORMAT_VISIBLE ConsoleStream + public: class IGNITION_SDFORMAT_VISIBLE ConsoleStream { /// \brief Constructor. /// \param[in] _stream Pointer to an output stream operator. Can be diff --git a/include/sdf/Cylinder.hh b/include/sdf/Cylinder.hh index 631caefd4..e256bdd91 100644 --- a/include/sdf/Cylinder.hh +++ b/include/sdf/Cylinder.hh @@ -29,7 +29,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Cylinder represents a cylinder shape, and is usually accessed /// through a Geometry. - class SDFORMAT_VISIBLE Cylinder + class IGNITION_SDFORMAT_VISIBLE Cylinder { /// \brief Constructor public: Cylinder(); diff --git a/include/sdf/Element.hh b/include/sdf/Element.hh index 9b606d215..56118a2ac 100644 --- a/include/sdf/Element.hh +++ b/include/sdf/Element.hh @@ -28,7 +28,7 @@ #include "sdf/Param.hh" #include "sdf/PrintConfig.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" #include "sdf/Types.hh" #ifdef _WIN32 @@ -47,7 +47,7 @@ namespace sdf // class ElementPrivate; - class SDFORMAT_VISIBLE Element; + class IGNITION_SDFORMAT_VISIBLE Element; /// \def ElementPtr /// \brief Shared pointer to an SDF Element @@ -70,7 +70,7 @@ namespace sdf /// \class Element Element.hh sdf/sdf.hh /// \brief SDF Element class - class SDFORMAT_VISIBLE Element : + class IGNITION_SDFORMAT_VISIBLE Element : public std::enable_shared_from_this { /// \brief Constructor. diff --git a/include/sdf/Ellipsoid.hh b/include/sdf/Ellipsoid.hh index ef4895c66..4b7d49a10 100644 --- a/include/sdf/Ellipsoid.hh +++ b/include/sdf/Ellipsoid.hh @@ -29,7 +29,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Ellipsoid represents a ellipsoid shape, and is usually accessed /// through a Geometry. - class SDFORMAT_VISIBLE Ellipsoid + class IGNITION_SDFORMAT_VISIBLE Ellipsoid { /// \brief Constructor public: Ellipsoid(); diff --git a/include/sdf/Error.hh b/include/sdf/Error.hh index 3794f35ee..3b8a0f7ad 100644 --- a/include/sdf/Error.hh +++ b/include/sdf/Error.hh @@ -22,7 +22,7 @@ #include #include #include -#include "sdf/system_util.hh" +#include "sdf/Export.hh" #ifdef _WIN32 // Disable warning C4251 which is triggered by @@ -149,7 +149,7 @@ namespace sdf MERGE_INCLUDE_UNSUPPORTED, }; - class SDFORMAT_VISIBLE Error + class IGNITION_SDFORMAT_VISIBLE Error { /// \brief Default constructor public: Error(); @@ -234,7 +234,7 @@ namespace sdf /// \param[in,out] _out The output stream. /// \param[in] _err The error to output. /// \return Reference to the given output stream - public: friend SDFORMAT_VISIBLE std::ostream &operator<<( + public: friend IGNITION_SDFORMAT_VISIBLE std::ostream &operator<<( std::ostream &_out, const sdf::Error &_err); /// \brief Private data pointer. diff --git a/include/sdf/Exception.hh b/include/sdf/Exception.hh index 6947f7ead..a6e0edd73 100644 --- a/include/sdf/Exception.hh +++ b/include/sdf/Exception.hh @@ -26,7 +26,7 @@ #include #include -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -45,7 +45,7 @@ namespace sdf /// \class Exception Exception.hh common/common.hh /// \brief Class for generating exceptions - class SDFORMAT_VISIBLE Exception + class IGNITION_SDFORMAT_VISIBLE Exception { /// \brief Constructor public: Exception(); @@ -108,7 +108,7 @@ namespace sdf /// \brief Class for generating Internal Gazebo Errors: /// those errors which should never happend and /// represent programming bugs. - class SDFORMAT_VISIBLE InternalError : public Exception + class IGNITION_SDFORMAT_VISIBLE InternalError : public Exception { /// \brief Constructor public: InternalError(); @@ -130,7 +130,7 @@ namespace sdf /// sdf assertions. They include information about the /// assertion expression violated, function where problem /// appeared and assertion debug message. - class SDFORMAT_VISIBLE AssertionInternalError : public InternalError + class IGNITION_SDFORMAT_VISIBLE AssertionInternalError : public InternalError { /// \brief Constructor for assertions /// \param[in] _file File name diff --git a/include/sdf/Filesystem.hh b/include/sdf/Filesystem.hh index 8bfed2c54..cd67e6b11 100644 --- a/include/sdf/Filesystem.hh +++ b/include/sdf/Filesystem.hh @@ -23,7 +23,7 @@ #include #include -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -36,20 +36,20 @@ namespace sdf /// \brief Determine whether the given path exists on the filesystem. /// \param[in] _path The path to check for existence /// \return True if the path exists on the filesystem, false otherwise. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool exists(const std::string &_path); /// \brief Determine whether the given path is a directory. /// \param[in] _path The path to check /// \return True if given path exists and is a directory, false otherwise. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool is_directory(const std::string &_path); /// \brief Create a new directory on the filesystem. Intermediate /// directories must already exist. /// \param[in] _path The new directory path to create /// \return True if directory creation was successful, false otherwise. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool create_directory(const std::string &_path); // The below is C++ variadic template magic to allow an append @@ -59,7 +59,7 @@ namespace sdf /// onto the passed-in string. /// \param[in] _s The path to start with. /// \return The original path with the platform path separator appended. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE std::string const separator(std::string const &_s); /// \brief Append one or more additional path elements to the first @@ -78,18 +78,18 @@ namespace sdf /// \brief Get the current working path. /// \return Current working path if successful, the empty path on error. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE std::string current_path(); /// \brief Given a path, get just the basename portion. /// \param[in] _path The full path. /// \return A new string with just the basename portion of the path. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE std::string basename(const std::string &_path); /// \class DirIter Filesystem.hh /// \brief A class for iterating over all items in a directory. - class SDFORMAT_VISIBLE DirIter + class IGNITION_SDFORMAT_VISIBLE DirIter { /// \brief Constructor. /// \param[in] _in Directory to iterate over. diff --git a/include/sdf/ForceTorque.hh b/include/sdf/ForceTorque.hh index 7a96d3b31..704fa33ac 100644 --- a/include/sdf/ForceTorque.hh +++ b/include/sdf/ForceTorque.hh @@ -61,7 +61,7 @@ namespace sdf /// \brief ForceTorque contains information about a force torque sensor. /// This sensor can be attached to a joint. - class SDFORMAT_VISIBLE ForceTorque + class IGNITION_SDFORMAT_VISIBLE ForceTorque { /// \brief Default constructor public: ForceTorque(); diff --git a/include/sdf/Frame.hh b/include/sdf/Frame.hh index ab8b5bb1e..9734c0c98 100644 --- a/include/sdf/Frame.hh +++ b/include/sdf/Frame.hh @@ -25,7 +25,7 @@ #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -39,7 +39,7 @@ namespace sdf /// \brief A Frame element descibes the properties associated with an /// explicit frame defined in a Model or World. - class SDFORMAT_VISIBLE Frame + class IGNITION_SDFORMAT_VISIBLE Frame { /// \brief Default constructor public: Frame(); diff --git a/include/sdf/Geometry.hh b/include/sdf/Geometry.hh index 3e321d8af..d6b56eb36 100644 --- a/include/sdf/Geometry.hh +++ b/include/sdf/Geometry.hh @@ -74,7 +74,7 @@ namespace sdf /// Type function to determine the type of shape contained within a /// Geometry. Access to shape data, such as a box's size, is achieved /// through the shape accessors, such as const Box *BoxShape() const. - class SDFORMAT_VISIBLE Geometry + class IGNITION_SDFORMAT_VISIBLE Geometry { /// \brief Default constructor public: Geometry(); diff --git a/include/sdf/Gui.hh b/include/sdf/Gui.hh index 52be7e67e..0684b5203 100644 --- a/include/sdf/Gui.hh +++ b/include/sdf/Gui.hh @@ -21,13 +21,13 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { // Inline bracket to help doxygen filtering. inline namespace SDF_VERSION_NAMESPACE { - class SDFORMAT_VISIBLE Gui + class IGNITION_SDFORMAT_VISIBLE Gui { /// \brief Default constructor public: Gui(); diff --git a/include/sdf/Heightmap.hh b/include/sdf/Heightmap.hh index 8511de173..2600d0a9c 100644 --- a/include/sdf/Heightmap.hh +++ b/include/sdf/Heightmap.hh @@ -29,7 +29,7 @@ namespace sdf // Inline bracket to help doxygen filtering. inline namespace SDF_VERSION_NAMESPACE { /// \brief Texture to be used on heightmaps. - class SDFORMAT_VISIBLE HeightmapTexture + class IGNITION_SDFORMAT_VISIBLE HeightmapTexture { /// \brief Constructor public: HeightmapTexture(); @@ -76,7 +76,7 @@ namespace sdf }; /// \brief Blend information to be used between textures on heightmaps. - class SDFORMAT_VISIBLE HeightmapBlend + class IGNITION_SDFORMAT_VISIBLE HeightmapBlend { /// \brief Constructor public: HeightmapBlend(); @@ -116,7 +116,7 @@ namespace sdf /// \brief Heightmap represents a shape defined by a 2D field, and is usually /// accessed through a Geometry. - class SDFORMAT_VISIBLE Heightmap + class IGNITION_SDFORMAT_VISIBLE Heightmap { /// \brief Constructor public: Heightmap(); diff --git a/include/sdf/Imu.hh b/include/sdf/Imu.hh index d26b0b6d9..ab8556d29 100644 --- a/include/sdf/Imu.hh +++ b/include/sdf/Imu.hh @@ -30,7 +30,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Imu contains information about an imu sensor. /// This sensor can be attached to a link. - class SDFORMAT_VISIBLE Imu + class IGNITION_SDFORMAT_VISIBLE Imu { /// \brief Default constructor public: Imu(); diff --git a/include/sdf/InterfaceElements.hh b/include/sdf/InterfaceElements.hh index e79a87264..5134791db 100644 --- a/include/sdf/InterfaceElements.hh +++ b/include/sdf/InterfaceElements.hh @@ -28,7 +28,7 @@ #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -41,7 +41,7 @@ inline namespace SDF_VERSION_NAMESPACE #endif /// \brief Contains the necessary information about an included model file /// for custom model parsers to be able to find the file and parse it. -class SDFORMAT_VISIBLE NestedInclude +class IGNITION_SDFORMAT_VISIBLE NestedInclude { /// \brief Constructor public: NestedInclude(); diff --git a/include/sdf/InterfaceFrame.hh b/include/sdf/InterfaceFrame.hh index 94d640d57..07668ca38 100644 --- a/include/sdf/InterfaceFrame.hh +++ b/include/sdf/InterfaceFrame.hh @@ -24,14 +24,14 @@ #include #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { inline namespace SDF_VERSION_NAMESPACE { /// \brief Interface element representing an explicit frame -class SDFORMAT_VISIBLE InterfaceFrame +class IGNITION_SDFORMAT_VISIBLE InterfaceFrame { /// \brief Constructor /// \param[in] _name The *local* name. diff --git a/include/sdf/InterfaceJoint.hh b/include/sdf/InterfaceJoint.hh index 2f8b0e687..a23637c35 100644 --- a/include/sdf/InterfaceJoint.hh +++ b/include/sdf/InterfaceJoint.hh @@ -24,14 +24,14 @@ #include #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { inline namespace SDF_VERSION_NAMESPACE { /// \brief Interface element representing a Joint -class SDFORMAT_VISIBLE InterfaceJoint +class IGNITION_SDFORMAT_VISIBLE InterfaceJoint { /// \brief Constructor /// \param[in] name The *local* name. diff --git a/include/sdf/InterfaceLink.hh b/include/sdf/InterfaceLink.hh index 3462449da..aeb07b8e7 100644 --- a/include/sdf/InterfaceLink.hh +++ b/include/sdf/InterfaceLink.hh @@ -24,14 +24,14 @@ #include #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { inline namespace SDF_VERSION_NAMESPACE { /// \brief Interface element representing a Link -class SDFORMAT_VISIBLE InterfaceLink +class IGNITION_SDFORMAT_VISIBLE InterfaceLink { /// \brief Constructor /// \param[in] name The *local* name. diff --git a/include/sdf/InterfaceModel.hh b/include/sdf/InterfaceModel.hh index cd76e39d0..71c34933b 100644 --- a/include/sdf/InterfaceModel.hh +++ b/include/sdf/InterfaceModel.hh @@ -33,7 +33,7 @@ #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -54,7 +54,7 @@ using RepostureFunction = std::function; /// \brief Interface element representing a Model -class SDFORMAT_VISIBLE InterfaceModel +class IGNITION_SDFORMAT_VISIBLE InterfaceModel { /// \brief Constructor /// \param[in] name The *local* name (no nesting, e.g. "::"). If this name diff --git a/include/sdf/InterfaceModelPoseGraph.hh b/include/sdf/InterfaceModelPoseGraph.hh index ca45bcaf6..3ac7bc060 100644 --- a/include/sdf/InterfaceModelPoseGraph.hh +++ b/include/sdf/InterfaceModelPoseGraph.hh @@ -28,7 +28,7 @@ #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -41,7 +41,7 @@ template class ScopedGraph; /// \brief Class used in reposture callbacks of custom parsers to resolve poses. -class SDFORMAT_VISIBLE InterfaceModelPoseGraph +class IGNITION_SDFORMAT_VISIBLE InterfaceModelPoseGraph { /// \brief Resolve pose relative to world /// \param[out] _pose Resolved pose diff --git a/include/sdf/Joint.hh b/include/sdf/Joint.hh index 5c4d7db0e..7fb76304f 100644 --- a/include/sdf/Joint.hh +++ b/include/sdf/Joint.hh @@ -25,7 +25,7 @@ #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -82,7 +82,7 @@ namespace sdf UNIVERSAL = 9 }; - class SDFORMAT_VISIBLE Joint + class IGNITION_SDFORMAT_VISIBLE Joint { /// \brief Default constructor public: Joint(); diff --git a/include/sdf/JointAxis.hh b/include/sdf/JointAxis.hh index fea979697..054f9471e 100644 --- a/include/sdf/JointAxis.hh +++ b/include/sdf/JointAxis.hh @@ -25,7 +25,7 @@ #include "sdf/Exception.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -39,7 +39,7 @@ namespace sdf /// \brief Parameters related to the axis of rotation for rotational joints, /// and the axis of translation for prismatic joints. - class SDFORMAT_VISIBLE JointAxis + class IGNITION_SDFORMAT_VISIBLE JointAxis { /// \brief Default constructor public: JointAxis(); diff --git a/include/sdf/Lidar.hh b/include/sdf/Lidar.hh index 4293dd448..ae8835db3 100644 --- a/include/sdf/Lidar.hh +++ b/include/sdf/Lidar.hh @@ -102,7 +102,7 @@ namespace sdf /// /// /// ~~~ - class SDFORMAT_VISIBLE Lidar + class IGNITION_SDFORMAT_VISIBLE Lidar { /// \brief Default constructor public: Lidar(); diff --git a/include/sdf/Light.hh b/include/sdf/Light.hh index 2f5a56e7b..921fb6184 100644 --- a/include/sdf/Light.hh +++ b/include/sdf/Light.hh @@ -27,7 +27,7 @@ #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -60,7 +60,7 @@ namespace sdf /// \brief Provides a description of a light source. A light source can be /// point, spot, or directional light. - class SDFORMAT_VISIBLE Light + class IGNITION_SDFORMAT_VISIBLE Light { /// \brief Default constructor public: Light(); diff --git a/include/sdf/Link.hh b/include/sdf/Link.hh index 86d5988c5..6ad724900 100644 --- a/include/sdf/Link.hh +++ b/include/sdf/Link.hh @@ -25,7 +25,7 @@ #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -42,7 +42,7 @@ namespace sdf struct PoseRelativeToGraph; template class ScopedGraph; - class SDFORMAT_VISIBLE Link + class IGNITION_SDFORMAT_VISIBLE Link { /// \brief Default constructor public: Link(); diff --git a/include/sdf/Magnetometer.hh b/include/sdf/Magnetometer.hh index b431e7566..c7073114d 100644 --- a/include/sdf/Magnetometer.hh +++ b/include/sdf/Magnetometer.hh @@ -31,7 +31,7 @@ namespace sdf /// \brief Magnetometer contains information about a magnetometer sensor. /// This sensor can be attached to a link. - class SDFORMAT_VISIBLE Magnetometer + class IGNITION_SDFORMAT_VISIBLE Magnetometer { /// \brief Default constructor public: Magnetometer(); diff --git a/include/sdf/Material.hh b/include/sdf/Material.hh index 7d4a5160b..78514fc50 100644 --- a/include/sdf/Material.hh +++ b/include/sdf/Material.hh @@ -22,7 +22,7 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -42,7 +42,7 @@ namespace sdf }; /// \brief This class contains visual material properties. - class SDFORMAT_VISIBLE Material + class IGNITION_SDFORMAT_VISIBLE Material { /// \brief Default constructor public: Material(); diff --git a/include/sdf/Mesh.hh b/include/sdf/Mesh.hh index c4fd8e67c..88519550b 100644 --- a/include/sdf/Mesh.hh +++ b/include/sdf/Mesh.hh @@ -32,7 +32,7 @@ namespace sdf /// \brief Mesh represents a mesh shape, and is usually accessed through a /// Geometry. - class SDFORMAT_VISIBLE Mesh + class IGNITION_SDFORMAT_VISIBLE Mesh { /// \brief Constructor public: Mesh(); diff --git a/include/sdf/Model.hh b/include/sdf/Model.hh index abaca0473..e99ab6f86 100644 --- a/include/sdf/Model.hh +++ b/include/sdf/Model.hh @@ -26,7 +26,7 @@ #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -45,7 +45,7 @@ namespace sdf struct FrameAttachedToGraph; template class ScopedGraph; - class SDFORMAT_VISIBLE Model + class IGNITION_SDFORMAT_VISIBLE Model { /// \brief Default constructor public: Model(); diff --git a/include/sdf/NavSat.hh b/include/sdf/NavSat.hh index 2fa1acbd0..19dd68f86 100644 --- a/include/sdf/NavSat.hh +++ b/include/sdf/NavSat.hh @@ -72,7 +72,7 @@ namespace sdf /// /// /// ~~~ - class SDFORMAT_VISIBLE NavSat + class IGNITION_SDFORMAT_VISIBLE NavSat { /// \brief Default constructor public: NavSat(); diff --git a/include/sdf/Noise.hh b/include/sdf/Noise.hh index f8139cd45..7e97c37bf 100644 --- a/include/sdf/Noise.hh +++ b/include/sdf/Noise.hh @@ -44,7 +44,7 @@ namespace sdf /// \brief The Noise class contains information about a noise /// model, such as a Gaussian distribution. A Noise DOM object is /// typically available from a Sensor. - class SDFORMAT_VISIBLE Noise + class IGNITION_SDFORMAT_VISIBLE Noise { /// \brief Default constructor public: Noise(); diff --git a/include/sdf/Param.hh b/include/sdf/Param.hh index 472075ab9..cca5c3acd 100644 --- a/include/sdf/Param.hh +++ b/include/sdf/Param.hh @@ -38,7 +38,7 @@ #include "sdf/Console.hh" #include "sdf/PrintConfig.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" #include "sdf/Types.hh" #ifdef _WIN32 @@ -54,11 +54,11 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { // - class SDFORMAT_VISIBLE Element; + class IGNITION_SDFORMAT_VISIBLE Element; using ElementPtr = std::shared_ptr; using ElementWeakPtr = std::weak_ptr; - class SDFORMAT_VISIBLE Param; + class IGNITION_SDFORMAT_VISIBLE Param; /// \def ParamPtr /// \brief Shared pointer to a Param @@ -113,7 +113,7 @@ namespace sdf /// \class Param Param.hh sdf/sdf.hh /// \brief A parameter class - class SDFORMAT_VISIBLE Param + class IGNITION_SDFORMAT_VISIBLE Param { /// \brief Constructor. /// \param[in] _key Key for the parameter. @@ -401,7 +401,7 @@ namespace sdf /// \param[in] _valueStr The value as a string /// \param[out] _valueToSet The value to set /// \return True if the value was successfully set, false otherwise - public: bool SDFORMAT_VISIBLE ValueFromStringImpl( + public: bool IGNITION_SDFORMAT_VISIBLE ValueFromStringImpl( const std::string &_typeName, const std::string &_valueStr, ParamVariant &_valueToSet) const; diff --git a/include/sdf/ParserConfig.hh b/include/sdf/ParserConfig.hh index 9c83d1c66..192bbbb6b 100644 --- a/include/sdf/ParserConfig.hh +++ b/include/sdf/ParserConfig.hh @@ -28,7 +28,7 @@ #include "sdf/Error.hh" #include "sdf/InterfaceElements.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf @@ -81,7 +81,7 @@ class ParserConfigPrivate; /// sdf::Root root; /// root.Load("path/to/file.sdf", config); /// \endcode -class SDFORMAT_VISIBLE ParserConfig +class IGNITION_SDFORMAT_VISIBLE ParserConfig { /// type alias for the map from URI scheme to search directories public: using SchemeToPathMap = diff --git a/include/sdf/ParticleEmitter.hh b/include/sdf/ParticleEmitter.hh index 5d457addc..c6218c726 100644 --- a/include/sdf/ParticleEmitter.hh +++ b/include/sdf/ParticleEmitter.hh @@ -26,7 +26,7 @@ #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -57,7 +57,7 @@ namespace sdf /// \brief A description of a particle emitter, which can be attached /// to a link. A particle emitter can be used to describe fog, smoke, and /// dust. - class SDFORMAT_VISIBLE ParticleEmitter + class IGNITION_SDFORMAT_VISIBLE ParticleEmitter { /// \brief Default constructor public: ParticleEmitter(); diff --git a/include/sdf/Pbr.hh b/include/sdf/Pbr.hh index d1636b039..00a233e0c 100644 --- a/include/sdf/Pbr.hh +++ b/include/sdf/Pbr.hh @@ -22,7 +22,7 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -55,7 +55,7 @@ namespace sdf /// \brief This class contains Physically-Based-Rendering (PBR) workflow /// properties. - class SDFORMAT_VISIBLE PbrWorkflow + class IGNITION_SDFORMAT_VISIBLE PbrWorkflow { /// \brief Default constructor public: PbrWorkflow(); @@ -235,7 +235,7 @@ namespace sdf /// \brief This class provides access to Physically-Based-Rendering (PBR) /// material workflows. - class SDFORMAT_VISIBLE Pbr + class IGNITION_SDFORMAT_VISIBLE Pbr { /// \brief Default constructor public: Pbr(); diff --git a/include/sdf/Physics.hh b/include/sdf/Physics.hh index f860a1159..063b98ff2 100644 --- a/include/sdf/Physics.hh +++ b/include/sdf/Physics.hh @@ -23,7 +23,7 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -33,7 +33,7 @@ namespace sdf /// \brief The physics element specifies the type and properties of a /// dynamics engine. - class SDFORMAT_VISIBLE Physics + class IGNITION_SDFORMAT_VISIBLE Physics { /// \brief Default constructor public: Physics(); diff --git a/include/sdf/Plane.hh b/include/sdf/Plane.hh index 8f5a91227..27c3778c8 100644 --- a/include/sdf/Plane.hh +++ b/include/sdf/Plane.hh @@ -33,7 +33,7 @@ namespace sdf /// \brief Plane represents a plane shape, and is usually accessed through a /// Geometry. - class SDFORMAT_VISIBLE Plane + class IGNITION_SDFORMAT_VISIBLE Plane { /// \brief Constructor public: Plane(); diff --git a/include/sdf/PrintConfig.hh b/include/sdf/PrintConfig.hh index 2f4332ca1..93c148440 100644 --- a/include/sdf/PrintConfig.hh +++ b/include/sdf/PrintConfig.hh @@ -20,7 +20,7 @@ #include #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -28,7 +28,7 @@ inline namespace SDF_VERSION_NAMESPACE { /// This class contains configuration options for printing elements. -class SDFORMAT_VISIBLE PrintConfig +class IGNITION_SDFORMAT_VISIBLE PrintConfig { /// \brief Default constructor. public: PrintConfig(); diff --git a/include/sdf/Root.hh b/include/sdf/Root.hh index cfd17aa63..81a424c95 100644 --- a/include/sdf/Root.hh +++ b/include/sdf/Root.hh @@ -23,7 +23,7 @@ #include "sdf/SDFImpl.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -51,7 +51,7 @@ namespace sdf /// /// \snippet examples/dom.cc rootUsage /// - class SDFORMAT_VISIBLE Root + class IGNITION_SDFORMAT_VISIBLE Root { /// \brief Default constructor public: Root(); diff --git a/include/sdf/SDFImpl.hh b/include/sdf/SDFImpl.hh index a2a922336..3dd7c9ae7 100644 --- a/include/sdf/SDFImpl.hh +++ b/include/sdf/SDFImpl.hh @@ -27,7 +27,7 @@ #include "sdf/PrintConfig.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" #ifdef _WIN32 // Disable warning C4251 which is triggered by @@ -44,7 +44,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { // - class SDFORMAT_VISIBLE SDF; + class IGNITION_SDFORMAT_VISIBLE SDF; class SDFPrivate; /// \def SDFPtr @@ -75,7 +75,7 @@ namespace sdf /// \param[in] _useCallback True to find a file based on a registered /// callback if the file is not found via the normal mechanism. /// \return File's full path. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE std::string findFile(const std::string &_filename, bool _searchLocalPath = true, bool _useCallback = false); @@ -93,7 +93,7 @@ namespace sdf /// callback if the file is not found via the normal mechanism. /// \param[in] _config Custom parser configuration /// \return File's full path. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE std::string findFile(const std::string &_filename, bool _searchLocalPath, bool _useCallback, @@ -104,18 +104,18 @@ namespace sdf /// Example paramters: "model://", "/usr/share/models:~/.gazebo/models" /// \param[in] _uri URI that will be mapped to _path /// \param[in] _path Colon separated set of paths. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE void addURIPath(const std::string &_uri, const std::string &_path); /// \brief Set the callback to use when SDF can't find a file. /// The callback should return a complete path to the requested file, or /// and empty string if the file was not found in the callback. /// \param[in] _cb The callback function. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE void setFindCallback(std::function _cb); /// \brief Base SDF class - class SDFORMAT_VISIBLE SDF + class IGNITION_SDFORMAT_VISIBLE SDF { public: SDF(); /// \brief Destructor diff --git a/include/sdf/Scene.hh b/include/sdf/Scene.hh index cf3796aca..4698b5722 100644 --- a/include/sdf/Scene.hh +++ b/include/sdf/Scene.hh @@ -24,13 +24,13 @@ #include "sdf/Sky.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { // Inline bracket to help doxygen filtering. inline namespace SDF_VERSION_NAMESPACE { - class SDFORMAT_VISIBLE Scene + class IGNITION_SDFORMAT_VISIBLE Scene { /// \brief Default constructor public: Scene(); diff --git a/include/sdf/SemanticPose.hh b/include/sdf/SemanticPose.hh index 924802228..56f67d557 100644 --- a/include/sdf/SemanticPose.hh +++ b/include/sdf/SemanticPose.hh @@ -25,7 +25,7 @@ #include #include #include -#include "sdf/system_util.hh" +#include "sdf/Export.hh" #ifdef _WIN32 // Disable warning C4251 which is triggered by @@ -51,7 +51,7 @@ namespace sdf /// The name of the default frame to resolve to must not be empty. /// This class only has a private constructor, and may only be accessed from /// its friend DOM classes. - class SDFORMAT_VISIBLE SemanticPose + class IGNITION_SDFORMAT_VISIBLE SemanticPose { /// \brief Get the raw Pose3 transform. /// \return The raw Pose3 transform. diff --git a/include/sdf/Sensor.hh b/include/sdf/Sensor.hh index 226cfbefd..88ce7f614 100644 --- a/include/sdf/Sensor.hh +++ b/include/sdf/Sensor.hh @@ -25,7 +25,7 @@ #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -129,7 +129,7 @@ namespace sdf }; /// \brief Information about an SDF sensor. - class SDFORMAT_VISIBLE Sensor + class IGNITION_SDFORMAT_VISIBLE Sensor { /// \brief Default constructor public: Sensor(); diff --git a/include/sdf/Sky.hh b/include/sdf/Sky.hh index e1e2e9349..d40179df9 100644 --- a/include/sdf/Sky.hh +++ b/include/sdf/Sky.hh @@ -24,13 +24,13 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { // Inline bracket to help doxygen filtering. inline namespace SDF_VERSION_NAMESPACE { - class SDFORMAT_VISIBLE Sky + class IGNITION_SDFORMAT_VISIBLE Sky { /// \brief Default constructor public: Sky(); diff --git a/include/sdf/Sphere.hh b/include/sdf/Sphere.hh index 2ab0538be..afe981141 100644 --- a/include/sdf/Sphere.hh +++ b/include/sdf/Sphere.hh @@ -30,7 +30,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Sphere represents a sphere shape, and is usually accessed through a /// Geometry. - class SDFORMAT_VISIBLE Sphere + class IGNITION_SDFORMAT_VISIBLE Sphere { /// \brief Constructor public: Sphere(); diff --git a/include/sdf/Surface.hh b/include/sdf/Surface.hh index cdcd17cca..da28f8dc3 100644 --- a/include/sdf/Surface.hh +++ b/include/sdf/Surface.hh @@ -21,14 +21,14 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { // Inline bracket to help doxygen filtering. inline namespace SDF_VERSION_NAMESPACE { /// \brief Contact information for a surface. - class SDFORMAT_VISIBLE Contact + class IGNITION_SDFORMAT_VISIBLE Contact { /// \brief Default constructor public: Contact(); @@ -59,7 +59,7 @@ namespace sdf }; /// \brief Surface information for a collision. - class SDFORMAT_VISIBLE Surface + class IGNITION_SDFORMAT_VISIBLE Surface { /// \brief Default constructor public: Surface(); diff --git a/include/sdf/Types.hh b/include/sdf/Types.hh index 8ad08a9fe..36e3c905e 100644 --- a/include/sdf/Types.hh +++ b/include/sdf/Types.hh @@ -26,7 +26,7 @@ #include #include -#include "sdf/system_util.hh" +#include "sdf/Export.hh" #include "sdf/Error.hh" #if defined(__GNUC__) || defined(__clang__) @@ -75,20 +75,20 @@ namespace sdf /// \param[in] str The string to split. /// \param[in] splitter The delimiter to use. /// \return A vector of strings containing the split tokens. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE std::vector split(const std::string &_str, const std::string &_splitter); /// \brief Trim leading and trailing whitespace from a string. /// \param[in] _in The string to trim. /// \return A string containing the trimmed value. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE std::string trim(const char *_in); /// \brief Trim leading and trailing whitespace from a string. /// \param[in] _in The string to trim. /// \return A string containing the trimmed value. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE std::string trim(const std::string &_in); /// \brief check if two values are equal, within a tolerance @@ -109,12 +109,12 @@ namespace sdf /// \param[in,out] _out The output stream. /// \param[in] _err The errors to output. /// \return Reference to the given output stream - SDFORMAT_VISIBLE std::ostream &operator<<( + IGNITION_SDFORMAT_VISIBLE std::ostream &operator<<( std::ostream &_out, const sdf::Errors &_errs); /// \brief A Time class, can be used to hold wall- or sim-time. /// stored as sec and nano-sec. - class SDFORMAT_VISIBLE Time + class IGNITION_SDFORMAT_VISIBLE Time { /// \brief Constructor public: Time() @@ -170,7 +170,7 @@ namespace sdf }; /// \brief A class for inertial information about a link. - class SDFORMAT_VISIBLE Inertia + class IGNITION_SDFORMAT_VISIBLE Inertia { public: double mass; }; @@ -178,13 +178,13 @@ namespace sdf /// \brief Transforms a string to its lowercase equivalent /// \param[in] _in String to convert to lowercase /// \return Lowercase equilvalent of _in. - std::string SDFORMAT_VISIBLE lowercase(const std::string &_in); + std::string IGNITION_SDFORMAT_VISIBLE lowercase(const std::string &_in); /// \brief Split a name into a two strings based on the '::' delimeter /// \param[in] _absoluteName The fully qualified absolute name /// \return A pair with the absolute name minus the leaf node name, and the /// leaf name - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE std::pair SplitName( const std::string &_absoluteName); @@ -193,7 +193,7 @@ namespace sdf /// \param[in] _scopeName the left-hand-side component /// \param[in] _localName the right-hand-side component /// \return A full string with the names joined by the '::' delimeter. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE std::string JoinName( const std::string &_scopeName, const std::string &_localName); } diff --git a/include/sdf/Visual.hh b/include/sdf/Visual.hh index f8eae7291..32de21226 100644 --- a/include/sdf/Visual.hh +++ b/include/sdf/Visual.hh @@ -30,7 +30,7 @@ #include "sdf/Sphere.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -43,7 +43,7 @@ namespace sdf struct PoseRelativeToGraph; template class ScopedGraph; - class SDFORMAT_VISIBLE Visual + class IGNITION_SDFORMAT_VISIBLE Visual { /// \brief Default constructor public: Visual(); diff --git a/include/sdf/World.hh b/include/sdf/World.hh index 0fe26a77a..be40603d5 100644 --- a/include/sdf/World.hh +++ b/include/sdf/World.hh @@ -30,7 +30,7 @@ #include "sdf/Scene.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { @@ -51,7 +51,7 @@ namespace sdf struct FrameAttachedToGraph; template class ScopedGraph; - class SDFORMAT_VISIBLE World + class IGNITION_SDFORMAT_VISIBLE World { /// \brief Default constructor public: World(); diff --git a/include/sdf/parser.hh b/include/sdf/parser.hh index 82b036a8d..67df552b8 100644 --- a/include/sdf/parser.hh +++ b/include/sdf/parser.hh @@ -21,7 +21,7 @@ #include "sdf/SDFImpl.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" /// \ingroup sdf_parser /// \brief namespace for Simulation Description Format parser @@ -43,14 +43,14 @@ namespace sdf /// \brief Initialize the SDF interface from the embedded root spec file /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool init(SDFPtr _sdf); /// \brief Initialize the SDF interface using a file /// \param[in] _filename Name of the SDF file /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool initFile(const std::string &_filename, SDFPtr _sdf); /// \brief Initialize the SDF interface using a file @@ -58,7 +58,7 @@ namespace sdf /// \param[in] _config Custom parser configuration /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool initFile( const std::string &_filename, const ParserConfig &_config, SDFPtr _sdf); @@ -66,7 +66,7 @@ namespace sdf /// \param[in] _filename Name of the SDF file /// \param[in] _sdf Pointer to an SDF Element object. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool initFile(const std::string &_filename, ElementPtr _sdf); /// \brief Initialize an SDFElement interface using a file @@ -74,7 +74,7 @@ namespace sdf /// \param[in] _config Custom parser configuration /// \param[out] _sdf Pointer to an SDF Element object. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool initFile(const std::string &_filename, const ParserConfig &_config, ElementPtr _sdf); @@ -82,7 +82,7 @@ namespace sdf /// \param[in] _xmlString XML string to be parsed. /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool initString(const std::string &_xmlString, SDFPtr _sdf); /// \brief Initialize the SDF interface using a string @@ -90,7 +90,7 @@ namespace sdf /// \param[in] _config Custom parser configuration /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool initString( const std::string &_xmlString, const ParserConfig &_config, SDFPtr _sdf); @@ -101,7 +101,7 @@ namespace sdf /// SDF version /// \param[in] _filename Name of the SDF file /// \return Populated SDF pointer. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE sdf::SDFPtr readFile(const std::string &_filename); /// \brief Populate the SDF values from a file @@ -112,7 +112,7 @@ namespace sdf /// \param[in] _filename Name of the SDF file /// \param[out] _errors Parsing errors will be appended to this variable. /// \return Populated SDF pointer. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE sdf::SDFPtr readFile(const std::string &_filename, Errors &_errors); /// \brief Populate the SDF values from a file @@ -124,7 +124,7 @@ namespace sdf /// \param[in] _config Custom parser configuration /// \param[out] _errors Parsing errors will be appended to this variable. /// \return Populated SDF pointer. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE sdf::SDFPtr readFile(const std::string &_filename, const ParserConfig &_config, Errors &_errors); @@ -137,7 +137,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readFile(const std::string &_filename, SDFPtr _sdf, Errors &_errors); /// \brief Populate the SDF values from a file @@ -150,7 +150,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readFile(const std::string &_filename, const ParserConfig &_config, SDFPtr _sdf, Errors &_errors); @@ -165,7 +165,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readFileWithoutConversion( const std::string &_filename, SDFPtr _sdf, Errors &_errors); @@ -181,7 +181,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readFileWithoutConversion(const std::string &_filename, const ParserConfig &_config, SDFPtr _sdf, Errors &_errors); @@ -193,7 +193,7 @@ namespace sdf /// \param[in] _filename Name of the SDF file /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readFile(const std::string &_filename, SDFPtr _sdf); /// \brief Populate the SDF values from a string @@ -205,7 +205,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, SDFPtr _sdf, Errors &_errors); /// \brief Populate the SDF values from a string @@ -218,7 +218,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, const ParserConfig &_config, SDFPtr _sdf, Errors &_errors); @@ -230,7 +230,7 @@ namespace sdf /// \param[in] _xmlString XML string to be parsed. /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, SDFPtr _sdf); /// \brief Populate the SDF values from a string @@ -242,7 +242,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF Element object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, ElementPtr _sdf, Errors &_errors); @@ -256,7 +256,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF Element object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, const ParserConfig &_config, ElementPtr _sdf, Errors &_errors); @@ -271,7 +271,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readStringWithoutConversion( const std::string &_xmlString, SDFPtr _sdf, Errors &_errors); @@ -285,7 +285,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readStringWithoutConversion(const std::string &_xmlString, const ParserConfig &_config, SDFPtr _sdf, Errors &_errors); @@ -297,7 +297,7 @@ namespace sdf /// \param[in] _xmlString XML string to be parsed. /// \param[in] _sdf Pointer to an SDF Element object. /// \return True if successful. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, ElementPtr _sdf); /// \brief Get the file path to the model file @@ -305,7 +305,7 @@ namespace sdf /// \return string with the full filesystem path to the best version (greater /// SDF protocol supported by this sdformat version) of the .sdf /// model files hosted by _modelDirPath. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE std::string getModelFilePath(const std::string &_modelDirPath); /// \brief Convert an SDF file to a specific SDF version. @@ -313,7 +313,7 @@ namespace sdf /// \param[in] _version Version to convert _filename to. /// \param[out] _sdf Pointer to the converted SDF document. /// \return True on success. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool convertFile(const std::string &_filename, const std::string &_version, SDFPtr _sdf); @@ -323,7 +323,7 @@ namespace sdf /// \param[in] _config Custom parser configuration /// \param[out] _sdf Pointer to the converted SDF document. /// \return True on success. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool convertFile(const std::string &_filename, const std::string &_version, const ParserConfig &_config, SDFPtr _sdf); @@ -332,7 +332,7 @@ namespace sdf /// \param[in] _version Version to convert _filename to. /// \param[out] _sdf Pointer to the converted SDF document. /// \return True on success. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool convertString(const std::string &_sdfString, const std::string &_version, SDFPtr _sdf); @@ -342,7 +342,7 @@ namespace sdf /// \param[in] _config Custom parser configuration /// \param[out] _sdf Pointer to the converted SDF document. /// \return True on success. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool convertString(const std::string &_sdfString, const std::string &_version, const ParserConfig &_config, SDFPtr _sdf); @@ -353,7 +353,7 @@ namespace sdf /// rather than terminating early when the first error is found. /// \param[in] _root SDF Root object to check recursively. /// \return True if all models have valid canonical_link attributes. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool checkCanonicalLinkNames(const sdf::Root *_root); /// \brief For the world and each model, check that the attached_to graphs @@ -364,7 +364,7 @@ namespace sdf /// rather than terminating early when the first error is found. /// \param[in] _root SDF Root object to check recursively. /// \return True if all attached_to graphs are valid. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool checkFrameAttachedToGraph(const sdf::Root *_root); /// \brief Check that for each frame, the attached_to attribute value @@ -375,7 +375,7 @@ namespace sdf /// rather than terminating early when the first error is found. /// \param[in] _root SDF Root object to check recursively. /// \return True if all frames have valid attached_to attributes. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool checkFrameAttachedToNames(const sdf::Root *_root); /// \brief Check that all joints in contained models specify parent @@ -385,7 +385,7 @@ namespace sdf /// \param[in] _root SDF Root object to check recursively. /// \return True if all models have joints with valid parent and child /// link names. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool checkJointParentChildLinkNames(const sdf::Root *_root); /// \brief For the world and each model, check that the attached_to graphs @@ -396,7 +396,7 @@ namespace sdf /// rather than terminating early when the first error is found. /// \param[in] _root SDF Root object to check recursively. /// \return True if all attached_to graphs are valid. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool checkPoseRelativeToGraph(const sdf::Root *_root); /// \brief Check that all sibling elements of the same type have unique names. @@ -405,7 +405,7 @@ namespace sdf /// \param[in] _elem SDF Element to check recursively. /// \return True if all contained elements have do not share a name with /// sibling elements of the same type. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool recursiveSameTypeUniqueNames(sdf::ElementPtr _elem); /// \brief Check that all sibling elements of the any type have unique names. @@ -414,7 +414,7 @@ namespace sdf /// \param[in] _elem SDF Element to check recursively. /// \return True if all contained elements have do not share a name with /// sibling elements of any type. - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool recursiveSiblingUniqueNames(sdf::ElementPtr _elem); /// \brief Check that all sibling elements do not contain the delimiter @@ -424,7 +424,7 @@ namespace sdf /// containing '::' is found. /// \param[in] _elem SDF Element to check recursively. /// \return True if all contained element names do not have the delimiter '::' - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool recursiveSiblingNoDoubleColonInNames(sdf::ElementPtr _elem); /// \brief Check whether the element should be validated. If this returns @@ -432,7 +432,7 @@ namespace sdf /// skip this element and its descendants. /// \param[in] _elem SDF Element to check. /// \return True if the element should be validated - SDFORMAT_VISIBLE + IGNITION_SDFORMAT_VISIBLE bool shouldValidateElement(sdf::ElementPtr _elem); } } diff --git a/include/sdf/system_util.hh b/include/sdf/system_util.hh deleted file mode 100644 index c2488dbb9..000000000 --- a/include/sdf/system_util.hh +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2013 Open Source Robotics Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * -*/ -#ifndef SDF_VISIBLE_HH_ -#define SDF_VISIBLE_HH_ - -/** \def SDFORMAT_VISIBLE - * Use to represent "symbol visible" if supported - */ - -/** \def SDFORMAT_HIDDEN - * Use to represent "symbol hidden" if supported - */ - -#if defined _WIN32 || defined __CYGWIN__ - #ifdef BUILDING_SDFORMAT_SHARED - #define SDFORMAT_VISIBLE __declspec(dllexport) - #elif !defined SDFORMAT_STATIC_DEFINE - #define SDFORMAT_VISIBLE __declspec(dllimport) - #else - #define SDFORMAT_VISIBLE - #endif -#else - #if __GNUC__ >= 4 && !defined SDFORMAT_STATIC_DEFINE - #define SDFORMAT_VISIBLE __attribute__ ((visibility ("default"))) - #define SDFORMAT_HIDDEN __attribute__ ((visibility ("hidden"))) - #else - #define SDFORMAT_VISIBLE - #define SDFORMAT_HIDDEN - #endif -#endif - -// SDF_VISIBLE_HH_ -#endif diff --git a/src/Converter.hh b/src/Converter.hh index 444c9d8a4..b0217d586 100644 --- a/src/Converter.hh +++ b/src/Converter.hh @@ -23,7 +23,7 @@ #include #include -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { diff --git a/src/ParamPassing.hh b/src/ParamPassing.hh index 98994aea2..33acf53d6 100644 --- a/src/ParamPassing.hh +++ b/src/ParamPassing.hh @@ -22,7 +22,7 @@ #include "sdf/ParserConfig.hh" #include "sdf/SDFImpl.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { diff --git a/src/Surface.cc b/src/Surface.cc index 52ee23cbf..53ca2ced0 100644 --- a/src/Surface.cc +++ b/src/Surface.cc @@ -19,7 +19,7 @@ #include "sdf/Surface.hh" #include "sdf/Types.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" using namespace sdf; diff --git a/src/ign.cc b/src/ign.cc index f8dae4991..86071a176 100644 --- a/src/ign.cc +++ b/src/ign.cc @@ -24,14 +24,14 @@ #include "sdf/Filesystem.hh" #include "sdf/Root.hh" #include "sdf/parser.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" #include "FrameSemantics.hh" #include "ScopedGraph.hh" #include "ign.hh" ////////////////////////////////////////////////// -extern "C" SDFORMAT_VISIBLE int cmdCheck(const char *_path) +extern "C" IGNITION_SDFORMAT_VISIBLE int cmdCheck(const char *_path) { int result = 0; @@ -99,7 +99,7 @@ extern "C" SDFORMAT_VISIBLE int cmdCheck(const char *_path) } ////////////////////////////////////////////////// -extern "C" SDFORMAT_VISIBLE char *ignitionVersion() +extern "C" IGNITION_SDFORMAT_VISIBLE char *ignitionVersion() { #ifdef _MSC_VER return _strdup(SDF_VERSION_FULL); @@ -111,7 +111,7 @@ extern "C" SDFORMAT_VISIBLE char *ignitionVersion() ////////////////////////////////////////////////// /// \brief Print the full description of the SDF spec. /// \return 0 on success, -1 if SDF could not be initialized. -extern "C" SDFORMAT_VISIBLE int cmdDescribe(const char *_version) +extern "C" IGNITION_SDFORMAT_VISIBLE int cmdDescribe(const char *_version) { sdf::SDFPtr sdf(new sdf::SDF()); @@ -131,7 +131,7 @@ extern "C" SDFORMAT_VISIBLE int cmdDescribe(const char *_version) } ////////////////////////////////////////////////// -extern "C" SDFORMAT_VISIBLE int cmdPrint(const char *_path) +extern "C" IGNITION_SDFORMAT_VISIBLE int cmdPrint(const char *_path) { if (!sdf::filesystem::exists(_path)) { @@ -160,7 +160,7 @@ extern "C" SDFORMAT_VISIBLE int cmdPrint(const char *_path) ////////////////////////////////////////////////// // cppcheck-suppress unusedFunction -extern "C" SDFORMAT_VISIBLE int cmdGraph( +extern "C" IGNITION_SDFORMAT_VISIBLE int cmdGraph( const char *_graphType, const char *_path) { if (!sdf::filesystem::exists(_path)) diff --git a/src/ign.hh b/src/ign.hh index 0c74b4755..f534ae35b 100644 --- a/src/ign.hh +++ b/src/ign.hh @@ -21,7 +21,7 @@ #include #include -#include "sdf/system_util.hh" +#include "sdf/Export.hh" // Inline bracket to help doxygen filtering. inline namespace SDF_VERSION_NAMESPACE { @@ -30,11 +30,11 @@ inline namespace SDF_VERSION_NAMESPACE { /// \brief External hook to execute 'ign sdf -k' from the command line. /// \param[in] _path Path to the file to validate. /// \return Zero on success, negative one otherwise. -extern "C" SDFORMAT_VISIBLE int cmdCheck(const char *_path); +extern "C" IGNITION_SDFORMAT_VISIBLE int cmdCheck(const char *_path); /// \brief External hook to read the library version. /// \return C-string representing the version. Ex.: 0.1.2 -extern "C" SDFORMAT_VISIBLE char *ignitionVersion(); +extern "C" IGNITION_SDFORMAT_VISIBLE char *ignitionVersion(); } #endif diff --git a/src/parser_private.hh b/src/parser_private.hh index 576d40d22..a9efe25a5 100644 --- a/src/parser_private.hh +++ b/src/parser_private.hh @@ -23,7 +23,7 @@ #include "sdf/SDFImpl.hh" #include "sdf/config.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" /// \ingroup sdf_parser /// \brief namespace for Simulation Description Format parser diff --git a/src/parser_urdf.hh b/src/parser_urdf.hh index 3badb4cc4..9bd9ae4b3 100644 --- a/src/parser_urdf.hh +++ b/src/parser_urdf.hh @@ -24,7 +24,7 @@ #include "sdf/Console.hh" #include "sdf/Types.hh" -#include "sdf/system_util.hh" +#include "sdf/Export.hh" namespace sdf { From 337a3cccde7130091a5fb7e15d154aeac9bdcf67 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Thu, 11 Nov 2021 15:38:24 +0800 Subject: [PATCH 15/29] do not use ign_create_docs as there are some differences Signed-off-by: Teo Koon Peng --- CMakeLists.txt | 2 -- doc/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cab19ade..fa78aac50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,8 +45,6 @@ if (BUILD_SDF) ign_configure_build(QUIT_IF_BUILD_ERRORS) ign_create_packages() - # ign_create_docs() - add_subdirectory(sdf) add_subdirectory(conf) add_subdirectory(doc) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 019149959..66d4caa6a 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -15,7 +15,7 @@ if (DOXYGEN_FOUND) ${CMAKE_BINARY_DIR}/doxygen/html/search COMMAND make -C ${CMAKE_BINARY_DIR}/doxygen/latex COMMAND mv ${CMAKE_BINARY_DIR}/doxygen/latex/refman.pdf - ${CMAKE_BINARY_DIR}/doxygen/latex/sdf-${SDF_VERSION_FULL}.pdf + ${CMAKE_BINARY_DIR}/doxygen/latex/sdf-${PROJECT_VERSION_FULL}.pdf COMMENT "Generating API documentation with Doxygen" VERBATIM) endif() From 0fee3bebd733247ba4d0346e3c1e76360729e5d7 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Thu, 11 Nov 2021 15:53:14 +0800 Subject: [PATCH 16/29] fix references to sdf_target Signed-off-by: Teo Koon Peng --- conf/CMakeLists.txt | 10 +++++----- sdf/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/conf/CMakeLists.txt b/conf/CMakeLists.txt index 001e28ee5..fd3b6d278 100644 --- a/conf/CMakeLists.txt +++ b/conf/CMakeLists.txt @@ -1,23 +1,23 @@ # Used only for internal testing. -set(ign_library_path "${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${sdf_target}") +set(ign_library_path "${CMAKE_BINARY_DIR}/test/lib/ruby/ignition/cmd${PROJECT_NAME}") # Generate a configuration file for internal testing. # Note that the major version of the library is included in the name. # Ex: sdformat0.yaml configure_file( "${PROJECT_NAME_NO_VERSION_LOWER}.yaml.in" - "${CMAKE_BINARY_DIR}/test/conf/${sdf_target}.yaml" @ONLY) + "${CMAKE_BINARY_DIR}/test/conf/${PROJECT_NAME}.yaml" @ONLY) # Used for the installed version. -set(ign_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${sdf_target}") +set(ign_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${PROJECT_NAME}") # Generate the configuration file that is installed. # Note that the major version of the library is included in the name. # Ex: sdformat0.yaml configure_file( "${PROJECT_NAME_NO_VERSION_LOWER}.yaml.in" - "${CMAKE_CURRENT_BINARY_DIR}/${sdf_target}.yaml" @ONLY) + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.yaml" @ONLY) # Install the yaml configuration files in an unversioned location. -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${sdf_target}.yaml +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.yaml DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/ignition/) diff --git a/sdf/CMakeLists.txt b/sdf/CMakeLists.txt index 9ce942840..bae97a640 100644 --- a/sdf/CMakeLists.txt +++ b/sdf/CMakeLists.txt @@ -40,5 +40,5 @@ if (IGNITION-TOOLS_BINARY_DIRS) COMMENT "Generating full description for spec ${desc_ver}" VERBATIM) endforeach() - add_custom_target(sdf_descriptions DEPENDS ${description_targets} ${sdf_target}) + add_custom_target(sdf_descriptions DEPENDS ${description_targets} ${PROJECT_NAME}) endif() From 355d296fd860a17ddbbdc2826e21bb287494c997 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Thu, 11 Nov 2021 15:53:34 +0800 Subject: [PATCH 17/29] fix ign math and utils wrongly marked optional Signed-off-by: Teo Koon Peng --- cmake/SearchForStuff.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 8edbf4a46..e320605af 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -64,11 +64,11 @@ endif() ######################################## # Find ignition math # Set a variable for generating ProjectConfig.cmake -ign_find_package(ignition-math6 VERSION 6.8 QUIET) +ign_find_package(ignition-math6 VERSION 6.8 REQUIRED) set(IGN_MATH_VER ${ignition-math6_VERSION_MAJOR}) ######################################## # Find ignition utils # Set a variable for generating ProjectConfig.cmake -ign_find_package(ignition-utils1 QUIET) +ign_find_package(ignition-utils1 REQUIRED) set(IGN_UTILS_VER ${ignition-utils1_VERSION_MAJOR}) From 116c95bde9ed4ab57e35642da81a03e076975481 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Thu, 11 Nov 2021 15:55:03 +0800 Subject: [PATCH 18/29] fix missing patch version Signed-off-by: Teo Koon Peng --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa78aac50..9eb6f3175 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ if(COMMAND CMAKE_POLICY) CMAKE_POLICY(SET CMP0004 NEW) endif(COMMAND CMAKE_POLICY) -project (sdformat13 VERSION 13.0) +project (sdformat13 VERSION 13.0.0) # The protocol version has nothing to do with the package version set below. # It represents the current version of sdformat implement by the software From 591f37909b14bcd2e703e5e8cc9e2088b9cea62e Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Fri, 12 Nov 2021 09:41:32 +0800 Subject: [PATCH 19/29] use updated param name Signed-off-by: Teo Koon Peng --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9eb6f3175..a1f7d8966 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ if (WIN32) endif () if (BUILD_SDF) - ign_configure_project(INCLUDE_DIR sdf NO_IGNITION_PREFIX) + ign_configure_project(REPLACE_IGNITION_INCLUDE_PATH sdf NO_IGNITION_PREFIX) message (STATUS "\n\n====== Finding 3rd Party Packages ======") include (${sdf_cmake_dir}/SDFUtils.cmake) From b478cb5fae20ce80600b7f661969dfb6f95ef218 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Fri, 12 Nov 2021 10:20:46 +0800 Subject: [PATCH 20/29] remove urdfdom version as the cmake config does not support it Signed-off-by: Teo Koon Peng --- cmake/SearchForStuff.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index e320605af..072aabf78 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -11,7 +11,7 @@ ign_find_package(TINYXML2 REQUIRED) # 2. if USE_INTERNAL_URDF is set to True, use the internal copy # 3. if USE_INTERNAL_URDF is set to False, force to search system installation, fail on error if (NOT DEFINED USE_INTERNAL_URDF OR NOT USE_INTERNAL_URDF) - ign_find_package(IgnURDFDOM VERSION 1.0 QUIET) + ign_find_package(IgnURDFDOM QUIET) if (NOT IgnURDFDOM_FOUND) if (NOT DEFINED USE_INTERNAL_URDF) # fallback to internal urdf From cbdc0debd4e8e8a1711ef4cc3cad5bb56f3c3056 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 1 Dec 2021 10:01:59 +0800 Subject: [PATCH 21/29] install sdf.hh and sdf_config.h Signed-off-by: Teo Koon Peng --- include/sdf/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/sdf/CMakeLists.txt b/include/sdf/CMakeLists.txt index f67bdf1a9..44ea96d43 100644 --- a/include/sdf/CMakeLists.txt +++ b/include/sdf/CMakeLists.txt @@ -1,4 +1,11 @@ configure_file(config.hh.in include/sdf/config.hh) +# Exlcude some files so that they are not added to the master header. ign_install_all_headers(EXCLUDE_FILES sdf.hh sdf_config.h) +install( + FILES + sdf.hh + sdf_config.h + DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL}/${PROJECT_INCLUDE_DIR} +) From e695e3cd99fef0fa1395c23f6a9ac653029b0739 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 1 Dec 2021 10:24:05 +0800 Subject: [PATCH 22/29] do not deprecate old headers; revert changes to use old headers Signed-off-by: Teo Koon Peng --- cmake/sdf_config.h.in | 37 ++++++++++++ include/sdf/Actor.hh | 12 ++-- include/sdf/AirPressure.hh | 4 +- include/sdf/Altimeter.hh | 4 +- include/sdf/Atmosphere.hh | 6 +- include/sdf/Box.hh | 4 +- include/sdf/Camera.hh | 4 +- include/sdf/Capsule.hh | 4 +- include/sdf/Collision.hh | 6 +- include/sdf/Console.hh | 8 +-- include/sdf/Cylinder.hh | 4 +- include/sdf/Element.hh | 8 +-- include/sdf/Ellipsoid.hh | 4 +- include/sdf/Error.hh | 8 +-- include/sdf/Exception.hh | 10 ++-- include/sdf/Filesystem.hh | 18 +++--- include/sdf/ForceTorque.hh | 4 +- include/sdf/Frame.hh | 6 +- include/sdf/Geometry.hh | 4 +- include/sdf/Gui.hh | 6 +- include/sdf/Heightmap.hh | 8 +-- include/sdf/Imu.hh | 4 +- include/sdf/InterfaceElements.hh | 6 +- include/sdf/InterfaceFrame.hh | 6 +- include/sdf/InterfaceJoint.hh | 6 +- include/sdf/InterfaceLink.hh | 6 +- include/sdf/InterfaceModel.hh | 6 +- include/sdf/InterfaceModelPoseGraph.hh | 6 +- include/sdf/Joint.hh | 6 +- include/sdf/JointAxis.hh | 6 +- include/sdf/Lidar.hh | 4 +- include/sdf/Light.hh | 6 +- include/sdf/Link.hh | 6 +- include/sdf/Magnetometer.hh | 4 +- include/sdf/Material.hh | 6 +- include/sdf/Mesh.hh | 4 +- include/sdf/Model.hh | 6 +- include/sdf/NavSat.hh | 4 +- include/sdf/Noise.hh | 4 +- include/sdf/Param.hh | 12 ++-- include/sdf/ParserConfig.hh | 6 +- include/sdf/ParticleEmitter.hh | 6 +- include/sdf/Pbr.hh | 8 +-- include/sdf/Physics.hh | 6 +- include/sdf/Plane.hh | 4 +- include/sdf/PrintConfig.hh | 6 +- include/sdf/Root.hh | 6 +- include/sdf/SDFImpl.hh | 16 +++--- include/sdf/Scene.hh | 6 +- include/sdf/SemanticPose.hh | 6 +- include/sdf/Sensor.hh | 6 +- include/sdf/Sky.hh | 6 +- include/sdf/Sphere.hh | 4 +- include/sdf/Surface.hh | 8 +-- include/sdf/Types.hh | 22 ++++---- include/sdf/Visual.hh | 6 +- include/sdf/World.hh | 6 +- include/sdf/parser.hh | 78 +++++++++++++------------- include/sdf/sdf.hh | 3 +- include/sdf/sdf_config.h | 3 +- include/sdf/system_util.hh | 47 ++++++++++++++++ src/Console.cc | 2 +- src/Converter.hh | 4 +- src/Error_TEST.cc | 2 +- src/FrameSemantics_TEST.cc | 2 +- src/ParamPassing.cc | 2 +- src/ParamPassing.hh | 2 +- src/Root.cc | 2 +- src/Root_TEST.cc | 2 +- src/SDF.cc | 2 +- src/SDFExtension.hh | 2 +- src/ScopedGraph.hh | 2 +- src/Surface.cc | 4 +- src/ign.cc | 14 ++--- src/ign.hh | 8 +-- src/ign_TEST.cc | 2 +- src/parser.cc | 2 +- src/parser_private.hh | 4 +- src/parser_urdf.cc | 2 +- src/parser_urdf.hh | 4 +- src/parser_urdf_TEST.cc | 2 +- 81 files changed, 344 insertions(+), 258 deletions(-) create mode 100644 cmake/sdf_config.h.in create mode 100644 include/sdf/system_util.hh diff --git a/cmake/sdf_config.h.in b/cmake/sdf_config.h.in new file mode 100644 index 000000000..524088664 --- /dev/null +++ b/cmake/sdf_config.h.in @@ -0,0 +1,37 @@ +/* config.h. Generated by CMake for @PROJECT_NAME@. */ + +/* Protocol version */ +#define SDF_PROTOCOL_VERSION "${SDF_PROTOCOL_VERSION}" +/* \deprecated SDF_VERSION is deprecated. Please + * use SDF_PROTOCOL_VERSION or SDF_PKG_VERSION + * + * SDF_VERSION is here to keep backwards compatibility. It was used + * when the package version and protocol version were the same + */ +#define SDF_VERSION "${SDF_PROTOCOL_VERSION}" + +/* Package version number */ +#define SDF_MAJOR_VERSION ${SDF_MAJOR_VERSION} +#define SDF_MINOR_VERSION ${SDF_MINOR_VERSION} +#define SDF_PATCH_VERSION ${SDF_PATCH_VERSION} + +#define SDF_MAJOR_VERSION_STR "${SDF_MAJOR_VERSION}" +#define SDF_MINOR_VERSION_STR "${SDF_MINOR_VERSION}" +#define SDF_PATCH_VERSION_STR "${SDF_PATCH_VERSION}" + +#define SDF_PKG_VERSION "${SDF_VERSION}" +#define SDF_VERSION_FULL "${SDF_VERSION_FULL}" +#define SDF_VERSION_NAME ${SDF_VERSION_NAME} +#define SDF_VERSION_NAMESPACE v${SDF_MAJOR_VERSION} + +#define SDF_VERSION_HEADER "Simulation Description Format (SDF), version ${SDF_PROTOCOL_VERSION}\nCopyright (C) 2014 Open Source Robotics Foundation.\nReleased under the Apache 2 License.\nhttp://gazebosim.org/sdf\n\n" + +#cmakedefine BUILD_TYPE_PROFILE 1 +#cmakedefine BUILD_TYPE_DEBUG 1 +#cmakedefine BUILD_TYPE_RELEASE 1 +#cmakedefine HAVE_URDFDOM 1 +#cmakedefine USE_INTERNAL_URDF 1 +#cmakedefine SDFORMAT_DISABLE_CONSOLE_LOGFILE 1 + +#define SDF_SHARE_PATH "${CMAKE_INSTALL_FULL_DATAROOTDIR}/" +#define SDF_VERSION_PATH "${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/${SDF_PKG_VERSION}" diff --git a/include/sdf/Actor.hh b/include/sdf/Actor.hh index e54ab8783..d14cd04f1 100644 --- a/include/sdf/Actor.hh +++ b/include/sdf/Actor.hh @@ -27,8 +27,8 @@ #include "sdf/Types.hh" #include "sdf/Link.hh" #include "sdf/Joint.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -36,7 +36,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { // /// \brief Animation in Actor. - class IGNITION_SDFORMAT_VISIBLE Animation + class SDFORMAT_VISIBLE Animation { /// \brief Default constructor public: Animation(); @@ -94,7 +94,7 @@ namespace sdf }; /// \brief Waypoint for Trajectory. - class IGNITION_SDFORMAT_VISIBLE Waypoint + class SDFORMAT_VISIBLE Waypoint { /// \brief Default constructor public: Waypoint(); @@ -128,7 +128,7 @@ namespace sdf }; /// \brief Trajectory for Animation. - class IGNITION_SDFORMAT_VISIBLE Trajectory + class SDFORMAT_VISIBLE Trajectory { /// \brief Default constructor public: Trajectory(); @@ -187,7 +187,7 @@ namespace sdf /// \brief Provides a description of an actor. - class IGNITION_SDFORMAT_VISIBLE Actor + class SDFORMAT_VISIBLE Actor { /// \brief Default constructor public: Actor(); diff --git a/include/sdf/AirPressure.hh b/include/sdf/AirPressure.hh index 30bd503ee..05f656a5d 100644 --- a/include/sdf/AirPressure.hh +++ b/include/sdf/AirPressure.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { @@ -31,7 +31,7 @@ namespace sdf /// \brief AirPressure contains information about a general /// purpose fluid pressure sensor. /// This sensor can be attached to a link. - class IGNITION_SDFORMAT_VISIBLE AirPressure + class SDFORMAT_VISIBLE AirPressure { /// \brief Default constructor public: AirPressure(); diff --git a/include/sdf/Altimeter.hh b/include/sdf/Altimeter.hh index e0350264c..03bbbf0fa 100644 --- a/include/sdf/Altimeter.hh +++ b/include/sdf/Altimeter.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { @@ -30,7 +30,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Altimeter contains information about an altimeter sensor. /// This sensor can be attached to a link. - class IGNITION_SDFORMAT_VISIBLE Altimeter + class SDFORMAT_VISIBLE Altimeter { /// \brief Default constructor public: Altimeter(); diff --git a/include/sdf/Atmosphere.hh b/include/sdf/Atmosphere.hh index dc3c75c00..3cee963ba 100644 --- a/include/sdf/Atmosphere.hh +++ b/include/sdf/Atmosphere.hh @@ -22,8 +22,8 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf @@ -42,7 +42,7 @@ namespace sdf /// an atmospheric model and related parameters such as temperature /// and pressure at sea level. An Atmosphere instance is optionally part of /// a World. - class IGNITION_SDFORMAT_VISIBLE Atmosphere + class SDFORMAT_VISIBLE Atmosphere { /// \brief Default constructor public: Atmosphere(); diff --git a/include/sdf/Box.hh b/include/sdf/Box.hh index 1d4bc3cfa..9ac7fa219 100644 --- a/include/sdf/Box.hh +++ b/include/sdf/Box.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { @@ -30,7 +30,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Box represents a box shape, and is usually accessed through a /// Geometry. - class IGNITION_SDFORMAT_VISIBLE Box + class SDFORMAT_VISIBLE Box { /// \brief Constructor public: Box(); diff --git a/include/sdf/Camera.hh b/include/sdf/Camera.hh index 238a8ab35..054822323 100644 --- a/include/sdf/Camera.hh +++ b/include/sdf/Camera.hh @@ -24,7 +24,7 @@ #include #include #include -#include +#include namespace sdf { @@ -57,7 +57,7 @@ namespace sdf }; /// \brief Information about a monocular camera sensor. - class IGNITION_SDFORMAT_VISIBLE Camera + class SDFORMAT_VISIBLE Camera { /// \brief Constructor public: Camera(); diff --git a/include/sdf/Capsule.hh b/include/sdf/Capsule.hh index a48e8fb02..76a91f077 100644 --- a/include/sdf/Capsule.hh +++ b/include/sdf/Capsule.hh @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace sdf { @@ -29,7 +29,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Capsule represents a capsule shape, and is usually accessed /// through a Geometry. - class IGNITION_SDFORMAT_VISIBLE Capsule + class SDFORMAT_VISIBLE Capsule { /// \brief Constructor public: Capsule(); diff --git a/include/sdf/Collision.hh b/include/sdf/Collision.hh index 080804211..342985ff7 100644 --- a/include/sdf/Collision.hh +++ b/include/sdf/Collision.hh @@ -24,8 +24,8 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -42,7 +42,7 @@ namespace sdf /// with a link. This can be different from the visual properties of a link. /// For example, simple collision models are often used to reduce /// computation time. - class IGNITION_SDFORMAT_VISIBLE Collision + class SDFORMAT_VISIBLE Collision { /// \brief Default constructor public: Collision(); diff --git a/include/sdf/Console.hh b/include/sdf/Console.hh index 7b908ea42..04856e900 100644 --- a/include/sdf/Console.hh +++ b/include/sdf/Console.hh @@ -23,8 +23,8 @@ #include #include -#include -#include "sdf/Export.hh" +#include +#include "sdf/system_util.hh" #ifdef _WIN32 // Disable warning C4251 which is triggered by @@ -65,10 +65,10 @@ namespace sdf typedef std::shared_ptr ConsolePtr; /// \brief Message, error, warning, and logging functionality - class IGNITION_SDFORMAT_VISIBLE Console + class SDFORMAT_VISIBLE Console { /// \brief An ostream-like class that we'll use for logging. - public: class IGNITION_SDFORMAT_VISIBLE ConsoleStream + public: class SDFORMAT_VISIBLE ConsoleStream { /// \brief Constructor. /// \param[in] _stream Pointer to an output stream operator. Can be diff --git a/include/sdf/Cylinder.hh b/include/sdf/Cylinder.hh index e256bdd91..9a48b59a5 100644 --- a/include/sdf/Cylinder.hh +++ b/include/sdf/Cylinder.hh @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace sdf { @@ -29,7 +29,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Cylinder represents a cylinder shape, and is usually accessed /// through a Geometry. - class IGNITION_SDFORMAT_VISIBLE Cylinder + class SDFORMAT_VISIBLE Cylinder { /// \brief Constructor public: Cylinder(); diff --git a/include/sdf/Element.hh b/include/sdf/Element.hh index 56118a2ac..0a0d3fbb9 100644 --- a/include/sdf/Element.hh +++ b/include/sdf/Element.hh @@ -27,8 +27,8 @@ #include "sdf/Param.hh" #include "sdf/PrintConfig.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" #include "sdf/Types.hh" #ifdef _WIN32 @@ -47,7 +47,7 @@ namespace sdf // class ElementPrivate; - class IGNITION_SDFORMAT_VISIBLE Element; + class SDFORMAT_VISIBLE Element; /// \def ElementPtr /// \brief Shared pointer to an SDF Element @@ -70,7 +70,7 @@ namespace sdf /// \class Element Element.hh sdf/sdf.hh /// \brief SDF Element class - class IGNITION_SDFORMAT_VISIBLE Element : + class SDFORMAT_VISIBLE Element : public std::enable_shared_from_this { /// \brief Constructor. diff --git a/include/sdf/Ellipsoid.hh b/include/sdf/Ellipsoid.hh index 4b7d49a10..fadd4ed81 100644 --- a/include/sdf/Ellipsoid.hh +++ b/include/sdf/Ellipsoid.hh @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace sdf { @@ -29,7 +29,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Ellipsoid represents a ellipsoid shape, and is usually accessed /// through a Geometry. - class IGNITION_SDFORMAT_VISIBLE Ellipsoid + class SDFORMAT_VISIBLE Ellipsoid { /// \brief Constructor public: Ellipsoid(); diff --git a/include/sdf/Error.hh b/include/sdf/Error.hh index 3b8a0f7ad..fb920ec72 100644 --- a/include/sdf/Error.hh +++ b/include/sdf/Error.hh @@ -21,8 +21,8 @@ #include #include #include -#include -#include "sdf/Export.hh" +#include +#include "sdf/system_util.hh" #ifdef _WIN32 // Disable warning C4251 which is triggered by @@ -149,7 +149,7 @@ namespace sdf MERGE_INCLUDE_UNSUPPORTED, }; - class IGNITION_SDFORMAT_VISIBLE Error + class SDFORMAT_VISIBLE Error { /// \brief Default constructor public: Error(); @@ -234,7 +234,7 @@ namespace sdf /// \param[in,out] _out The output stream. /// \param[in] _err The error to output. /// \return Reference to the given output stream - public: friend IGNITION_SDFORMAT_VISIBLE std::ostream &operator<<( + public: friend SDFORMAT_VISIBLE std::ostream &operator<<( std::ostream &_out, const sdf::Error &_err); /// \brief Private data pointer. diff --git a/include/sdf/Exception.hh b/include/sdf/Exception.hh index a6e0edd73..1ada5e8bb 100644 --- a/include/sdf/Exception.hh +++ b/include/sdf/Exception.hh @@ -25,8 +25,8 @@ #include #include -#include -#include "sdf/Export.hh" +#include +#include "sdf/system_util.hh" namespace sdf { @@ -45,7 +45,7 @@ namespace sdf /// \class Exception Exception.hh common/common.hh /// \brief Class for generating exceptions - class IGNITION_SDFORMAT_VISIBLE Exception + class SDFORMAT_VISIBLE Exception { /// \brief Constructor public: Exception(); @@ -108,7 +108,7 @@ namespace sdf /// \brief Class for generating Internal Gazebo Errors: /// those errors which should never happend and /// represent programming bugs. - class IGNITION_SDFORMAT_VISIBLE InternalError : public Exception + class SDFORMAT_VISIBLE InternalError : public Exception { /// \brief Constructor public: InternalError(); @@ -130,7 +130,7 @@ namespace sdf /// sdf assertions. They include information about the /// assertion expression violated, function where problem /// appeared and assertion debug message. - class IGNITION_SDFORMAT_VISIBLE AssertionInternalError : public InternalError + class SDFORMAT_VISIBLE AssertionInternalError : public InternalError { /// \brief Constructor for assertions /// \param[in] _file File name diff --git a/include/sdf/Filesystem.hh b/include/sdf/Filesystem.hh index cd67e6b11..a1e454c64 100644 --- a/include/sdf/Filesystem.hh +++ b/include/sdf/Filesystem.hh @@ -22,8 +22,8 @@ #include #include -#include -#include "sdf/Export.hh" +#include +#include "sdf/system_util.hh" namespace sdf { @@ -36,20 +36,20 @@ namespace sdf /// \brief Determine whether the given path exists on the filesystem. /// \param[in] _path The path to check for existence /// \return True if the path exists on the filesystem, false otherwise. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool exists(const std::string &_path); /// \brief Determine whether the given path is a directory. /// \param[in] _path The path to check /// \return True if given path exists and is a directory, false otherwise. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool is_directory(const std::string &_path); /// \brief Create a new directory on the filesystem. Intermediate /// directories must already exist. /// \param[in] _path The new directory path to create /// \return True if directory creation was successful, false otherwise. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool create_directory(const std::string &_path); // The below is C++ variadic template magic to allow an append @@ -59,7 +59,7 @@ namespace sdf /// onto the passed-in string. /// \param[in] _s The path to start with. /// \return The original path with the platform path separator appended. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE std::string const separator(std::string const &_s); /// \brief Append one or more additional path elements to the first @@ -78,18 +78,18 @@ namespace sdf /// \brief Get the current working path. /// \return Current working path if successful, the empty path on error. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE std::string current_path(); /// \brief Given a path, get just the basename portion. /// \param[in] _path The full path. /// \return A new string with just the basename portion of the path. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE std::string basename(const std::string &_path); /// \class DirIter Filesystem.hh /// \brief A class for iterating over all items in a directory. - class IGNITION_SDFORMAT_VISIBLE DirIter + class SDFORMAT_VISIBLE DirIter { /// \brief Constructor. /// \param[in] _in Directory to iterate over. diff --git a/include/sdf/ForceTorque.hh b/include/sdf/ForceTorque.hh index 704fa33ac..172e63ade 100644 --- a/include/sdf/ForceTorque.hh +++ b/include/sdf/ForceTorque.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { @@ -61,7 +61,7 @@ namespace sdf /// \brief ForceTorque contains information about a force torque sensor. /// This sensor can be attached to a joint. - class IGNITION_SDFORMAT_VISIBLE ForceTorque + class SDFORMAT_VISIBLE ForceTorque { /// \brief Default constructor public: ForceTorque(); diff --git a/include/sdf/Frame.hh b/include/sdf/Frame.hh index 9734c0c98..3c327dab9 100644 --- a/include/sdf/Frame.hh +++ b/include/sdf/Frame.hh @@ -24,8 +24,8 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -39,7 +39,7 @@ namespace sdf /// \brief A Frame element descibes the properties associated with an /// explicit frame defined in a Model or World. - class IGNITION_SDFORMAT_VISIBLE Frame + class SDFORMAT_VISIBLE Frame { /// \brief Default constructor public: Frame(); diff --git a/include/sdf/Geometry.hh b/include/sdf/Geometry.hh index d6b56eb36..6223a1737 100644 --- a/include/sdf/Geometry.hh +++ b/include/sdf/Geometry.hh @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace sdf { @@ -74,7 +74,7 @@ namespace sdf /// Type function to determine the type of shape contained within a /// Geometry. Access to shape data, such as a box's size, is achieved /// through the shape accessors, such as const Box *BoxShape() const. - class IGNITION_SDFORMAT_VISIBLE Geometry + class SDFORMAT_VISIBLE Geometry { /// \brief Default constructor public: Geometry(); diff --git a/include/sdf/Gui.hh b/include/sdf/Gui.hh index 0684b5203..eec65d134 100644 --- a/include/sdf/Gui.hh +++ b/include/sdf/Gui.hh @@ -20,14 +20,14 @@ #include #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { // Inline bracket to help doxygen filtering. inline namespace SDF_VERSION_NAMESPACE { - class IGNITION_SDFORMAT_VISIBLE Gui + class SDFORMAT_VISIBLE Gui { /// \brief Default constructor public: Gui(); diff --git a/include/sdf/Heightmap.hh b/include/sdf/Heightmap.hh index 2600d0a9c..11a664b56 100644 --- a/include/sdf/Heightmap.hh +++ b/include/sdf/Heightmap.hh @@ -22,14 +22,14 @@ #include #include #include -#include +#include namespace sdf { // Inline bracket to help doxygen filtering. inline namespace SDF_VERSION_NAMESPACE { /// \brief Texture to be used on heightmaps. - class IGNITION_SDFORMAT_VISIBLE HeightmapTexture + class SDFORMAT_VISIBLE HeightmapTexture { /// \brief Constructor public: HeightmapTexture(); @@ -76,7 +76,7 @@ namespace sdf }; /// \brief Blend information to be used between textures on heightmaps. - class IGNITION_SDFORMAT_VISIBLE HeightmapBlend + class SDFORMAT_VISIBLE HeightmapBlend { /// \brief Constructor public: HeightmapBlend(); @@ -116,7 +116,7 @@ namespace sdf /// \brief Heightmap represents a shape defined by a 2D field, and is usually /// accessed through a Geometry. - class IGNITION_SDFORMAT_VISIBLE Heightmap + class SDFORMAT_VISIBLE Heightmap { /// \brief Constructor public: Heightmap(); diff --git a/include/sdf/Imu.hh b/include/sdf/Imu.hh index ab8556d29..85b690701 100644 --- a/include/sdf/Imu.hh +++ b/include/sdf/Imu.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { @@ -30,7 +30,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Imu contains information about an imu sensor. /// This sensor can be attached to a link. - class IGNITION_SDFORMAT_VISIBLE Imu + class SDFORMAT_VISIBLE Imu { /// \brief Default constructor public: Imu(); diff --git a/include/sdf/InterfaceElements.hh b/include/sdf/InterfaceElements.hh index 5134791db..a8debb7c4 100644 --- a/include/sdf/InterfaceElements.hh +++ b/include/sdf/InterfaceElements.hh @@ -27,8 +27,8 @@ #include "sdf/InterfaceModel.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -41,7 +41,7 @@ inline namespace SDF_VERSION_NAMESPACE #endif /// \brief Contains the necessary information about an included model file /// for custom model parsers to be able to find the file and parse it. -class IGNITION_SDFORMAT_VISIBLE NestedInclude +class SDFORMAT_VISIBLE NestedInclude { /// \brief Constructor public: NestedInclude(); diff --git a/include/sdf/InterfaceFrame.hh b/include/sdf/InterfaceFrame.hh index 07668ca38..4bd9a1882 100644 --- a/include/sdf/InterfaceFrame.hh +++ b/include/sdf/InterfaceFrame.hh @@ -23,15 +23,15 @@ #include #include -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { inline namespace SDF_VERSION_NAMESPACE { /// \brief Interface element representing an explicit frame -class IGNITION_SDFORMAT_VISIBLE InterfaceFrame +class SDFORMAT_VISIBLE InterfaceFrame { /// \brief Constructor /// \param[in] _name The *local* name. diff --git a/include/sdf/InterfaceJoint.hh b/include/sdf/InterfaceJoint.hh index a23637c35..2840929fd 100644 --- a/include/sdf/InterfaceJoint.hh +++ b/include/sdf/InterfaceJoint.hh @@ -23,15 +23,15 @@ #include #include -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { inline namespace SDF_VERSION_NAMESPACE { /// \brief Interface element representing a Joint -class IGNITION_SDFORMAT_VISIBLE InterfaceJoint +class SDFORMAT_VISIBLE InterfaceJoint { /// \brief Constructor /// \param[in] name The *local* name. diff --git a/include/sdf/InterfaceLink.hh b/include/sdf/InterfaceLink.hh index aeb07b8e7..35ccaea7d 100644 --- a/include/sdf/InterfaceLink.hh +++ b/include/sdf/InterfaceLink.hh @@ -23,15 +23,15 @@ #include #include -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { inline namespace SDF_VERSION_NAMESPACE { /// \brief Interface element representing a Link -class IGNITION_SDFORMAT_VISIBLE InterfaceLink +class SDFORMAT_VISIBLE InterfaceLink { /// \brief Constructor /// \param[in] name The *local* name. diff --git a/include/sdf/InterfaceModel.hh b/include/sdf/InterfaceModel.hh index 71c34933b..ef89bfaf8 100644 --- a/include/sdf/InterfaceModel.hh +++ b/include/sdf/InterfaceModel.hh @@ -32,8 +32,8 @@ #include "sdf/InterfaceModelPoseGraph.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -54,7 +54,7 @@ using RepostureFunction = std::function; /// \brief Interface element representing a Model -class IGNITION_SDFORMAT_VISIBLE InterfaceModel +class SDFORMAT_VISIBLE InterfaceModel { /// \brief Constructor /// \param[in] name The *local* name (no nesting, e.g. "::"). If this name diff --git a/include/sdf/InterfaceModelPoseGraph.hh b/include/sdf/InterfaceModelPoseGraph.hh index 3ac7bc060..1c1e84fd5 100644 --- a/include/sdf/InterfaceModelPoseGraph.hh +++ b/include/sdf/InterfaceModelPoseGraph.hh @@ -27,8 +27,8 @@ #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -41,7 +41,7 @@ template class ScopedGraph; /// \brief Class used in reposture callbacks of custom parsers to resolve poses. -class IGNITION_SDFORMAT_VISIBLE InterfaceModelPoseGraph +class SDFORMAT_VISIBLE InterfaceModelPoseGraph { /// \brief Resolve pose relative to world /// \param[out] _pose Resolved pose diff --git a/include/sdf/Joint.hh b/include/sdf/Joint.hh index 7fb76304f..fc1eabaa6 100644 --- a/include/sdf/Joint.hh +++ b/include/sdf/Joint.hh @@ -24,8 +24,8 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -82,7 +82,7 @@ namespace sdf UNIVERSAL = 9 }; - class IGNITION_SDFORMAT_VISIBLE Joint + class SDFORMAT_VISIBLE Joint { /// \brief Default constructor public: Joint(); diff --git a/include/sdf/JointAxis.hh b/include/sdf/JointAxis.hh index 054f9471e..d788d6f2d 100644 --- a/include/sdf/JointAxis.hh +++ b/include/sdf/JointAxis.hh @@ -24,8 +24,8 @@ #include "sdf/Element.hh" #include "sdf/Exception.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -39,7 +39,7 @@ namespace sdf /// \brief Parameters related to the axis of rotation for rotational joints, /// and the axis of translation for prismatic joints. - class IGNITION_SDFORMAT_VISIBLE JointAxis + class SDFORMAT_VISIBLE JointAxis { /// \brief Default constructor public: JointAxis(); diff --git a/include/sdf/Lidar.hh b/include/sdf/Lidar.hh index ae8835db3..1595fb8bd 100644 --- a/include/sdf/Lidar.hh +++ b/include/sdf/Lidar.hh @@ -23,7 +23,7 @@ #include #include #include -#include +#include namespace sdf @@ -102,7 +102,7 @@ namespace sdf /// /// /// ~~~ - class IGNITION_SDFORMAT_VISIBLE Lidar + class SDFORMAT_VISIBLE Lidar { /// \brief Default constructor public: Lidar(); diff --git a/include/sdf/Light.hh b/include/sdf/Light.hh index 921fb6184..11e5dceb8 100644 --- a/include/sdf/Light.hh +++ b/include/sdf/Light.hh @@ -26,8 +26,8 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -60,7 +60,7 @@ namespace sdf /// \brief Provides a description of a light source. A light source can be /// point, spot, or directional light. - class IGNITION_SDFORMAT_VISIBLE Light + class SDFORMAT_VISIBLE Light { /// \brief Default constructor public: Light(); diff --git a/include/sdf/Link.hh b/include/sdf/Link.hh index 6ad724900..97751166a 100644 --- a/include/sdf/Link.hh +++ b/include/sdf/Link.hh @@ -24,8 +24,8 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -42,7 +42,7 @@ namespace sdf struct PoseRelativeToGraph; template class ScopedGraph; - class IGNITION_SDFORMAT_VISIBLE Link + class SDFORMAT_VISIBLE Link { /// \brief Default constructor public: Link(); diff --git a/include/sdf/Magnetometer.hh b/include/sdf/Magnetometer.hh index c7073114d..642960dfe 100644 --- a/include/sdf/Magnetometer.hh +++ b/include/sdf/Magnetometer.hh @@ -21,7 +21,7 @@ #include #include #include -#include +#include namespace sdf { @@ -31,7 +31,7 @@ namespace sdf /// \brief Magnetometer contains information about a magnetometer sensor. /// This sensor can be attached to a link. - class IGNITION_SDFORMAT_VISIBLE Magnetometer + class SDFORMAT_VISIBLE Magnetometer { /// \brief Default constructor public: Magnetometer(); diff --git a/include/sdf/Material.hh b/include/sdf/Material.hh index 78514fc50..0e1b3b8f1 100644 --- a/include/sdf/Material.hh +++ b/include/sdf/Material.hh @@ -21,8 +21,8 @@ #include #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -42,7 +42,7 @@ namespace sdf }; /// \brief This class contains visual material properties. - class IGNITION_SDFORMAT_VISIBLE Material + class SDFORMAT_VISIBLE Material { /// \brief Default constructor public: Material(); diff --git a/include/sdf/Mesh.hh b/include/sdf/Mesh.hh index 88519550b..b75349200 100644 --- a/include/sdf/Mesh.hh +++ b/include/sdf/Mesh.hh @@ -22,7 +22,7 @@ #include #include #include -#include +#include namespace sdf { @@ -32,7 +32,7 @@ namespace sdf /// \brief Mesh represents a mesh shape, and is usually accessed through a /// Geometry. - class IGNITION_SDFORMAT_VISIBLE Mesh + class SDFORMAT_VISIBLE Mesh { /// \brief Constructor public: Mesh(); diff --git a/include/sdf/Model.hh b/include/sdf/Model.hh index e99ab6f86..8b1f7771c 100644 --- a/include/sdf/Model.hh +++ b/include/sdf/Model.hh @@ -25,8 +25,8 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -45,7 +45,7 @@ namespace sdf struct FrameAttachedToGraph; template class ScopedGraph; - class IGNITION_SDFORMAT_VISIBLE Model + class SDFORMAT_VISIBLE Model { /// \brief Default constructor public: Model(); diff --git a/include/sdf/NavSat.hh b/include/sdf/NavSat.hh index 19dd68f86..66b9b4b39 100644 --- a/include/sdf/NavSat.hh +++ b/include/sdf/NavSat.hh @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include @@ -72,7 +72,7 @@ namespace sdf /// /// /// ~~~ - class IGNITION_SDFORMAT_VISIBLE NavSat + class SDFORMAT_VISIBLE NavSat { /// \brief Default constructor public: NavSat(); diff --git a/include/sdf/Noise.hh b/include/sdf/Noise.hh index 7e97c37bf..c0d8382f8 100644 --- a/include/sdf/Noise.hh +++ b/include/sdf/Noise.hh @@ -20,7 +20,7 @@ #include #include #include -#include +#include namespace sdf { @@ -44,7 +44,7 @@ namespace sdf /// \brief The Noise class contains information about a noise /// model, such as a Gaussian distribution. A Noise DOM object is /// typically available from a Sensor. - class IGNITION_SDFORMAT_VISIBLE Noise + class SDFORMAT_VISIBLE Noise { /// \brief Default constructor public: Noise(); diff --git a/include/sdf/Param.hh b/include/sdf/Param.hh index cca5c3acd..2fc931a60 100644 --- a/include/sdf/Param.hh +++ b/include/sdf/Param.hh @@ -37,8 +37,8 @@ #include "sdf/Console.hh" #include "sdf/PrintConfig.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" #include "sdf/Types.hh" #ifdef _WIN32 @@ -54,11 +54,11 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { // - class IGNITION_SDFORMAT_VISIBLE Element; + class SDFORMAT_VISIBLE Element; using ElementPtr = std::shared_ptr; using ElementWeakPtr = std::weak_ptr; - class IGNITION_SDFORMAT_VISIBLE Param; + class SDFORMAT_VISIBLE Param; /// \def ParamPtr /// \brief Shared pointer to a Param @@ -113,7 +113,7 @@ namespace sdf /// \class Param Param.hh sdf/sdf.hh /// \brief A parameter class - class IGNITION_SDFORMAT_VISIBLE Param + class SDFORMAT_VISIBLE Param { /// \brief Constructor. /// \param[in] _key Key for the parameter. @@ -401,7 +401,7 @@ namespace sdf /// \param[in] _valueStr The value as a string /// \param[out] _valueToSet The value to set /// \return True if the value was successfully set, false otherwise - public: bool IGNITION_SDFORMAT_VISIBLE ValueFromStringImpl( + public: bool SDFORMAT_VISIBLE ValueFromStringImpl( const std::string &_typeName, const std::string &_valueStr, ParamVariant &_valueToSet) const; diff --git a/include/sdf/ParserConfig.hh b/include/sdf/ParserConfig.hh index 192bbbb6b..2850a2c0b 100644 --- a/include/sdf/ParserConfig.hh +++ b/include/sdf/ParserConfig.hh @@ -27,8 +27,8 @@ #include "sdf/Error.hh" #include "sdf/InterfaceElements.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf @@ -81,7 +81,7 @@ class ParserConfigPrivate; /// sdf::Root root; /// root.Load("path/to/file.sdf", config); /// \endcode -class IGNITION_SDFORMAT_VISIBLE ParserConfig +class SDFORMAT_VISIBLE ParserConfig { /// type alias for the map from URI scheme to search directories public: using SchemeToPathMap = diff --git a/include/sdf/ParticleEmitter.hh b/include/sdf/ParticleEmitter.hh index c6218c726..d15eaa639 100644 --- a/include/sdf/ParticleEmitter.hh +++ b/include/sdf/ParticleEmitter.hh @@ -25,8 +25,8 @@ #include "sdf/Material.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -57,7 +57,7 @@ namespace sdf /// \brief A description of a particle emitter, which can be attached /// to a link. A particle emitter can be used to describe fog, smoke, and /// dust. - class IGNITION_SDFORMAT_VISIBLE ParticleEmitter + class SDFORMAT_VISIBLE ParticleEmitter { /// \brief Default constructor public: ParticleEmitter(); diff --git a/include/sdf/Pbr.hh b/include/sdf/Pbr.hh index 00a233e0c..acc906dc8 100644 --- a/include/sdf/Pbr.hh +++ b/include/sdf/Pbr.hh @@ -21,8 +21,8 @@ #include #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -55,7 +55,7 @@ namespace sdf /// \brief This class contains Physically-Based-Rendering (PBR) workflow /// properties. - class IGNITION_SDFORMAT_VISIBLE PbrWorkflow + class SDFORMAT_VISIBLE PbrWorkflow { /// \brief Default constructor public: PbrWorkflow(); @@ -235,7 +235,7 @@ namespace sdf /// \brief This class provides access to Physically-Based-Rendering (PBR) /// material workflows. - class IGNITION_SDFORMAT_VISIBLE Pbr + class SDFORMAT_VISIBLE Pbr { /// \brief Default constructor public: Pbr(); diff --git a/include/sdf/Physics.hh b/include/sdf/Physics.hh index 063b98ff2..58331113b 100644 --- a/include/sdf/Physics.hh +++ b/include/sdf/Physics.hh @@ -22,8 +22,8 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -33,7 +33,7 @@ namespace sdf /// \brief The physics element specifies the type and properties of a /// dynamics engine. - class IGNITION_SDFORMAT_VISIBLE Physics + class SDFORMAT_VISIBLE Physics { /// \brief Default constructor public: Physics(); diff --git a/include/sdf/Plane.hh b/include/sdf/Plane.hh index 27c3778c8..c0ea5a4d7 100644 --- a/include/sdf/Plane.hh +++ b/include/sdf/Plane.hh @@ -23,7 +23,7 @@ #include #include #include -#include +#include namespace sdf { @@ -33,7 +33,7 @@ namespace sdf /// \brief Plane represents a plane shape, and is usually accessed through a /// Geometry. - class IGNITION_SDFORMAT_VISIBLE Plane + class SDFORMAT_VISIBLE Plane { /// \brief Constructor public: Plane(); diff --git a/include/sdf/PrintConfig.hh b/include/sdf/PrintConfig.hh index 93c148440..d9d3d507c 100644 --- a/include/sdf/PrintConfig.hh +++ b/include/sdf/PrintConfig.hh @@ -19,8 +19,8 @@ #include -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -28,7 +28,7 @@ inline namespace SDF_VERSION_NAMESPACE { /// This class contains configuration options for printing elements. -class IGNITION_SDFORMAT_VISIBLE PrintConfig +class SDFORMAT_VISIBLE PrintConfig { /// \brief Default constructor. public: PrintConfig(); diff --git a/include/sdf/Root.hh b/include/sdf/Root.hh index 81a424c95..415016041 100644 --- a/include/sdf/Root.hh +++ b/include/sdf/Root.hh @@ -22,8 +22,8 @@ #include "sdf/SDFImpl.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -51,7 +51,7 @@ namespace sdf /// /// \snippet examples/dom.cc rootUsage /// - class IGNITION_SDFORMAT_VISIBLE Root + class SDFORMAT_VISIBLE Root { /// \brief Default constructor public: Root(); diff --git a/include/sdf/SDFImpl.hh b/include/sdf/SDFImpl.hh index 3dd7c9ae7..864f971f6 100644 --- a/include/sdf/SDFImpl.hh +++ b/include/sdf/SDFImpl.hh @@ -26,8 +26,8 @@ #include "sdf/ParserConfig.hh" #include "sdf/PrintConfig.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" #ifdef _WIN32 // Disable warning C4251 which is triggered by @@ -44,7 +44,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { // - class IGNITION_SDFORMAT_VISIBLE SDF; + class SDFORMAT_VISIBLE SDF; class SDFPrivate; /// \def SDFPtr @@ -75,7 +75,7 @@ namespace sdf /// \param[in] _useCallback True to find a file based on a registered /// callback if the file is not found via the normal mechanism. /// \return File's full path. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE std::string findFile(const std::string &_filename, bool _searchLocalPath = true, bool _useCallback = false); @@ -93,7 +93,7 @@ namespace sdf /// callback if the file is not found via the normal mechanism. /// \param[in] _config Custom parser configuration /// \return File's full path. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE std::string findFile(const std::string &_filename, bool _searchLocalPath, bool _useCallback, @@ -104,18 +104,18 @@ namespace sdf /// Example paramters: "model://", "/usr/share/models:~/.gazebo/models" /// \param[in] _uri URI that will be mapped to _path /// \param[in] _path Colon separated set of paths. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE void addURIPath(const std::string &_uri, const std::string &_path); /// \brief Set the callback to use when SDF can't find a file. /// The callback should return a complete path to the requested file, or /// and empty string if the file was not found in the callback. /// \param[in] _cb The callback function. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE void setFindCallback(std::function _cb); /// \brief Base SDF class - class IGNITION_SDFORMAT_VISIBLE SDF + class SDFORMAT_VISIBLE SDF { public: SDF(); /// \brief Destructor diff --git a/include/sdf/Scene.hh b/include/sdf/Scene.hh index 4698b5722..2a137760c 100644 --- a/include/sdf/Scene.hh +++ b/include/sdf/Scene.hh @@ -23,14 +23,14 @@ #include "sdf/Element.hh" #include "sdf/Sky.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { // Inline bracket to help doxygen filtering. inline namespace SDF_VERSION_NAMESPACE { - class IGNITION_SDFORMAT_VISIBLE Scene + class SDFORMAT_VISIBLE Scene { /// \brief Default constructor public: Scene(); diff --git a/include/sdf/SemanticPose.hh b/include/sdf/SemanticPose.hh index 56f67d557..6692d8c04 100644 --- a/include/sdf/SemanticPose.hh +++ b/include/sdf/SemanticPose.hh @@ -24,8 +24,8 @@ #include #include -#include -#include "sdf/Export.hh" +#include +#include "sdf/system_util.hh" #ifdef _WIN32 // Disable warning C4251 which is triggered by @@ -51,7 +51,7 @@ namespace sdf /// The name of the default frame to resolve to must not be empty. /// This class only has a private constructor, and may only be accessed from /// its friend DOM classes. - class IGNITION_SDFORMAT_VISIBLE SemanticPose + class SDFORMAT_VISIBLE SemanticPose { /// \brief Get the raw Pose3 transform. /// \return The raw Pose3 transform. diff --git a/include/sdf/Sensor.hh b/include/sdf/Sensor.hh index 88ce7f614..f8ac4adcd 100644 --- a/include/sdf/Sensor.hh +++ b/include/sdf/Sensor.hh @@ -24,8 +24,8 @@ #include "sdf/Element.hh" #include "sdf/SemanticPose.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -129,7 +129,7 @@ namespace sdf }; /// \brief Information about an SDF sensor. - class IGNITION_SDFORMAT_VISIBLE Sensor + class SDFORMAT_VISIBLE Sensor { /// \brief Default constructor public: Sensor(); diff --git a/include/sdf/Sky.hh b/include/sdf/Sky.hh index d40179df9..cd76cfd47 100644 --- a/include/sdf/Sky.hh +++ b/include/sdf/Sky.hh @@ -23,14 +23,14 @@ #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { // Inline bracket to help doxygen filtering. inline namespace SDF_VERSION_NAMESPACE { - class IGNITION_SDFORMAT_VISIBLE Sky + class SDFORMAT_VISIBLE Sky { /// \brief Default constructor public: Sky(); diff --git a/include/sdf/Sphere.hh b/include/sdf/Sphere.hh index afe981141..10d91b897 100644 --- a/include/sdf/Sphere.hh +++ b/include/sdf/Sphere.hh @@ -22,7 +22,7 @@ #include #include -#include +#include namespace sdf { @@ -30,7 +30,7 @@ namespace sdf inline namespace SDF_VERSION_NAMESPACE { /// \brief Sphere represents a sphere shape, and is usually accessed through a /// Geometry. - class IGNITION_SDFORMAT_VISIBLE Sphere + class SDFORMAT_VISIBLE Sphere { /// \brief Constructor public: Sphere(); diff --git a/include/sdf/Surface.hh b/include/sdf/Surface.hh index da28f8dc3..dd39aea94 100644 --- a/include/sdf/Surface.hh +++ b/include/sdf/Surface.hh @@ -20,15 +20,15 @@ #include #include "sdf/Element.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { // Inline bracket to help doxygen filtering. inline namespace SDF_VERSION_NAMESPACE { /// \brief Contact information for a surface. - class IGNITION_SDFORMAT_VISIBLE Contact + class SDFORMAT_VISIBLE Contact { /// \brief Default constructor public: Contact(); @@ -59,7 +59,7 @@ namespace sdf }; /// \brief Surface information for a collision. - class IGNITION_SDFORMAT_VISIBLE Surface + class SDFORMAT_VISIBLE Surface { /// \brief Default constructor public: Surface(); diff --git a/include/sdf/Types.hh b/include/sdf/Types.hh index 36e3c905e..c0e964ced 100644 --- a/include/sdf/Types.hh +++ b/include/sdf/Types.hh @@ -25,8 +25,8 @@ #include #include -#include -#include "sdf/Export.hh" +#include +#include "sdf/system_util.hh" #include "sdf/Error.hh" #if defined(__GNUC__) || defined(__clang__) @@ -75,20 +75,20 @@ namespace sdf /// \param[in] str The string to split. /// \param[in] splitter The delimiter to use. /// \return A vector of strings containing the split tokens. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE std::vector split(const std::string &_str, const std::string &_splitter); /// \brief Trim leading and trailing whitespace from a string. /// \param[in] _in The string to trim. /// \return A string containing the trimmed value. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE std::string trim(const char *_in); /// \brief Trim leading and trailing whitespace from a string. /// \param[in] _in The string to trim. /// \return A string containing the trimmed value. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE std::string trim(const std::string &_in); /// \brief check if two values are equal, within a tolerance @@ -109,12 +109,12 @@ namespace sdf /// \param[in,out] _out The output stream. /// \param[in] _err The errors to output. /// \return Reference to the given output stream - IGNITION_SDFORMAT_VISIBLE std::ostream &operator<<( + SDFORMAT_VISIBLE std::ostream &operator<<( std::ostream &_out, const sdf::Errors &_errs); /// \brief A Time class, can be used to hold wall- or sim-time. /// stored as sec and nano-sec. - class IGNITION_SDFORMAT_VISIBLE Time + class SDFORMAT_VISIBLE Time { /// \brief Constructor public: Time() @@ -170,7 +170,7 @@ namespace sdf }; /// \brief A class for inertial information about a link. - class IGNITION_SDFORMAT_VISIBLE Inertia + class SDFORMAT_VISIBLE Inertia { public: double mass; }; @@ -178,13 +178,13 @@ namespace sdf /// \brief Transforms a string to its lowercase equivalent /// \param[in] _in String to convert to lowercase /// \return Lowercase equilvalent of _in. - std::string IGNITION_SDFORMAT_VISIBLE lowercase(const std::string &_in); + std::string SDFORMAT_VISIBLE lowercase(const std::string &_in); /// \brief Split a name into a two strings based on the '::' delimeter /// \param[in] _absoluteName The fully qualified absolute name /// \return A pair with the absolute name minus the leaf node name, and the /// leaf name - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE std::pair SplitName( const std::string &_absoluteName); @@ -193,7 +193,7 @@ namespace sdf /// \param[in] _scopeName the left-hand-side component /// \param[in] _localName the right-hand-side component /// \return A full string with the names joined by the '::' delimeter. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE std::string JoinName( const std::string &_scopeName, const std::string &_localName); } diff --git a/include/sdf/Visual.hh b/include/sdf/Visual.hh index 32de21226..fce9e6de2 100644 --- a/include/sdf/Visual.hh +++ b/include/sdf/Visual.hh @@ -29,8 +29,8 @@ #include "sdf/SemanticPose.hh" #include "sdf/Sphere.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -43,7 +43,7 @@ namespace sdf struct PoseRelativeToGraph; template class ScopedGraph; - class IGNITION_SDFORMAT_VISIBLE Visual + class SDFORMAT_VISIBLE Visual { /// \brief Default constructor public: Visual(); diff --git a/include/sdf/World.hh b/include/sdf/World.hh index be40603d5..b0d4d6515 100644 --- a/include/sdf/World.hh +++ b/include/sdf/World.hh @@ -29,8 +29,8 @@ #include "sdf/Gui.hh" #include "sdf/Scene.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" namespace sdf { @@ -51,7 +51,7 @@ namespace sdf struct FrameAttachedToGraph; template class ScopedGraph; - class IGNITION_SDFORMAT_VISIBLE World + class SDFORMAT_VISIBLE World { /// \brief Default constructor public: World(); diff --git a/include/sdf/parser.hh b/include/sdf/parser.hh index 67df552b8..920e6d3c2 100644 --- a/include/sdf/parser.hh +++ b/include/sdf/parser.hh @@ -20,8 +20,8 @@ #include #include "sdf/SDFImpl.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" /// \ingroup sdf_parser /// \brief namespace for Simulation Description Format parser @@ -43,14 +43,14 @@ namespace sdf /// \brief Initialize the SDF interface from the embedded root spec file /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool init(SDFPtr _sdf); /// \brief Initialize the SDF interface using a file /// \param[in] _filename Name of the SDF file /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool initFile(const std::string &_filename, SDFPtr _sdf); /// \brief Initialize the SDF interface using a file @@ -58,7 +58,7 @@ namespace sdf /// \param[in] _config Custom parser configuration /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool initFile( const std::string &_filename, const ParserConfig &_config, SDFPtr _sdf); @@ -66,7 +66,7 @@ namespace sdf /// \param[in] _filename Name of the SDF file /// \param[in] _sdf Pointer to an SDF Element object. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool initFile(const std::string &_filename, ElementPtr _sdf); /// \brief Initialize an SDFElement interface using a file @@ -74,7 +74,7 @@ namespace sdf /// \param[in] _config Custom parser configuration /// \param[out] _sdf Pointer to an SDF Element object. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool initFile(const std::string &_filename, const ParserConfig &_config, ElementPtr _sdf); @@ -82,7 +82,7 @@ namespace sdf /// \param[in] _xmlString XML string to be parsed. /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool initString(const std::string &_xmlString, SDFPtr _sdf); /// \brief Initialize the SDF interface using a string @@ -90,7 +90,7 @@ namespace sdf /// \param[in] _config Custom parser configuration /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool initString( const std::string &_xmlString, const ParserConfig &_config, SDFPtr _sdf); @@ -101,7 +101,7 @@ namespace sdf /// SDF version /// \param[in] _filename Name of the SDF file /// \return Populated SDF pointer. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE sdf::SDFPtr readFile(const std::string &_filename); /// \brief Populate the SDF values from a file @@ -112,7 +112,7 @@ namespace sdf /// \param[in] _filename Name of the SDF file /// \param[out] _errors Parsing errors will be appended to this variable. /// \return Populated SDF pointer. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE sdf::SDFPtr readFile(const std::string &_filename, Errors &_errors); /// \brief Populate the SDF values from a file @@ -124,7 +124,7 @@ namespace sdf /// \param[in] _config Custom parser configuration /// \param[out] _errors Parsing errors will be appended to this variable. /// \return Populated SDF pointer. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE sdf::SDFPtr readFile(const std::string &_filename, const ParserConfig &_config, Errors &_errors); @@ -137,7 +137,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readFile(const std::string &_filename, SDFPtr _sdf, Errors &_errors); /// \brief Populate the SDF values from a file @@ -150,7 +150,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readFile(const std::string &_filename, const ParserConfig &_config, SDFPtr _sdf, Errors &_errors); @@ -165,7 +165,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readFileWithoutConversion( const std::string &_filename, SDFPtr _sdf, Errors &_errors); @@ -181,7 +181,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readFileWithoutConversion(const std::string &_filename, const ParserConfig &_config, SDFPtr _sdf, Errors &_errors); @@ -193,7 +193,7 @@ namespace sdf /// \param[in] _filename Name of the SDF file /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readFile(const std::string &_filename, SDFPtr _sdf); /// \brief Populate the SDF values from a string @@ -205,7 +205,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, SDFPtr _sdf, Errors &_errors); /// \brief Populate the SDF values from a string @@ -218,7 +218,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, const ParserConfig &_config, SDFPtr _sdf, Errors &_errors); @@ -230,7 +230,7 @@ namespace sdf /// \param[in] _xmlString XML string to be parsed. /// \param[out] _sdf Pointer to an SDF object. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, SDFPtr _sdf); /// \brief Populate the SDF values from a string @@ -242,7 +242,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF Element object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, ElementPtr _sdf, Errors &_errors); @@ -256,7 +256,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF Element object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, const ParserConfig &_config, ElementPtr _sdf, Errors &_errors); @@ -271,7 +271,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readStringWithoutConversion( const std::string &_xmlString, SDFPtr _sdf, Errors &_errors); @@ -285,7 +285,7 @@ namespace sdf /// \param[out] _sdf Pointer to an SDF object. /// \param[out] _errors Parsing errors will be appended to this variable. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readStringWithoutConversion(const std::string &_xmlString, const ParserConfig &_config, SDFPtr _sdf, Errors &_errors); @@ -297,7 +297,7 @@ namespace sdf /// \param[in] _xmlString XML string to be parsed. /// \param[in] _sdf Pointer to an SDF Element object. /// \return True if successful. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool readString(const std::string &_xmlString, ElementPtr _sdf); /// \brief Get the file path to the model file @@ -305,7 +305,7 @@ namespace sdf /// \return string with the full filesystem path to the best version (greater /// SDF protocol supported by this sdformat version) of the .sdf /// model files hosted by _modelDirPath. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE std::string getModelFilePath(const std::string &_modelDirPath); /// \brief Convert an SDF file to a specific SDF version. @@ -313,7 +313,7 @@ namespace sdf /// \param[in] _version Version to convert _filename to. /// \param[out] _sdf Pointer to the converted SDF document. /// \return True on success. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool convertFile(const std::string &_filename, const std::string &_version, SDFPtr _sdf); @@ -323,7 +323,7 @@ namespace sdf /// \param[in] _config Custom parser configuration /// \param[out] _sdf Pointer to the converted SDF document. /// \return True on success. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool convertFile(const std::string &_filename, const std::string &_version, const ParserConfig &_config, SDFPtr _sdf); @@ -332,7 +332,7 @@ namespace sdf /// \param[in] _version Version to convert _filename to. /// \param[out] _sdf Pointer to the converted SDF document. /// \return True on success. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool convertString(const std::string &_sdfString, const std::string &_version, SDFPtr _sdf); @@ -342,7 +342,7 @@ namespace sdf /// \param[in] _config Custom parser configuration /// \param[out] _sdf Pointer to the converted SDF document. /// \return True on success. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool convertString(const std::string &_sdfString, const std::string &_version, const ParserConfig &_config, SDFPtr _sdf); @@ -353,7 +353,7 @@ namespace sdf /// rather than terminating early when the first error is found. /// \param[in] _root SDF Root object to check recursively. /// \return True if all models have valid canonical_link attributes. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool checkCanonicalLinkNames(const sdf::Root *_root); /// \brief For the world and each model, check that the attached_to graphs @@ -364,7 +364,7 @@ namespace sdf /// rather than terminating early when the first error is found. /// \param[in] _root SDF Root object to check recursively. /// \return True if all attached_to graphs are valid. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool checkFrameAttachedToGraph(const sdf::Root *_root); /// \brief Check that for each frame, the attached_to attribute value @@ -375,7 +375,7 @@ namespace sdf /// rather than terminating early when the first error is found. /// \param[in] _root SDF Root object to check recursively. /// \return True if all frames have valid attached_to attributes. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool checkFrameAttachedToNames(const sdf::Root *_root); /// \brief Check that all joints in contained models specify parent @@ -385,7 +385,7 @@ namespace sdf /// \param[in] _root SDF Root object to check recursively. /// \return True if all models have joints with valid parent and child /// link names. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool checkJointParentChildLinkNames(const sdf::Root *_root); /// \brief For the world and each model, check that the attached_to graphs @@ -396,7 +396,7 @@ namespace sdf /// rather than terminating early when the first error is found. /// \param[in] _root SDF Root object to check recursively. /// \return True if all attached_to graphs are valid. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool checkPoseRelativeToGraph(const sdf::Root *_root); /// \brief Check that all sibling elements of the same type have unique names. @@ -405,7 +405,7 @@ namespace sdf /// \param[in] _elem SDF Element to check recursively. /// \return True if all contained elements have do not share a name with /// sibling elements of the same type. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool recursiveSameTypeUniqueNames(sdf::ElementPtr _elem); /// \brief Check that all sibling elements of the any type have unique names. @@ -414,7 +414,7 @@ namespace sdf /// \param[in] _elem SDF Element to check recursively. /// \return True if all contained elements have do not share a name with /// sibling elements of any type. - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool recursiveSiblingUniqueNames(sdf::ElementPtr _elem); /// \brief Check that all sibling elements do not contain the delimiter @@ -424,7 +424,7 @@ namespace sdf /// containing '::' is found. /// \param[in] _elem SDF Element to check recursively. /// \return True if all contained element names do not have the delimiter '::' - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool recursiveSiblingNoDoubleColonInNames(sdf::ElementPtr _elem); /// \brief Check whether the element should be validated. If this returns @@ -432,7 +432,7 @@ namespace sdf /// skip this element and its descendants. /// \param[in] _elem SDF Element to check. /// \return True if the element should be validated - IGNITION_SDFORMAT_VISIBLE + SDFORMAT_VISIBLE bool shouldValidateElement(sdf::ElementPtr _elem); } } diff --git a/include/sdf/sdf.hh b/include/sdf/sdf.hh index 109d85c60..1421078c5 100644 --- a/include/sdf/sdf.hh +++ b/include/sdf/sdf.hh @@ -18,7 +18,8 @@ #ifndef SDF_SDF_HH_ #define SDF_SDF_HH_ -#pragma message("sdf/sdf.hh is deprecated, use sdformat.hh instead") +// TODO: deprecate this header? +// #pragma message("sdf/sdf.hh is deprecated, use sdformat.hh instead") #include diff --git a/include/sdf/sdf_config.h b/include/sdf/sdf_config.h index 20330d1e2..03798db07 100644 --- a/include/sdf/sdf_config.h +++ b/include/sdf/sdf_config.h @@ -18,7 +18,8 @@ #ifndef SDF_SDF_CONFIG_H_ #define SDF_SDF_CONFIG_H_ -#pragma message("sdf/sdf_config.h is deprecated, use sdf/config.hh instead") +// TODO: deprecate this header? +// #pragma message("sdf/sdf_config.h is deprecated, use sdf/config.hh instead") #include diff --git a/include/sdf/system_util.hh b/include/sdf/system_util.hh new file mode 100644 index 000000000..c2488dbb9 --- /dev/null +++ b/include/sdf/system_util.hh @@ -0,0 +1,47 @@ +/* + * Copyright 2013 Open Source Robotics Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +*/ +#ifndef SDF_VISIBLE_HH_ +#define SDF_VISIBLE_HH_ + +/** \def SDFORMAT_VISIBLE + * Use to represent "symbol visible" if supported + */ + +/** \def SDFORMAT_HIDDEN + * Use to represent "symbol hidden" if supported + */ + +#if defined _WIN32 || defined __CYGWIN__ + #ifdef BUILDING_SDFORMAT_SHARED + #define SDFORMAT_VISIBLE __declspec(dllexport) + #elif !defined SDFORMAT_STATIC_DEFINE + #define SDFORMAT_VISIBLE __declspec(dllimport) + #else + #define SDFORMAT_VISIBLE + #endif +#else + #if __GNUC__ >= 4 && !defined SDFORMAT_STATIC_DEFINE + #define SDFORMAT_VISIBLE __attribute__ ((visibility ("default"))) + #define SDFORMAT_HIDDEN __attribute__ ((visibility ("hidden"))) + #else + #define SDFORMAT_VISIBLE + #define SDFORMAT_HIDDEN + #endif +#endif + +// SDF_VISIBLE_HH_ +#endif diff --git a/src/Console.cc b/src/Console.cc index 14b9c4531..c0f4c4edd 100644 --- a/src/Console.cc +++ b/src/Console.cc @@ -24,7 +24,7 @@ #include "sdf/Console.hh" #include "sdf/Filesystem.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" +#include "sdf/sdf_config.h" using namespace sdf; diff --git a/src/Converter.hh b/src/Converter.hh index b0217d586..5c3badb17 100644 --- a/src/Converter.hh +++ b/src/Converter.hh @@ -22,8 +22,8 @@ #include #include -#include -#include "sdf/Export.hh" +#include +#include "sdf/system_util.hh" namespace sdf { diff --git a/src/Error_TEST.cc b/src/Error_TEST.cc index a177ec38e..5696039ec 100644 --- a/src/Error_TEST.cc +++ b/src/Error_TEST.cc @@ -17,7 +17,7 @@ #include #include -#include "sdf/config.hh" +#include "sdf/sdf_config.h" #include "sdf/Error.hh" ///////////////////////////////////////////////// diff --git a/src/FrameSemantics_TEST.cc b/src/FrameSemantics_TEST.cc index 7c5ead11f..16323c0b6 100644 --- a/src/FrameSemantics_TEST.cc +++ b/src/FrameSemantics_TEST.cc @@ -29,7 +29,7 @@ #include "sdf/SDFImpl.hh" #include "sdf/World.hh" #include "sdf/parser.hh" -#include "sdf/config.hh" +#include "sdf/sdf_config.h" #include "FrameSemantics.hh" #include "ScopedGraph.hh" diff --git a/src/ParamPassing.cc b/src/ParamPassing.cc index fdee035af..2e56dca73 100644 --- a/src/ParamPassing.cc +++ b/src/ParamPassing.cc @@ -20,7 +20,7 @@ #include "sdf/Filesystem.hh" #include "sdf/parser.hh" -#include "sdf/config.hh" +#include "sdf/sdf_config.h" #include "ParamPassing.hh" #include "parser_private.hh" diff --git a/src/ParamPassing.hh b/src/ParamPassing.hh index 33acf53d6..98994aea2 100644 --- a/src/ParamPassing.hh +++ b/src/ParamPassing.hh @@ -22,7 +22,7 @@ #include "sdf/ParserConfig.hh" #include "sdf/SDFImpl.hh" -#include "sdf/Export.hh" +#include "sdf/system_util.hh" namespace sdf { diff --git a/src/Root.cc b/src/Root.cc index 526e0967f..23b5379a1 100644 --- a/src/Root.cc +++ b/src/Root.cc @@ -27,7 +27,7 @@ #include "sdf/Types.hh" #include "sdf/World.hh" #include "sdf/parser.hh" -#include "sdf/config.hh" +#include "sdf/sdf_config.h" #include "FrameSemantics.hh" #include "ScopedGraph.hh" #include "Utils.hh" diff --git a/src/Root_TEST.cc b/src/Root_TEST.cc index 647d867ce..d687f6e2b 100644 --- a/src/Root_TEST.cc +++ b/src/Root_TEST.cc @@ -17,7 +17,7 @@ #include #include "sdf/Actor.hh" -#include "sdf/config.hh" +#include "sdf/sdf_config.h" #include "sdf/Collision.hh" #include "sdf/Error.hh" #include "sdf/Link.hh" diff --git a/src/SDF.cc b/src/SDF.cc index dd04f4e14..394bb0099 100644 --- a/src/SDF.cc +++ b/src/SDF.cc @@ -30,7 +30,7 @@ #include "sdf/Filesystem.hh" #include "sdf/SDFImpl.hh" #include "SDFImplPrivate.hh" -#include "sdf/config.hh" +#include "sdf/sdf_config.h" #include "EmbeddedSdf.hh" namespace sdf diff --git a/src/SDFExtension.hh b/src/SDFExtension.hh index 93cfe6a08..77bd032ac 100644 --- a/src/SDFExtension.hh +++ b/src/SDFExtension.hh @@ -26,7 +26,7 @@ #include -#include +#include #include "sdf/Types.hh" namespace sdf diff --git a/src/ScopedGraph.hh b/src/ScopedGraph.hh index f129da796..ff0d57be6 100644 --- a/src/ScopedGraph.hh +++ b/src/ScopedGraph.hh @@ -27,7 +27,7 @@ #include #include -#include "sdf/config.hh" +#include "sdf/sdf_config.h" namespace sdf { diff --git a/src/Surface.cc b/src/Surface.cc index 53ca2ced0..7e7283906 100644 --- a/src/Surface.cc +++ b/src/Surface.cc @@ -18,8 +18,8 @@ #include "sdf/Element.hh" #include "sdf/Surface.hh" #include "sdf/Types.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" using namespace sdf; diff --git a/src/ign.cc b/src/ign.cc index 86071a176..e046d6fc1 100644 --- a/src/ign.cc +++ b/src/ign.cc @@ -20,18 +20,18 @@ #include #include -#include "sdf/config.hh" +#include "sdf/sdf_config.h" #include "sdf/Filesystem.hh" #include "sdf/Root.hh" #include "sdf/parser.hh" -#include "sdf/Export.hh" +#include "sdf/system_util.hh" #include "FrameSemantics.hh" #include "ScopedGraph.hh" #include "ign.hh" ////////////////////////////////////////////////// -extern "C" IGNITION_SDFORMAT_VISIBLE int cmdCheck(const char *_path) +extern "C" SDFORMAT_VISIBLE int cmdCheck(const char *_path) { int result = 0; @@ -99,7 +99,7 @@ extern "C" IGNITION_SDFORMAT_VISIBLE int cmdCheck(const char *_path) } ////////////////////////////////////////////////// -extern "C" IGNITION_SDFORMAT_VISIBLE char *ignitionVersion() +extern "C" SDFORMAT_VISIBLE char *ignitionVersion() { #ifdef _MSC_VER return _strdup(SDF_VERSION_FULL); @@ -111,7 +111,7 @@ extern "C" IGNITION_SDFORMAT_VISIBLE char *ignitionVersion() ////////////////////////////////////////////////// /// \brief Print the full description of the SDF spec. /// \return 0 on success, -1 if SDF could not be initialized. -extern "C" IGNITION_SDFORMAT_VISIBLE int cmdDescribe(const char *_version) +extern "C" SDFORMAT_VISIBLE int cmdDescribe(const char *_version) { sdf::SDFPtr sdf(new sdf::SDF()); @@ -131,7 +131,7 @@ extern "C" IGNITION_SDFORMAT_VISIBLE int cmdDescribe(const char *_version) } ////////////////////////////////////////////////// -extern "C" IGNITION_SDFORMAT_VISIBLE int cmdPrint(const char *_path) +extern "C" SDFORMAT_VISIBLE int cmdPrint(const char *_path) { if (!sdf::filesystem::exists(_path)) { @@ -160,7 +160,7 @@ extern "C" IGNITION_SDFORMAT_VISIBLE int cmdPrint(const char *_path) ////////////////////////////////////////////////// // cppcheck-suppress unusedFunction -extern "C" IGNITION_SDFORMAT_VISIBLE int cmdGraph( +extern "C" SDFORMAT_VISIBLE int cmdGraph( const char *_graphType, const char *_path) { if (!sdf::filesystem::exists(_path)) diff --git a/src/ign.hh b/src/ign.hh index f534ae35b..3db17a72a 100644 --- a/src/ign.hh +++ b/src/ign.hh @@ -20,8 +20,8 @@ #include -#include -#include "sdf/Export.hh" +#include +#include "sdf/system_util.hh" // Inline bracket to help doxygen filtering. inline namespace SDF_VERSION_NAMESPACE { @@ -30,11 +30,11 @@ inline namespace SDF_VERSION_NAMESPACE { /// \brief External hook to execute 'ign sdf -k' from the command line. /// \param[in] _path Path to the file to validate. /// \return Zero on success, negative one otherwise. -extern "C" IGNITION_SDFORMAT_VISIBLE int cmdCheck(const char *_path); +extern "C" SDFORMAT_VISIBLE int cmdCheck(const char *_path); /// \brief External hook to read the library version. /// \return C-string representing the version. Ex.: 0.1.2 -extern "C" IGNITION_SDFORMAT_VISIBLE char *ignitionVersion(); +extern "C" SDFORMAT_VISIBLE char *ignitionVersion(); } #endif diff --git a/src/ign_TEST.cc b/src/ign_TEST.cc index cca55d604..f1d269ecf 100644 --- a/src/ign_TEST.cc +++ b/src/ign_TEST.cc @@ -24,7 +24,7 @@ #include "sdf/parser.hh" #include "sdf/SDFImpl.hh" -#include "sdf/config.hh" +#include "sdf/sdf_config.h" #include "test_config.h" #ifdef _WIN32 diff --git a/src/parser.cc b/src/parser.cc index 3ff3ad508..5f29f93d9 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -36,7 +36,7 @@ #include "sdf/World.hh" #include "sdf/parser.hh" #include "sdf/ParserConfig.hh" -#include "sdf/config.hh" +#include "sdf/sdf_config.h" #include "Converter.hh" #include "FrameSemantics.hh" diff --git a/src/parser_private.hh b/src/parser_private.hh index a9efe25a5..c1b8d963f 100644 --- a/src/parser_private.hh +++ b/src/parser_private.hh @@ -22,8 +22,8 @@ #include #include "sdf/SDFImpl.hh" -#include "sdf/config.hh" -#include "sdf/Export.hh" +#include "sdf/sdf_config.h" +#include "sdf/system_util.hh" /// \ingroup sdf_parser /// \brief namespace for Simulation Description Format parser diff --git a/src/parser_urdf.cc b/src/parser_urdf.cc index b18c61106..851a367b3 100644 --- a/src/parser_urdf.cc +++ b/src/parser_urdf.cc @@ -31,7 +31,7 @@ #include #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "XmlUtils.hh" #include "SDFExtension.hh" diff --git a/src/parser_urdf.hh b/src/parser_urdf.hh index 9bd9ae4b3..8f703169c 100644 --- a/src/parser_urdf.hh +++ b/src/parser_urdf.hh @@ -18,13 +18,13 @@ #define SDFORMAT_URDF2SDF_HH_ #include -#include +#include #include #include "sdf/Console.hh" #include "sdf/Types.hh" -#include "sdf/Export.hh" +#include "sdf/system_util.hh" namespace sdf { diff --git a/src/parser_urdf_TEST.cc b/src/parser_urdf_TEST.cc index 74df38a89..cf65e1845 100644 --- a/src/parser_urdf_TEST.cc +++ b/src/parser_urdf_TEST.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "parser_urdf.hh" ///////////////////////////////////////////////// From 8b658444f9a59b5e8525098af5e388f6be377787 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 1 Dec 2021 10:26:43 +0800 Subject: [PATCH 23/29] remove unnecessary configure_file Signed-off-by: Teo Koon Peng --- include/sdf/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/sdf/CMakeLists.txt b/include/sdf/CMakeLists.txt index 44ea96d43..94f57dcfe 100644 --- a/include/sdf/CMakeLists.txt +++ b/include/sdf/CMakeLists.txt @@ -1,6 +1,3 @@ -configure_file(config.hh.in - include/sdf/config.hh) - # Exlcude some files so that they are not added to the master header. ign_install_all_headers(EXCLUDE_FILES sdf.hh sdf_config.h) install( From 4c37d731b90d89d0af5ba7a62427948632821c8b Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 1 Dec 2021 10:30:35 +0800 Subject: [PATCH 24/29] remove header changes in tests Signed-off-by: Teo Koon Peng --- test/integration/audio.cc | 2 +- test/integration/category_bitmask.cc | 2 +- test/integration/cfm_damping_implicit_spring_damper.cc | 2 +- test/integration/converter.cc | 2 +- test/integration/disable_fixed_joint_reduction.cc | 2 +- test/integration/element_memory_leak.cc | 2 +- test/integration/fixed_joint_reduction.cc | 2 +- test/integration/force_torque_sensor.cc | 2 +- test/integration/frame.cc | 2 +- test/integration/include.cc | 2 +- test/integration/joint_axis_frame.cc | 2 +- test/integration/link_light.cc | 2 +- test/integration/locale_fix.cc | 2 +- test/integration/locale_fix_cxx.cc | 2 +- test/integration/material.cc | 2 +- test/integration/material_pbr.cc | 2 +- test/integration/model_versions.cc | 2 +- test/integration/nested_model.cc | 2 +- test/integration/parser_error_detection.cc | 2 +- test/integration/plugin_attribute.cc | 2 +- test/integration/plugin_bool.cc | 2 +- test/integration/plugin_include.cc | 2 +- test/integration/provide_feedback.cc | 2 +- test/integration/schema_test.cc | 2 +- test/integration/sdf_basic.cc | 2 +- test/integration/sdf_custom.cc | 2 +- test/integration/unknown.cc | 2 +- test/integration/urdf_gazebo_extensions.cc | 2 +- test/integration/urdf_joint_parameters.cc | 2 +- test/performance/parser_urdf.cc | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/test/integration/audio.cc b/test/integration/audio.cc index e5c174d22..57a5bd642 100644 --- a/test/integration/audio.cc +++ b/test/integration/audio.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/category_bitmask.cc b/test/integration/category_bitmask.cc index 33d1f0e76..e983631b3 100644 --- a/test/integration/category_bitmask.cc +++ b/test/integration/category_bitmask.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" ///////////////////////////////////////////////// TEST(CategoryBitmask, WasSpecified) diff --git a/test/integration/cfm_damping_implicit_spring_damper.cc b/test/integration/cfm_damping_implicit_spring_damper.cc index d1eac2cf1..5112e1366 100644 --- a/test/integration/cfm_damping_implicit_spring_damper.cc +++ b/test/integration/cfm_damping_implicit_spring_damper.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/converter.cc b/test/integration/converter.cc index f0aaec46f..2f52019e8 100644 --- a/test/integration/converter.cc +++ b/test/integration/converter.cc @@ -20,7 +20,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/disable_fixed_joint_reduction.cc b/test/integration/disable_fixed_joint_reduction.cc index fffb5d8bd..8d4cd7f4a 100644 --- a/test/integration/disable_fixed_joint_reduction.cc +++ b/test/integration/disable_fixed_joint_reduction.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/element_memory_leak.cc b/test/integration/element_memory_leak.cc index e98acde10..9632f13f8 100644 --- a/test/integration/element_memory_leak.cc +++ b/test/integration/element_memory_leak.cc @@ -20,7 +20,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/fixed_joint_reduction.cc b/test/integration/fixed_joint_reduction.cc index e444a6525..0475db78b 100644 --- a/test/integration/fixed_joint_reduction.cc +++ b/test/integration/fixed_joint_reduction.cc @@ -20,7 +20,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/force_torque_sensor.cc b/test/integration/force_torque_sensor.cc index 018cdaabb..f5e2f18b9 100644 --- a/test/integration/force_torque_sensor.cc +++ b/test/integration/force_torque_sensor.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/frame.cc b/test/integration/frame.cc index 73fd42611..a1fd535a5 100644 --- a/test/integration/frame.cc +++ b/test/integration/frame.cc @@ -30,7 +30,7 @@ #include "sdf/SDFImpl.hh" #include "sdf/World.hh" #include "sdf/parser.hh" -#include "sdf/config.hh" +#include "sdf/sdf_config.h" #include "test_config.h" diff --git a/test/integration/include.cc b/test/integration/include.cc index 285a8a777..02b1f2b8e 100644 --- a/test/integration/include.cc +++ b/test/integration/include.cc @@ -20,7 +20,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/joint_axis_frame.cc b/test/integration/joint_axis_frame.cc index dc2a9f375..31b54bdb6 100644 --- a/test/integration/joint_axis_frame.cc +++ b/test/integration/joint_axis_frame.cc @@ -20,7 +20,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" std::string get_sdf_string(const std::string &_version) { diff --git a/test/integration/link_light.cc b/test/integration/link_light.cc index 979a56185..b4dc6d916 100644 --- a/test/integration/link_light.cc +++ b/test/integration/link_light.cc @@ -18,7 +18,7 @@ #include #include #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/locale_fix.cc b/test/integration/locale_fix.cc index dc001569f..bb2cbd323 100644 --- a/test/integration/locale_fix.cc +++ b/test/integration/locale_fix.cc @@ -20,7 +20,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/locale_fix_cxx.cc b/test/integration/locale_fix_cxx.cc index 4c0e01f24..f2fbd20df 100644 --- a/test/integration/locale_fix_cxx.cc +++ b/test/integration/locale_fix_cxx.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" TEST(CheckFixForLocal, CheckFixForCxxLocal) { diff --git a/test/integration/material.cc b/test/integration/material.cc index aecd1bcb4..ff872e067 100644 --- a/test/integration/material.cc +++ b/test/integration/material.cc @@ -20,7 +20,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" void ExpectInvalidWithMessage(sdf::Errors &_errors, std::string _compType) diff --git a/test/integration/material_pbr.cc b/test/integration/material_pbr.cc index 635d38279..067b70807 100644 --- a/test/integration/material_pbr.cc +++ b/test/integration/material_pbr.cc @@ -17,7 +17,7 @@ #include #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "sdf/Pbr.hh" #include "test_config.h" diff --git a/test/integration/model_versions.cc b/test/integration/model_versions.cc index 33540b7c3..a091a598b 100644 --- a/test/integration/model_versions.cc +++ b/test/integration/model_versions.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/nested_model.cc b/test/integration/nested_model.cc index 722b252cc..904115114 100644 --- a/test/integration/nested_model.cc +++ b/test/integration/nested_model.cc @@ -23,7 +23,7 @@ #include #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/parser_error_detection.cc b/test/integration/parser_error_detection.cc index 0e750956d..3d6fc752f 100644 --- a/test/integration/parser_error_detection.cc +++ b/test/integration/parser_error_detection.cc @@ -20,7 +20,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" std::string get_sdf_string() { diff --git a/test/integration/plugin_attribute.cc b/test/integration/plugin_attribute.cc index 000512bff..02af21046 100644 --- a/test/integration/plugin_attribute.cc +++ b/test/integration/plugin_attribute.cc @@ -20,7 +20,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" std::string get_sdf_string() { diff --git a/test/integration/plugin_bool.cc b/test/integration/plugin_bool.cc index 88684cb15..55139b2a7 100644 --- a/test/integration/plugin_bool.cc +++ b/test/integration/plugin_bool.cc @@ -20,7 +20,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" std::string get_sdf_string() { diff --git a/test/integration/plugin_include.cc b/test/integration/plugin_include.cc index e6234a3b1..4ad0420bc 100644 --- a/test/integration/plugin_include.cc +++ b/test/integration/plugin_include.cc @@ -17,7 +17,7 @@ #include #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/provide_feedback.cc b/test/integration/provide_feedback.cc index a200c329b..582a39c3f 100644 --- a/test/integration/provide_feedback.cc +++ b/test/integration/provide_feedback.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/schema_test.cc b/test/integration/schema_test.cc index a53807b28..999fef8cb 100644 --- a/test/integration/schema_test.cc +++ b/test/integration/schema_test.cc @@ -21,7 +21,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/sdf_basic.cc b/test/integration/sdf_basic.cc index a4f5e674c..6ea82b44c 100644 --- a/test/integration/sdf_basic.cc +++ b/test/integration/sdf_basic.cc @@ -16,7 +16,7 @@ */ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/sdf_custom.cc b/test/integration/sdf_custom.cc index 9898b952c..2b29d4f67 100644 --- a/test/integration/sdf_custom.cc +++ b/test/integration/sdf_custom.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/unknown.cc b/test/integration/unknown.cc index f3b64a780..35ade31b6 100644 --- a/test/integration/unknown.cc +++ b/test/integration/unknown.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "sdf/Error.hh" #include "test_config.h" diff --git a/test/integration/urdf_gazebo_extensions.cc b/test/integration/urdf_gazebo_extensions.cc index 552a97408..df7a53b33 100644 --- a/test/integration/urdf_gazebo_extensions.cc +++ b/test/integration/urdf_gazebo_extensions.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/integration/urdf_joint_parameters.cc b/test/integration/urdf_joint_parameters.cc index dfb36f481..e6ae97d87 100644 --- a/test/integration/urdf_joint_parameters.cc +++ b/test/integration/urdf_joint_parameters.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" diff --git a/test/performance/parser_urdf.cc b/test/performance/parser_urdf.cc index cb3a5df08..d19d230e9 100644 --- a/test/performance/parser_urdf.cc +++ b/test/performance/parser_urdf.cc @@ -19,7 +19,7 @@ #include -#include "sdformat.hh" +#include "sdf/sdf.hh" #include "test_config.h" From ce47b3ac3708bedc300d5002a0cf37693cf7bb82 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 1 Dec 2021 10:34:36 +0800 Subject: [PATCH 25/29] remove unused template Signed-off-by: Teo Koon Peng --- cmake/sdf_config.h.in | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 cmake/sdf_config.h.in diff --git a/cmake/sdf_config.h.in b/cmake/sdf_config.h.in deleted file mode 100644 index 17351e009..000000000 --- a/cmake/sdf_config.h.in +++ /dev/null @@ -1,36 +0,0 @@ -/* config.h. Generated by CMake for @PROJECT_NAME@. */ - -/* Protocol version */ -#define SDF_PROTOCOL_VERSION "${SDF_PROTOCOL_VERSION}" -/* \deprecated SDF_VERSION is deprecated. Please - * use SDF_PROTOCOL_VERSION or SDF_PKG_VERSION - * - * SDF_VERSION is here to keep backwards compatibility. It was used - * when the package version and protocol version were the same - */ -#define SDF_VERSION "${SDF_PROTOCOL_VERSION}" - -/* Package version number */ -#define SDF_MAJOR_VERSION ${SDF_MAJOR_VERSION} -#define SDF_MINOR_VERSION ${SDF_MINOR_VERSION} -#define SDF_PATCH_VERSION ${SDF_PATCH_VERSION} - -#define SDF_MAJOR_VERSION_STR "${SDF_MAJOR_VERSION}" -#define SDF_MINOR_VERSION_STR "${SDF_MINOR_VERSION}" -#define SDF_PATCH_VERSION_STR "${SDF_PATCH_VERSION}" - -#define SDF_PKG_VERSION "${SDF_VERSION}" -#define SDF_VERSION_FULL "${SDF_VERSION_FULL}" -#define SDF_VERSION_NAMESPACE v${SDF_MAJOR_VERSION} - -#define SDF_VERSION_HEADER "Simulation Description Format (SDF), version ${SDF_PROTOCOL_VERSION}\nCopyright (C) 2014 Open Source Robotics Foundation.\nReleased under the Apache 2 License.\nhttp://gazebosim.org/sdf\n\n" - -#cmakedefine BUILD_TYPE_PROFILE 1 -#cmakedefine BUILD_TYPE_DEBUG 1 -#cmakedefine BUILD_TYPE_RELEASE 1 -#cmakedefine HAVE_URDFDOM 1 -#cmakedefine USE_INTERNAL_URDF 1 -#cmakedefine SDFORMAT_DISABLE_CONSOLE_LOGFILE 1 - -#define SDF_SHARE_PATH "${CMAKE_INSTALL_FULL_DATAROOTDIR}/" -#define SDF_VERSION_PATH "${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/${SDF_PKG_VERSION}" From f13f12cb05a5035e05713f64c150f447b60bca4d Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 1 Dec 2021 11:57:50 +0800 Subject: [PATCH 26/29] add header guards Signed-off-by: Teo Koon Peng --- include/sdf/config.hh.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/sdf/config.hh.in b/include/sdf/config.hh.in index 6c3bc1514..24534394a 100644 --- a/include/sdf/config.hh.in +++ b/include/sdf/config.hh.in @@ -1,5 +1,8 @@ /* config.h. Generated by CMake for @PROJECT_NAME@. */ +#ifndef SDF_CONFIG_HH_ +#define SDF_CONFIG_HH_ + /* Protocol version */ #define SDF_PROTOCOL_VERSION "${SDF_PROTOCOL_VERSION}" /* \deprecated SDF_VERSION is deprecated. Please @@ -35,3 +38,5 @@ #define SDF_SHARE_PATH "${CMAKE_INSTALL_FULL_DATAROOTDIR}/" #define SDF_VERSION_PATH "${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${PROJECT_VERSION_MAJOR}" + +#endif // SDF_CONFIG_HH_ From 4ec8bd4ca86643d76e08e56587667604a0e5191a Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Tue, 7 Dec 2021 09:13:12 +0800 Subject: [PATCH 27/29] Update conf/CMakeLists.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alejandro Hernández Cordero Signed-off-by: Teo Koon Peng --- conf/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/CMakeLists.txt b/conf/CMakeLists.txt index fd3b6d278..388c30cc1 100644 --- a/conf/CMakeLists.txt +++ b/conf/CMakeLists.txt @@ -15,7 +15,7 @@ set(ign_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${PROJECT_NAM # Note that the major version of the library is included in the name. # Ex: sdformat0.yaml configure_file( - "${PROJECT_NAME_NO_VERSION_LOWER}.yaml.in" + "${CMAKE_SOURCE_DIR}/conf/${PROJECT_NAME_NO_VERSION_LOWER}.yaml.in" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.yaml" @ONLY) # Install the yaml configuration files in an unversioned location. From d6aa259e14d8b1ce4ea80ad72f729ed1f0c84588 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Tue, 7 Dec 2021 09:13:21 +0800 Subject: [PATCH 28/29] Update src/cmd/CMakeLists.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alejandro Hernández Cordero Signed-off-by: Teo Koon Peng --- src/cmd/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index e831d413a..6342379ca 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -10,7 +10,7 @@ set(cmd_script_configured_test "${cmd_script_generated_test}.configured") set(library_location "$") configure_file( - "cmd${PROJECT_NAME_NO_VERSION_LOWER}.rb.in" + "${CMAKE_SOURCE_DIR}/src/cmd/cmd${PROJECT_NAME_NO_VERSION_LOWER}.rb.in" "${cmd_script_configured_test}" @ONLY) From d1144d4ba3a7f0e50722116a414e5d5008ebf768 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Tue, 7 Dec 2021 09:15:48 +0800 Subject: [PATCH 29/29] revert header change Signed-off-by: Teo Koon Peng --- examples/simple.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/simple.cc b/examples/simple.cc index 6dff97dfc..bf94bf461 100644 --- a/examples/simple.cc +++ b/examples/simple.cc @@ -15,7 +15,7 @@ * */ #include -#include +#include int main(int argc, char **argv) {