Skip to content
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
38 changes: 33 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,41 @@ PDAL_PYTHON_ADD_PLUGIN(python_filter filter python


if (WITH_TESTS)
set(GOOGLETEST_VERSION 1.12.1)

enable_testing()

message(STATUS "Fetching GTest from GitHub ...")

# Add Google Test
#
# See https://github.com/google/googletest/blob/main/googletest/README.md

if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW) # for DOWNLOAD_EXTRACT_TIMESTAMP option
endif()

set(GTEST_VERSION "1.15.2")

include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/tags/v${GTEST_VERSION}.zip
EXCLUDE_FROM_ALL # ignored before CMake 3.28
)

# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory(src/pdal/test/gtest)
enable_testing()
include_directories(pdal/test/gtest/include .. ${CMAKE_CURRENT_BINARY_DIR})

if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.28.0")
FetchContent_MakeAvailable(googletest)
else()
# Pre CMake 3.28 workaround to prevent installing files
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
endif()

PDAL_PYTHON_ADD_TEST(pdal_io_numpy_test
FILES
./src/pdal/test/NumpyReaderTest.cpp
Expand Down
3 changes: 0 additions & 3 deletions src/pdal/plang/Environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@
#define NPY_API_SYMBOL_ATTRIBUTE
#define NPY_NO_DEPRECATED_API NPY_1_22_API_VERSION

// PDAL renamed this but it is not aliased on windows for PDAL 2.9
# define PDAL_DLL PDAL_EXPORT

namespace pdal
{
namespace plang
Expand Down
3 changes: 0 additions & 3 deletions src/pdal/plang/Invocation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
#include <pdal/Dimension.hpp>
#include <pdal/PointView.hpp>

// PDAL renamed this but it is not aliased on windows for PDAL 2.9
# define PDAL_DLL PDAL_EXPORT

namespace pdal
{
namespace plang
Expand Down
2 changes: 2 additions & 0 deletions src/pdal/plang/Script.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@

#include <pdal/Options.hpp>

#ifndef PDAL_DLL
// PDAL renamed this but it is not aliased on windows for PDAL 2.9
# define PDAL_DLL PDAL_EXPORT
#endif

namespace pdal
{
Expand Down
4 changes: 4 additions & 0 deletions src/pdal/test/Support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ uint32_t Support::diff_text_files(std::istream& str1, std::istream& str2,
std::getline(str1, buf1);
std::getline(str2, buf2);

// Remove \r's
buf1.erase( std::remove(buf1.begin(), buf1.end(), '\r'), buf1.end() );
buf2.erase( std::remove(buf2.begin(), buf2.end(), '\r'), buf2.end() );

if (currLine == ignoreLine1)
{
++currLine;
Expand Down
Loading
Loading