Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ign -> gz] CMake functions #441

Merged
merged 1 commit into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ find_package(ignition-cmake3 REQUIRED)
#============================================================================
set (c++standard 17)
set (CMAKE_CXX_STANDARD 17)
ign_configure_project(
gz_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/math
VERSION_SUFFIX pre1)

Expand All @@ -42,12 +42,12 @@ option(USE_DIST_PACKAGES_FOR_PYTHON

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

#--------------------------------------
# Find eigen3
ign_find_package(
gz_find_package(
EIGEN3
REQUIRED_BY eigen3
PRETTY eigen3
Expand Down Expand Up @@ -105,21 +105,21 @@ set(FAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/fake/install")
#============================================================================
# Configure the build
#============================================================================
ign_configure_build(QUIT_IF_BUILD_ERRORS
gz_configure_build(QUIT_IF_BUILD_ERRORS
COMPONENTS eigen3)


#============================================================================
# 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")
3 changes: 1 addition & 2 deletions eigen3/include/gz/math/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

ign_install_all_headers(COMPONENT eigen3)
gz_install_all_headers(COMPONENT eigen3)
7 changes: 3 additions & 4 deletions eigen3/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@

ign_add_component(eigen3 INTERFACE
gz_add_component(eigen3 INTERFACE
GET_TARGET_NAME component)

target_link_libraries(${component} INTERFACE Eigen3::Eigen)

# 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)

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

2 changes: 1 addition & 1 deletion include/gz/math/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Exclude the detail directory from inclusion. The purpose is to prevent the detail/* header files from being included in math.hh. A side effect is that the detail headers are not installed. The next install line solves this problem.
ign_install_all_headers(EXCLUDE_DIRS detail)
gz_install_all_headers(EXCLUDE_DIRS detail)
install(DIRECTORY detail DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL}/gz/${IGN_DESIGNATION})
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

# 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)

# Create the library target
ign_create_core_library(SOURCES ${sources} CXX_STANDARD ${c++standard})
gz_create_core_library(SOURCES ${sources} CXX_STANDARD ${c++standard})

target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
ignition-utils${IGN_UTILS_VER}::ignition-utils${IGN_UTILS_VER}
)

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

# graph namespace
add_subdirectory(graph)
Expand Down
4 changes: 2 additions & 2 deletions src/graph/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# 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)

# Build the unit tests
ign_build_tests(TYPE UNIT SOURCES ${gtest_sources})
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources})
4 changes: 2 additions & 2 deletions test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(TEST_TYPE "INTEGRATION")

ign_get_sources(tests)
gz_get_sources(tests)

# Test symbols having the right name on linux only
if (UNIX AND NOT APPLE)
Expand All @@ -9,7 +9,7 @@ if (UNIX AND NOT APPLE)
COMMAND bash ${CMAKE_CURRENT_BINARY_DIR}/all_symbols_have_version.bash $<TARGET_FILE:${PROJECT_LIBRARY_TARGET_NAME}>)
endif()

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

if(TARGET INTEGRATION_ExamplesBuild_TEST)
add_dependencies(INTEGRATION_ExamplesBuild_TEST FAKE_INSTALL)
Expand Down
2 changes: 1 addition & 1 deletion test/performance/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 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})