diff --git a/cmake/GzExport.hh.in b/cmake/GzExport.hh.in new file mode 100644 index 00000000..00d8794d --- /dev/null +++ b/cmake/GzExport.hh.in @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2017 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 file was automatically generated by CMake; do not modify it directly. + * To modify this file, make changes to ign-cmake/cmake/Export.hh.in + * ========================================================================== +*/ + +#ifndef @export_base@_EXPORT_HH_ +#define @export_base@_EXPORT_HH_ + +// The detail/Export.hh header is automatically generated by CMake, which only +// provides the system-dependent implementations of these macros, with no +// commentary or explanation, so we configure this public-facing header which +// leverages the auto-generated macros but provides commentary for them. +#include "@include_dir@/detail/Export.hh" + +// TODO(CH3): Remove this and this file (GzExport.hh.in) on tock +// This is to allow for ignition- and gz- targets for the same lib to be found +// together. (To support aliasing and ign -> gz ticktocking +#include "@include_dir@/detail/GzExport.hh" + + +#ifndef @export_base@_VISIBLE +/// For @lib_name@ developers: Apply this macro to @lib_name@ +/// functions and classes which consumers of this library will need to be able +/// to call from their own programs or libraries. +#define @export_base@_VISIBLE \ + DETAIL_@export_base@_VISIBLE +#endif + + +#ifndef @export_base@_HIDDEN +/// For @lib_name@ developers: Apply this macro to @lib_name@ +/// functions and classes which must not be used by consumers of this library. +/// By default, this property is applied to all classes and functions which are +/// not tagged with @export_base@_VISIBLE, so this does not +/// generally need to be used. +#define @export_base@_HIDDEN \ + DETAIL_@export_base@_HIDDEN +#endif + + +#ifndef IGN_DEPRECATED +/// For @lib_name@ developers: Use this macro to indicate that a +/// function or class has been deprecated and should no longer be used. A +/// version should be specified to provide context to the user about when the +/// function became deprecated. +#define IGN_DEPRECATED(version) IGN_DEPRECATED_ALL_VERSIONS +#endif + +#endif diff --git a/cmake/IgnUtils.cmake b/cmake/IgnUtils.cmake index 1237813d..05e3d74a 100644 --- a/cmake/IgnUtils.cmake +++ b/cmake/IgnUtils.cmake @@ -1033,13 +1033,6 @@ function(ign_create_core_library) # Support "gz-" if(${PROJECT_LIBRARY_TARGET_NAME} MATCHES "^gz-") - _ign_add_library_or_component( - LIB_NAME ${PROJECT_LIBRARY_TARGET_NAME} - INCLUDE_DIR "${PROJECT_INCLUDE_DIR}" - EXPORT_BASE GZ_${IGN_DESIGNATION_UPPER} - SOURCES ${sources} - ${interface_option}) - # For ticktocking: Export an "ignition-" target as well, allowing linking against # the ignition- prefixed name # TODO(CH3): To remove on tock @@ -1072,6 +1065,12 @@ function(ign_create_core_library) set(project_pkgconfig_core_lib "-l${IGN_PROJECT_NAME_LOWER}") endif() + _ign_add_library_or_component( + LIB_NAME ${PROJECT_LIBRARY_TARGET_NAME} + INCLUDE_DIR "${PROJECT_INCLUDE_DIR}" + EXPORT_BASE IGNITION_${IGN_DESIGNATION_UPPER} + SOURCES ${sources} + ${interface_option}) else() _ign_add_library_or_component( LIB_NAME ${PROJECT_LIBRARY_TARGET_NAME} @@ -1590,7 +1589,6 @@ macro(_ign_add_library_or_component) #------------------------------------ # Configure the installation of the target - install( TARGETS ${lib_name} EXPORT ${lib_name}