Skip to content

Commit cba9355

Browse files
authored
Use standard BUILD_TESTING CMake variable and deprecate WITH_TESTS
* streamline CI configuration * set find_package to CONFIG for PDAL * use standard BUILD_TESTING cmake config variable and deprecate WITH_TESTS * BUILD_TESTING now as is standard in CMake instead of WITH_TESTS, which is not * remove extraneous include
1 parent e870d64 commit cba9355

17 files changed

+77
-207
lines changed

.github/workflows/linux.yml

-47
This file was deleted.

.github/workflows/osx.yml

-46
This file was deleted.

.github/workflows/test.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Test
2+
on: [push, pull_request]
3+
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
6+
cancel-in-progress: true
7+
8+
jobs:
9+
build:
10+
name: OS ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [macos-latest, windows-latest, ubuntu-latest]
15+
shared: [ON, OFF]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: ilammy/msvc-dev-cmd@v1
20+
if: matrix.os == 'windows-latest'
21+
- name: Support longpaths
22+
run: git config --system core.longpaths true
23+
if: matrix.os == 'windows-latest'
24+
- uses: mamba-org/setup-micromamba@v1
25+
with:
26+
init-shell: bash
27+
environment-file: ci/environment.yml
28+
environment-name: "build"
29+
cache-environment: true
30+
cache-downloads: true
31+
32+
- name: Setup
33+
shell: bash -l {0}
34+
run: |
35+
mkdir build
36+
37+
- name: CMake
38+
shell: bash -l {0}
39+
40+
run: |
41+
42+
if [ "$RUNNER_OS" == "Windows" ]; then
43+
export CC=cl.exe
44+
export CXX=cl.exe
45+
fi
46+
47+
cmake -G "Ninja" \
48+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
49+
-DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS \
50+
-DBUILD_TESTING=ON \
51+
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
52+
-Dgtest_force_shared_crt=ON \
53+
..
54+
55+
56+
working-directory: ./build
57+
58+
- name: Compile
59+
shell: bash -l {0}
60+
run: |
61+
ninja
62+
working-directory: ./build
63+
64+
- name: Test
65+
shell: bash -l {0}
66+
run: |
67+
ctest -VV --rerun-failed --output-on-failure
68+
working-directory: ./build
69+

.github/workflows/win.yml

-47
This file was deleted.

CMakeLists.txt

+8-10
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ project(Untwine VERSION 1.3.2 LANGUAGES CXX)
33
include(FeatureSummary)
44
include(${PROJECT_SOURCE_DIR}/cmake/compiler_options.cmake)
55

6-
option(WITH_TESTS
7-
"Choose if Untwine unit tests should be built" TRUE)
8-
add_feature_info("Unit tests" WITH_TESTS "Untwine unit tests")
6+
option(BUILD_TESTING "Chose if Untwine unit tests should be built" OFF)
7+
add_feature_info("Unit tests" BUILD_TESTING "Untwine unit tests")
98

10-
11-
find_package(PDAL REQUIRED)
12-
if ((PDAL_VERSION_MAJOR EQUAL 1) AND (PDAL_VERSION_MINOR LESS 7))
13-
message(FATAL_ERROR "PDAL version is too old (${PDAL_VERSION}). Use 1.7 or higher.")
9+
if(DEFINED WITH_TESTS)
10+
message(DEPRECATION "WITH_TESTS has been replaced with the standard CMake BUILD_TESTING variable")
11+
set(BUILD_TESTING ${WITH_TESTS})
1412
endif()
1513

14+
find_package(PDAL REQUIRED CONFIG 2.6)
15+
1616
find_package(Threads)
1717
set_package_properties(Threads PROPERTIES DESCRIPTION
1818
"The thread library of the system" TYPE REQUIRED)
@@ -58,9 +58,7 @@ endif()
5858

5959
install(TARGETS untwine DESTINATION bin)
6060

61-
#-----------------
62-
63-
if (WITH_TESTS)
61+
if (BUILD_TESTING)
6462
enable_testing()
6563
add_subdirectory(test)
6664
endif()

ci/linux/cmake.sh

-8
This file was deleted.

ci/linux/compile.sh

-4
This file was deleted.

ci/linux/setup.sh

-4
This file was deleted.

ci/linux/test.sh

-3
This file was deleted.

ci/osx/cmake.sh

-7
This file was deleted.

ci/osx/compile.sh

-4
This file was deleted.

ci/osx/setup.sh

-2
This file was deleted.

ci/osx/test.sh

-3
This file was deleted.

ci/win/cmake.sh

-14
This file was deleted.

ci/win/compile.sh

-4
This file was deleted.

ci/win/setup.sh

-1
This file was deleted.

ci/win/test.sh

-3
This file was deleted.

0 commit comments

Comments
 (0)