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

Attempt to Fix Broken C++ Build After cudftestutil is Made a Shared Lib #996

Merged
merged 7 commits into from
Mar 15, 2023
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
1 change: 1 addition & 0 deletions conda/recipes/libcuspatial/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ requirements:
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
- cudatoolkit ={{ cuda_version }}
- doxygen
- gmock {{ gtest_version }}
- gtest {{ gtest_version }}
- libcudf ={{ minor_version }}
Expand Down
10 changes: 7 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ include(cmake/Modules/ConfigureCUDA.cmake)
rapids_cpm_init()
# find or add cuDF
include(cmake/thirdparty/CUSPATIAL_GetCUDF.cmake)

# find or install GoogleTest
if (CUSPATIAL_BUILD_TESTS)
include(cmake/thirdparty/get_gtest.cmake)
endif()

###################################################################################################
# - library targets -------------------------------------------------------------------------------
Expand Down Expand Up @@ -279,9 +282,10 @@ rapids_export(
# * build documentation ----------------------------------------------------------------------------

find_package(Doxygen)
if(Doxygen_FOUND)

# doc targets for cuDF
if(DOXYGEN_FOUND)

# doc targets for cuSpatial
add_custom_command(
OUTPUT CUSPATIAL_DOXYGEN
WORKING_DIRECTORY ${CUSPATIAL_SOURCE_DIR}/doxygen
Expand Down
39 changes: 39 additions & 0 deletions cpp/cmake/thirdparty/get_gtest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# =============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# 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 function finds gtest and sets any additional necessary environment variables.
function(find_and_configure_gtest)
include(${rapids-cmake-dir}/cpm/gtest.cmake)

# Find or install GoogleTest
rapids_cpm_gtest(BUILD_EXPORT_SET cuspatial-testing-exports INSTALL_EXPORT_SET cuspatial-testing-exports)

if(GTest_ADDED)
rapids_export(
BUILD GTest
VERSION ${GTest_VERSION}
EXPORT_SET GTestTargets
GLOBAL_TARGETS gtest gmock gtest_main gmock_main
NAMESPACE GTest::
)

include("${rapids-cmake-dir}/export/find_package_root.cmake")
rapids_export_find_package_root(
BUILD GTest [=[${CMAKE_CURRENT_LIST_DIR}]=] cuspatial-testing-exports
)
endif()

endfunction()

find_and_configure_gtest()