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

CMake: replace PROJ_TESTS with CTest's BUILD_TESTING option #1870

Merged
merged 1 commit into from
Jan 24, 2020
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
25 changes: 17 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,6 @@ if(MSVC OR CMAKE_CONFIGURATION_TYPES)
set(CMAKE_DEBUG_POSTFIX _d)
endif()

option(PROJ_TESTS "Enable build of collection of PROJ tests" ON)
boost_report_value(PROJ_TESTS)
if(PROJ_TESTS)
enable_testing()
endif()
include(ProjTest)

# Put the libraries and binaries that get built into directories at the
# top of the build tree rather than in hard-to-find leaf
# directories. This simplifies manual testing and the use of the build
Expand All @@ -245,6 +238,22 @@ set(INCLUDEDIR "${DEFAULT_INCLUDEDIR}"
set(CMAKECONFIGDIR "${DEFAULT_CMAKEDIR}"
CACHE PATH "The directory to install cmake config files into.")

################################################################################
# Tests
################################################################################
include(CTest)

# Support older option, to be removed by PROJ 8.0
if(DEFINED PROJ_TESTS)
message(DEPRECATION "PROJ_TESTS has been replaced with BUILD_TESTING")
set(BUILD_TESTING ${PROJ_TESTS})
endif()

boost_report_value(BUILD_TESTING)
if(BUILD_TESTING)
include(ProjTest)
endif()

################################################################################
# Build configured components
################################################################################
Expand All @@ -256,6 +265,6 @@ add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(man)
add_subdirectory(cmake)
if(PROJ_TESTS)
if(BUILD_TESTING)
add_subdirectory(test)
endif()
4 changes: 4 additions & 0 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ Tests are run with::
The test suite requires that the proj-datumgrid package is installed
in :envvar:`PROJ_LIB`.

If tests are not required, PROJ can be built without the test suite using the following configuration::

cmake -DBUILD_TESTING=OFF ..


Building on Windows with vcpkg and Visual Studio 2017 or 2019
--------------------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ endif()

if(BUILD_GEOD)
include(bin_geod.cmake)
include(bin_geodtest.cmake)
if(BUILD_TESTING)
include(bin_geodtest.cmake)
endif()
set(BIN_TARGETS ${BIN_TARGETS} geod)
endif()

Expand Down