Skip to content

Commit

Permalink
[ign -> gz] CMake functions (#652)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored Jun 17, 2022
1 parent 7dcb892 commit 17fc9af
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 39 deletions.
34 changes: 17 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(IGN_CMAKE_VER ${ignition-cmake3_VERSION_MAJOR})
#============================================================================
# Set up the project
#============================================================================
ign_configure_project(
gz_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/rendering
VERSION_SUFFIX pre1)

Expand All @@ -32,28 +32,28 @@ option(USE_UNOFFICIAL_OGRE_VERSIONS "Accept unsupported Ogre versions in the bui

#--------------------------------------
# Find ignition-math
ign_find_package(ignition-math7 REQUIRED COMPONENTS eigen3)
gz_find_package(ignition-math7 REQUIRED COMPONENTS eigen3)
set(IGN_MATH_VER ${ignition-math7_VERSION_MAJOR})

#--------------------------------------
# Find ignition-common
ign_find_package(ignition-common5 REQUIRED
gz_find_package(ignition-common5 REQUIRED
COMPONENTS graphics events geospatial)
set(IGN_COMMON_VER ${ignition-common5_VERSION_MAJOR})

#--------------------------------------
# Find ignition-plugin
ign_find_package(ignition-plugin2 REQUIRED COMPONENTS all)
gz_find_package(ignition-plugin2 REQUIRED COMPONENTS all)
set(IGN_PLUGIN_VER ${ignition-plugin2_VERSION_MAJOR})

#--------------------------------------
# Find ignition-utils
ign_find_package(ignition-utils2 REQUIRED)
gz_find_package(ignition-utils2 REQUIRED)
set(IGN_UTILS_VER ${ignition-utils2_VERSION_MAJOR})

#--------------------------------------
# Find FreeImage
ign_find_package(FreeImage VERSION 3.9
gz_find_package(FreeImage VERSION 3.9
REQUIRED_BY optix
PRIVATE_FOR optix)

Expand All @@ -64,7 +64,7 @@ if ((NOT ${CMAKE_VERSION} VERSION_LESS 3.11) AND (NOT OpenGL_GL_PREFERENCE))
set(OpenGL_GL_PREFERENCE "GLVND")
endif()

ign_find_package(OpenGL
gz_find_package(OpenGL
REQUIRED_BY ogre ogre2
PKGCONFIG gl)

Expand All @@ -74,10 +74,10 @@ endif()

#--------------------------------------
# Find OGRE
list(APPEND ign_ogre_components "RTShaderSystem" "Terrain" "Overlay" "Paging")
list(APPEND gz_ogre_components "RTShaderSystem" "Terrain" "Overlay" "Paging")

ign_find_package(IgnOGRE VERSION 1.9.0
COMPONENTS ${ign_ogre_components}
gz_find_package(IgnOGRE VERSION 1.9.0
COMPONENTS ${gz_ogre_components}
REQUIRED_BY ogre
PRIVATE_FOR ogre)

Expand Down Expand Up @@ -106,14 +106,14 @@ endif()
# Find OGRE2: first try to find OGRE2 built with PlanarReflections support and
# fallback to look for OGRE2 without it. Both seems to works for ign-rendering.
# See https://github.com/gazebosim/gz-rendering/issues/597
ign_find_package(IgnOGRE2 VERSION 2.2.0
gz_find_package(IgnOGRE2 VERSION 2.2.0
COMPONENTS HlmsPbs HlmsUnlit Overlay PlanarReflections
PRIVATE_FOR ogre2
QUIET)

if ("${OGRE2-PlanarReflections}" STREQUAL "OGRE2-PlanarReflections-NOTFOUND")
message(STATUS "PlanarReflections component was not found. Try looking without it:")
ign_find_package(IgnOGRE2 VERSION 2.2.0
gz_find_package(IgnOGRE2 VERSION 2.2.0
COMPONENTS HlmsPbs HlmsUnlit Overlay
REQUIRED_BY ogre2
PRIVATE_FOR ogre2)
Expand All @@ -137,7 +137,7 @@ if(NOT MSVC)

#--------------------------------------
# Find OptiX
ign_find_package(OptiX VERSION 3.8.0
gz_find_package(OptiX VERSION 3.8.0
REQUIRED_BY optix
PRIVATE_FOR optix)

Expand Down Expand Up @@ -174,27 +174,27 @@ endif()
configure_file("${PROJECT_SOURCE_DIR}/cppcheck.suppress.in"
${PROJECT_BINARY_DIR}/cppcheck.suppress)

ign_configure_build(QUIT_IF_BUILD_ERRORS
gz_configure_build(QUIT_IF_BUILD_ERRORS
COMPONENTS ${RENDERING_COMPONENTS})

if (HAVE_OGRE2)
# Must be done after ign_configure_build or else Terra
# Must be done after gz_configure_build or else Terra
# won't see IGN_ADD_fPIC_TO_LIBRARIES
add_subdirectory(ogre2/src/terrain/Terra)
endif()

#============================================================================
# Create package information
#============================================================================
ign_create_packages()
gz_create_packages()

#============================================================================
# Configure documentation
#============================================================================
configure_file(${CMAKE_SOURCE_DIR}/api.md.in ${CMAKE_BINARY_DIR}/api.md)
configure_file(${CMAKE_SOURCE_DIR}/tutorials.md.in ${CMAKE_BINARY_DIR}/tutorials.md)

ign_create_docs(
gz_create_docs(
API_MAINPAGE_MD "${CMAKE_BINARY_DIR}/api.md"
TUTORIALS_MAINPAGE_MD "${CMAKE_BINARY_DIR}/tutorials.md"
IMAGE_PATH_DIRS "${CMAKE_SOURCE_DIR}/tutorials/img"
Expand Down
2 changes: 1 addition & 1 deletion include/gz/rendering/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ign_install_all_headers()
gz_install_all_headers()
2 changes: 1 addition & 1 deletion include/gz/rendering/base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#ign_install_all_headers()
#gz_install_all_headers()
2 changes: 1 addition & 1 deletion ogre/include/gz/rendering/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ign_install_all_headers(COMPONENT ogre)
gz_install_all_headers(COMPONENT ogre)
6 changes: 3 additions & 3 deletions ogre/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Collect source files into the "sources" variable and unit test files into the
# "gtest_sources" variable.
ign_get_libsources_and_unittests(sources gtest_sources)
gz_get_libsources_and_unittests(sources gtest_sources)

if (MSVC)
# Warning #4251 is the "dll-interface" warning that tells you when types used
Expand All @@ -13,7 +13,7 @@ endif()

set(engine_name "ogre")

ign_add_component(${engine_name} SOURCES ${sources} GET_TARGET_NAME ogre_target)
gz_add_component(${engine_name} SOURCES ${sources} GET_TARGET_NAME ogre_target)

if(OGRE_VERSION VERSION_LESS 1.11.0)
add_definitions(-DOGRE_VERSION_LT_1_11_0)
Expand Down Expand Up @@ -41,7 +41,7 @@ target_link_libraries(${ogre_target}
)

# Build the unit tests
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources} LIB_DEPS ${ogre_target})
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources} LIB_DEPS ${ogre_target})

# Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir
install(TARGETS ${ogre_target} DESTINATION ${GZ_RENDERING_ENGINE_INSTALL_DIR})
Expand Down
2 changes: 1 addition & 1 deletion ogre2/include/gz/rendering/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ign_install_all_headers(COMPONENT ogre2)
gz_install_all_headers(COMPONENT ogre2)
6 changes: 3 additions & 3 deletions ogre2/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Collect source files into the "sources" variable and unit test files into the
# "gtest_sources" variable.
ign_get_libsources_and_unittests(sources gtest_sources)
gz_get_libsources_and_unittests(sources gtest_sources)

if (MSVC)
# Warning #4251 is the "dll-interface" warning that tells you when types used
Expand All @@ -13,7 +13,7 @@ endif()

set(engine_name "ogre2")

ign_add_component(${engine_name} SOURCES ${sources} GET_TARGET_NAME ogre2_target)
gz_add_component(${engine_name} SOURCES ${sources} GET_TARGET_NAME ogre2_target)

find_package(OpenGL)

Expand Down Expand Up @@ -59,6 +59,6 @@ else()
endif()

# Build the unit tests
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources} LIB_DEPS ${ogre2_target})
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources} LIB_DEPS ${ogre2_target})

install(DIRECTORY "media" DESTINATION ${GZ_RENDERING_RESOURCE_PATH}/ogre2)
2 changes: 1 addition & 1 deletion optix/include/gz/rendering/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ign_install_all_headers(COMPONENT optix)
gz_install_all_headers(COMPONENT optix)
8 changes: 4 additions & 4 deletions optix/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Collect source files into the "sources" variable and unit test files into the
# "gtest_sources" variable.
ign_get_libsources_and_unittests(sources gtest_sources)
gz_get_libsources_and_unittests(sources gtest_sources)

include_directories(${CUDA_INCLUDE_DIRS})
link_directories(${CUDA_LIBRARY_DIRS})
Expand All @@ -11,7 +11,7 @@ include_directories(SYSTEM ${OptiX_INCLUDE_DIRS})

set(engine_name optix)

ign_add_component(${engine_name} SOURCES ${sources} GET_TARGET_NAME optix_target)
gz_add_component(${engine_name} SOURCES ${sources} GET_TARGET_NAME optix_target)

set(cuda_sources
OptixBox.cu
Expand Down Expand Up @@ -43,7 +43,7 @@ target_link_libraries(${optix_target}
optix::optix_prime)

# Build the unit tests
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources})
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})

# Note that plugins are currently being installed in 2 places: /lib and the engine-plugins dir
install(TARGETS ${optix_target} DESTINATION ${GZ_RENDERING_ENGINE_INSTALL_DIR})
Expand All @@ -55,7 +55,7 @@ if (WIN32)
# disable MSVC inherit via dominance warning
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy
${GZ_RENDERING_ENGINE_INSTALL_DIR}\/${versioned}
${GZ_RENDERING_ENGINE_INSTALL_DIR}\/${versioned}
${GZ_RENDERING_ENGINE_INSTALL_DIR}\/${unversioned})")
else()
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${versioned} ${unversioned})
Expand Down
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set_property(

# Collect source files into the "sources" variable and unit test files into the
# "gtest_sources" variable.
ign_get_libsources_and_unittests(sources gtest_sources)
gz_get_libsources_and_unittests(sources gtest_sources)

add_subdirectory(base)

Expand All @@ -21,10 +21,10 @@ if (MSVC)
endif()

# Create the library target.
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 17)
gz_create_core_library(SOURCES ${sources} CXX_STANDARD 17)

# Include the interface directories that we always need.
#ign_target_interface_include_directories(${PROJECT_LIBRARY_TARGET_NAME}
#gz_target_interface_include_directories(${PROJECT_LIBRARY_TARGET_NAME}
# ignition-math${IGN_MATH_VER})

set_property(
Expand All @@ -45,5 +45,5 @@ if (UNIX AND NOT APPLE)
endif()

# Build the unit tests.
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources})
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})

2 changes: 1 addition & 1 deletion test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ if (UNIX AND NOT APPLE)
endforeach()
endif()

ign_build_tests(TYPE INTEGRATION SOURCES ${tests})
gz_build_tests(TYPE INTEGRATION SOURCES ${tests})
2 changes: 1 addition & 1 deletion test/performance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ set(tests

link_directories(${PROJECT_BINARY_DIR}/test)

ign_build_tests(TYPE PERFORMANCE SOURCES ${tests})
gz_build_tests(TYPE PERFORMANCE SOURCES ${tests})
2 changes: 1 addition & 1 deletion test/regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set(tests

link_directories(${PROJECT_BINARY_DIR}/test)

ign_build_tests(TYPE REGRESSION SOURCES ${tests})
gz_build_tests(TYPE REGRESSION SOURCES ${tests})

0 comments on commit 17fc9af

Please sign in to comment.