Skip to content

Commit

Permalink
Rename CMake project to gz
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina committed Jun 7, 2022
1 parent 946a27a commit b077e27
Show file tree
Hide file tree
Showing 42 changed files with 210 additions and 210 deletions.
30 changes: 15 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(ignition-cmake3 VERSION 3.0.0)
project(gz-cmake3 VERSION 3.0.0)

#--------------------------------------
# Initialize the IGNITION_CMAKE_DIR variable with the location of the cmake
Expand Down Expand Up @@ -54,12 +54,12 @@ install(DIRECTORY tools/

#--------------------------------------
# Create configuration and installation variables
set(ign_config_input "${CMAKE_CURRENT_SOURCE_DIR}/config/ignition-cmake-config.cmake.in")
set(ign_config_output "${PROJECT_NAME_LOWER}-config.cmake")
set(ign_version_output "${PROJECT_NAME_LOWER}-config-version.cmake")
set(ign_config_install_dir "${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME_LOWER}")
set(gz_config_input "${CMAKE_CURRENT_SOURCE_DIR}/config/ignition-cmake-config.cmake.in")
set(gz_config_output "${PROJECT_NAME_LOWER}-config.cmake")
set(gz_version_output "${PROJECT_NAME_LOWER}-config-version.cmake")
set(gz_config_install_dir "${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME_LOWER}")
set(ign_pkgconfig_input "${CMAKE_CURRENT_SOURCE_DIR}/config/ignition-cmake.pc.in")
set(ign_pkgconfig_output "${CMAKE_BINARY_DIR}/ignition-cmake${PROJECT_VERSION_MAJOR}.pc")
set(ign_pkgconfig_output "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc")
set(ign_pkgconfig_install_dir "${IGN_LIB_INSTALL_DIR}/pkgconfig")
set(ign_utilities_target ${PROJECT_EXPORT_NAME}-utilities)
set(ign_utilities_import_target_name ${PROJECT_EXPORT_NAME}::${ign_utilities_target})
Expand All @@ -69,24 +69,24 @@ set(simple_utilities_import_name ${PROJECT_EXPORT_NAME}::utilities)
#--------------------------------------
# Configure and install the config file
configure_package_config_file(
${ign_config_input}
${ign_config_output}
INSTALL_DESTINATION ${ign_config_install_dir}
${gz_config_input}
${gz_config_output}
INSTALL_DESTINATION ${gz_config_install_dir}
PATH_VARS IGN_DATA_INSTALL_DIR
NO_CHECK_REQUIRED_COMPONENTS_MACRO)

#--------------------------------------
# Configure and install the version file
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${ign_version_output}
${CMAKE_CURRENT_BINARY_DIR}/${gz_version_output}
VERSION "${PROJECT_VERSION_FULL_NO_SUFFIX}"
COMPATIBILITY SameMajorVersion)

install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/${ign_config_output}
${CMAKE_CURRENT_BINARY_DIR}/${ign_version_output}
DESTINATION ${ign_config_install_dir}
${CMAKE_CURRENT_BINARY_DIR}/${gz_config_output}
${CMAKE_CURRENT_BINARY_DIR}/${gz_version_output}
DESTINATION ${gz_config_install_dir}
COMPONENT cmake)

#--------------------------------------
Expand Down Expand Up @@ -127,7 +127,7 @@ export(

install(
EXPORT ${ign_utilities_target}
DESTINATION ${ign_config_install_dir}
DESTINATION ${gz_config_install_dir}
FILE ${ign_utilities_target_output_filename}
NAMESPACE ${PROJECT_EXPORT_NAME}::)

Expand All @@ -141,7 +141,7 @@ install(
#============================================================================
# Install the files for this package
#============================================================================
set(ign_modules_install_dir "${ign_config_install_dir}/cmake${PROJECT_VERSION_MAJOR}")
set(ign_modules_install_dir "${gz_config_install_dir}/cmake${PROJECT_VERSION_MAJOR}")

file(GLOB modules "cmake/*.cmake")
file(GLOB templates "cmake/*.in")
Expand Down
8 changes: 4 additions & 4 deletions cmake/Export.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
// TICKTOCK IGNITION ========================================================
// TODO(CH3): Remove on ticktock, supports defining IGNITION macros if a lib
// is using GZ_ prefixed export macros
#ifndef @_ign_export_base@_VISIBLE
#define @_ign_export_base@_VISIBLE @export_base@_VISIBLE
#ifndef @_gz_export_base@_VISIBLE
#define @_gz_export_base@_VISIBLE @export_base@_VISIBLE
#endif

#ifndef @_ign_export_base@_HIDDEN
#define @_ign_export_base@_HIDDEN @export_base@_HIDDEN
#ifndef @_gz_export_base@_HIDDEN
#define @_gz_export_base@_HIDDEN @export_base@_HIDDEN
#endif

#ifndef IGN_DEPRECATED_ALL_VERSIONS
Expand Down
6 changes: 3 additions & 3 deletions cmake/FindIgnBullet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
# This file is provided under the "BSD-style" License
########################################

set(ign_quiet_arg)
set(gz_quiet_arg)
if(IgnBullet_FIND_QUIETLY)
set(ign_quiet_arg QUIET)
set(gz_quiet_arg QUIET)
endif()

# Bullet. Force MODULE mode to use the FindBullet.cmake file distributed with
# CMake. Otherwise, we may end up using the BulletConfig.cmake file distributed
# with Bullet, which uses relative paths and may break transitive dependencies.
find_package(Bullet MODULE ${ign_quiet_arg})
find_package(Bullet MODULE ${gz_quiet_arg})

set(IgnBullet_FOUND false)
# create Bullet target
Expand Down
8 changes: 4 additions & 4 deletions cmake/FindIgnCURL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
# IgnCURL_LIBRARIES The CURL libraries
# IgnCURL_VERSION The version of CURL found

set(ign_quiet_arg)
set(gz_quiet_arg)
if(IgnCURL_FIND_QUIETLY)
set(ign_quiet_arg QUIET)
set(gz_quiet_arg QUIET)
endif()

find_package(CURL ${IgnCURL_FIND_VERSION} ${ign_quiet_arg})
find_package(CURL ${IgnCURL_FIND_VERSION} ${gz_quiet_arg})

set(IgnCURL_FOUND ${CURL_FOUND})

Expand All @@ -51,7 +51,7 @@ if(${IgnCURL_FOUND})
set_target_properties(curl::curl PROPERTIES
INTERFACE_LINK_LIBRARIES CURL::libcurl)
endif()

include(IgnImportTarget)

if(NOT TARGET curl::curl)
Expand Down
22 changes: 11 additions & 11 deletions cmake/FindOptiX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ else()
set(bit_dest "")
endif()

# ign-cmake modification: added "ign_" prefix to macro name
macro(ign_OPTIX_find_api_library name version)
# gz-cmake modification: added "gz_" prefix to macro name
macro(gz_OPTIX_find_api_library name version)
find_library(${name}_LIBRARY
NAMES ${name}.${version} ${name}
PATHS "${OptiX_INSTALL_DIR}/lib${bit_dest}"
Expand All @@ -102,9 +102,9 @@ macro(ign_OPTIX_find_api_library name version)
endif()
endmacro()

ign_OPTIX_find_api_library(optix 1)
ign_OPTIX_find_api_library(optixu 1)
ign_OPTIX_find_api_library(optix_prime 1)
gz_OPTIX_find_api_library(optix 1)
gz_OPTIX_find_api_library(optixu 1)
gz_OPTIX_find_api_library(optix_prime 1)

# Include
find_path(OptiX_INCLUDE
Expand Down Expand Up @@ -142,7 +142,7 @@ function(OptiX_add_imported_library name lib_location dll_lib dependent_libs)
set(CMAKE_IMPORT_FILE_VERSION 1)

# Create imported target
# ign-cmake modification: changed to use ${target_name} instead of ${name}
# gz-cmake modification: changed to use ${target_name} instead of ${name}
set(target_name optix::${name})
add_library(${target_name} SHARED IMPORTED)

Expand Down Expand Up @@ -180,8 +180,8 @@ OptiX_add_imported_library(optix "${optix_LIBRARY}" "${optix_DLL}" "${OPENGL_LIB
OptiX_add_imported_library(optixu "${optixu_LIBRARY}" "${optixu_DLL}" "")
OptiX_add_imported_library(optix_prime "${optix_prime_LIBRARY}" "${optix_prime_DLL}" "")

# ign-cmake modification: added "ign_" prefix to macro name
macro(ign_OptiX_check_same_path libA libB)
# gz-cmake modification: added "gz_" prefix to macro name
macro(gz_OptiX_check_same_path libA libB)
if(_optix_path_to_${libA})
if(NOT _optix_path_to_${libA} STREQUAL _optix_path_to_${libB})
# ${libA} and ${libB} are in different paths. Make sure there isn't a ${libA} next
Expand All @@ -203,10 +203,10 @@ if(APPLE)
set( _optix_rpath "-Wl,-rpath,${_optix_path_to_optix}" )
endif()
get_filename_component(_optix_path_to_optixu "${optixu_LIBRARY}" PATH)
ign_OptiX_check_same_path(optixu optix)
gz_OptiX_check_same_path(optixu optix)
get_filename_component(_optix_path_to_optix_prime "${optix_prime_LIBRARY}" PATH)
ign_OptiX_check_same_path(optix_prime optix)
ign_OptiX_check_same_path(optix_prime optixu)
gz_OptiX_check_same_path(optix_prime optix)
gz_OptiX_check_same_path(optix_prime optixu)

set( optix_rpath ${_optix_rpath} ${_optixu_rpath} ${_optix_prime_rpath} )
list(LENGTH optix_rpath optix_rpath_LENGTH)
Expand Down
2 changes: 1 addition & 1 deletion cmake/IgnCMake.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# limitations under the License.

#============================================================================
# ignition-cmake modules
# gz-cmake modules
#============================================================================
include(IgnUtils)
include(IgnConfigureProject)
Expand Down
6 changes: 3 additions & 3 deletions cmake/IgnConfigureBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ macro(gz_configure_build)
#--------------------------------------
# Initialize the list of header directories that should be parsed by doxygen
if(EXISTS "${CMAKE_SOURCE_DIR}/include")
set(ign_doxygen_component_input_dirs "${CMAKE_SOURCE_DIR}/include")
set(gz_doxygen_component_input_dirs "${CMAKE_SOURCE_DIR}/include")
else()
set(ign_doxygen_component_input_dirs "")
set(gz_doxygen_component_input_dirs "")
endif()

#--------------------------------------
Expand All @@ -222,7 +222,7 @@ macro(gz_configure_build)
# backslashes in order to get a \ plus a newline. This might be
# dependent on the implementation of gz_string_append, so be careful
# when changing the implementation of that function.
gz_string_append(ign_doxygen_component_input_dirs
gz_string_append(gz_doxygen_component_input_dirs
"${CMAKE_CURRENT_LIST_DIR}/${component}/include"
DELIM " \\\\\\\\\n ")
endif()
Expand Down
4 changes: 2 additions & 2 deletions cmake/IgnCreateDocs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function(gz_create_docs)
# about the spaces between input files/directories. If you put each cmake
# variable on a separate line to make this `set` command more readable,
# then doxygen will not generate the correct/complete output.
set(IGNITION_DOXYGEN_INPUT "${IGNITION_DOXYGEN_API_MAINPAGE_MD} ${IGNITION_DOXYGEN_AUTOGENERATED_DOC} ${IGNITION_DOXYGEN_TUTORIALS_DIR} ${IGNITION_DOXYGEN_TUTORIALS_MAINPAGE_MD} ${ign_doxygen_component_input_dirs} ${IGNITION_DOXYGEN_ADDITIONAL_INPUT_DIRS}")
set(IGNITION_DOXYGEN_INPUT "${IGNITION_DOXYGEN_API_MAINPAGE_MD} ${IGNITION_DOXYGEN_AUTOGENERATED_DOC} ${IGNITION_DOXYGEN_TUTORIALS_DIR} ${IGNITION_DOXYGEN_TUTORIALS_MAINPAGE_MD} ${gz_doxygen_component_input_dirs} ${IGNITION_DOXYGEN_ADDITIONAL_INPUT_DIRS}")
configure_file(${IGNITION_CMAKE_DOXYGEN_DIR}/api.in
${CMAKE_BINARY_DIR}/api.dox @ONLY)

Expand All @@ -187,7 +187,7 @@ function(gz_create_docs)
set(IGNITION_DOXYGEN_GENHTML "NO")
set(IGNITION_DOXYGEN_GENTAGFILE
"${CMAKE_BINARY_DIR}/${PROJECT_NAME_LOWER}.tag.xml")
set(IGNITION_DOXYGEN_INPUT "${ign_doxygen_component_input_dirs} ${IGNITION_DOXYGEN_AUTOGENERATED_DOC}")
set(IGNITION_DOXYGEN_INPUT "${gz_doxygen_component_input_dirs} ${IGNITION_DOXYGEN_AUTOGENERATED_DOC}")
configure_file(${IGNITION_CMAKE_DOXYGEN_DIR}/api.in
${CMAKE_BINARY_DIR}/api_tagfile.dox @ONLY)

Expand Down
50 changes: 25 additions & 25 deletions cmake/IgnPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ endmacro()
# component's name.
#
# NOTE: This will be called automatically by gz_create_core_library(~) and
# gz_add_component(~), so users of ignition-cmake should not call this
# gz_add_component(~), so users of gz-cmake should not call this
# function.
#
# NOTE: For ignition-cmake developers, the variables needed by ignition.pc.in or
# NOTE: For gz-cmake developers, the variables needed by ignition.pc.in or
# ignition-component.pc.in MUST be set before calling this function.
#
# Create a pkgconfig file for your target, and install it.
Expand Down Expand Up @@ -235,10 +235,10 @@ endfunction()
# can be used to specify the prefix of these variables.
#
# NOTE: This will be called automatically by gz_create_core_library(~) and
# gz_add_component(~), so users of ignition-cmake should not call this
# gz_add_component(~), so users of gz-cmake should not call this
# function.
#
# NOTE: For ignition-cmake developers, some of the variables needed by
# NOTE: For gz-cmake developers, some of the variables needed by
# ignition-config.cmake.in or ignition-component-config.cmake.in MUST be
# set before calling this function. The following variables are set
# automatically by this function:
Expand Down Expand Up @@ -270,20 +270,20 @@ function(_gz_create_cmake_package)

set(component ${_gz_create_cmake_package_COMPONENT})
set(target_name ${PROJECT_LIBRARY_TARGET_NAME}-${component})
set(ign_config_input "${IGNITION_CMAKE_DIR}/ignition-component-config.cmake.in")
set(gz_config_input "${IGNITION_CMAKE_DIR}/ignition-component-config.cmake.in")
set(simple_import_name ${component})

elseif(_gz_create_cmake_package_ALL)

set(ign_config_input "${IGNITION_CMAKE_DIR}/ignition-all-config.cmake.in")
set(gz_config_input "${IGNITION_CMAKE_DIR}/ignition-all-config.cmake.in")
set(target_name ${PROJECT_LIBRARY_TARGET_NAME}-all)
set(all_pkg_name ${PROJECT_LIBRARY_TARGET_NAME}-all)
set(simple_import_name all)

else()

set(target_name ${PROJECT_LIBRARY_TARGET_NAME})
set(ign_config_input "${IGNITION_CMAKE_DIR}/ignition-config.cmake.in")
set(gz_config_input "${IGNITION_CMAKE_DIR}/ignition-config.cmake.in")
set(simple_import_name core)

endif()
Expand All @@ -300,46 +300,46 @@ function(_gz_create_cmake_package)

# This gets used by the ignition-*.config.cmake.in files
set(target_output_filename ${target_name}-targets.cmake)
set(ign_config_output "${PROJECT_BINARY_DIR}/cmake/${target_name}-config.cmake")
set(ign_version_output "${PROJECT_BINARY_DIR}/cmake/${target_name}-config-version.cmake")
set(ign_target_ouput "${PROJECT_BINARY_DIR}/cmake/${target_output_filename}")
set(gz_config_output "${PROJECT_BINARY_DIR}/cmake/${target_name}-config.cmake")
set(gz_version_output "${PROJECT_BINARY_DIR}/cmake/${target_name}-config-version.cmake")
set(gz_target_ouput "${PROJECT_BINARY_DIR}/cmake/${target_output_filename}")

# NOTE: Each component needs to go into its own cmake directory in order to be
# found by cmake's native find_package(~) command.
set(ign_config_install_dir "${IGN_LIB_INSTALL_DIR}/cmake/${target_name}")
set(ign_namespace ${PROJECT_LIBRARY_TARGET_NAME}::)
set(gz_config_install_dir "${IGN_LIB_INSTALL_DIR}/cmake/${target_name}")
set(gz_namespace ${PROJECT_LIBRARY_TARGET_NAME}::)

set(import_target_name ${ign_namespace}${target_name})
set(simple_import_name ${ign_namespace}${simple_import_name})
set(import_target_name ${gz_namespace}${target_name})
set(simple_import_name ${gz_namespace}${simple_import_name})

# Configure the package config file. It will be installed to
# "[lib]/cmake/ignition-<project><major_version>/" where [lib] is the library
# installation directory.
configure_package_config_file(
${ign_config_input}
${ign_config_output}
INSTALL_DESTINATION ${ign_config_install_dir}
${gz_config_input}
${gz_config_output}
INSTALL_DESTINATION ${gz_config_install_dir}
PATH_VARS IGN_LIB_INSTALL_DIR IGN_INCLUDE_INSTALL_DIR_FULL)

# Use write_basic_package_version_file to generate a ConfigVersion file that
# allow users of the library to specify the API or version to depend on
write_basic_package_version_file(
${ign_version_output}
${gz_version_output}
VERSION "${PROJECT_VERSION_FULL_NO_SUFFIX}"
COMPATIBILITY SameMajorVersion)

# Install the configuration files to the configuration installation directory
install(
FILES
${ign_config_output}
${ign_version_output}
DESTINATION ${ign_config_install_dir}
${gz_config_output}
${gz_version_output}
DESTINATION ${gz_config_install_dir}
COMPONENT cmake)

# Create *-targets.cmake file for build directory
export(
EXPORT ${target_name}
FILE ${ign_target_ouput}
FILE ${gz_target_ouput}
# We add a namespace that ends with a :: to the name of the exported target.
# This is so consumers of the project can call
# find_package(ignition-<project>)
Expand All @@ -354,15 +354,15 @@ function(_gz_create_cmake_package)
# The advantage of linking against a target rather than a library is that
# you will automatically link against all the dependencies of that target.
# This also helps us create find-config files that are relocatable.
NAMESPACE ${ign_namespace})
NAMESPACE ${gz_namespace})

# Install *-targets.cmake file
install(
EXPORT ${target_name}
DESTINATION ${ign_config_install_dir}
DESTINATION ${gz_config_install_dir}
FILE ${target_output_filename}
# See explanation above for NAMESPACE
NAMESPACE ${ign_namespace})
NAMESPACE ${gz_namespace})

endfunction()

Expand Down
Loading

0 comments on commit b077e27

Please sign in to comment.