Skip to content

Commit

Permalink
CMake: remove unused options, mark some as advanced
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 14, 2022
1 parent 52a9174 commit 1fbdf1c
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 24 deletions.
18 changes: 8 additions & 10 deletions alg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,14 @@ endif ()
target_include_directories(alg PRIVATE ${PROJ_INCLUDE_DIRS})
gdal_add_private_link_libraries(PROJ::PROJ)

if (GDAL_ENABLE_QHULL)
if (GDAL_USE_QHULL_INTERNAL)
target_compile_definitions(alg PRIVATE -DINTERNAL_QHULL)
target_sources(alg PRIVATE internal_qhull_headers.h)
target_include_directories(alg PRIVATE internal_libqhull)
else ()
target_compile_definitions(alg PRIVATE -DEXTERNAL_QHULL)
target_include_directories(alg PRIVATE ${QHULL_INCLUDE_DIR})
gdal_add_private_link_libraries(${QHULL_LIBRARY})
endif ()
if (GDAL_USE_QHULL_INTERNAL)
target_compile_definitions(alg PRIVATE -DINTERNAL_QHULL)
target_sources(alg PRIVATE internal_qhull_headers.h)
target_include_directories(alg PRIVATE internal_libqhull)
elseif (GDAL_USE_QHULL)
target_compile_definitions(alg PRIVATE -DEXTERNAL_QHULL)
target_include_directories(alg PRIVATE ${QHULL_INCLUDE_DIR})
gdal_add_private_link_libraries(${QHULL_LIBRARY})
endif ()

if (HAVE_SSE_AT_COMPILE_TIME)
Expand Down
2 changes: 2 additions & 0 deletions autotest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# CMake4GDAL project is distributed under X/MIT license. See accompanying file LICENSE.txt.

#[[
option(AUTOTEST_DOWNLOAD_TEST_DATA "Autotest to download test data" OFF)
option(AUTOTEST_SLOW_TEST "Autotest to run slow test" OFF)
if (NOT DEFINED ENV{CTEST_PARALLEL_LEVEL})
set(PARALLEL_OPTION "-j1")
endif ()
]]

if (Python_Interpreter_FOUND)

Expand Down
4 changes: 3 additions & 1 deletion cmake/helpers/CheckDependentLibraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ endif ()
cmake_dependent_option(GDAL_USE_OPENSSL "Set ON to use OpenSSL" ON OPENSSL_FOUND OFF)

gdal_check_package(CryptoPP "Use crypto++ library for CPL." CAN_DISABLE)
option(CRYPTOPPL_USE_ONLY_CRYPTODLL_ALG "Use Only cryptoDLL alg. only work on dynamic DLL" OFF)
if (GDAL_USE_CRYPTOPP)
option(CRYPTOPP_USE_ONLY_CRYPTODLL_ALG "Use Only cryptoDLL alg. only work on dynamic DLL" OFF)
endif ()

find_package(PROJ 6.0 REQUIRED)

Expand Down
2 changes: 2 additions & 0 deletions cmake/helpers/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ else ()
endif ()

find_library(M_LIB m)
mark_as_advanced(M_LIB)

option(GDAL_USE_CPL_MULTIPROC_PTHREAD "Set to ON if you want to use pthreads based multiprocessing support."
${_WITH_PT_OPTION_ON})
mark_as_advanced(GDAL_USE_CPL_MULTIPROC_PTHREAD)
set(CPL_MULTIPROC_PTHREAD ${GDAL_USE_CPL_MULTIPROC_PTHREAD})
check_c_source_compiles(
"
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/packages/FindBlosc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ if(NOT BLOSC_FOUND)

find_path(BLOSC_INCLUDE_DIR blosc.h ${BLOSC_INCLUDE_OPTS})
find_library(BLOSC_LIBRARY blosc ${BLOSC_LIBRARY_OPTS})
mark_as_advanced(BLOSC_INCLUDE_DIR BLOSC_LIBRARY)
if(BLOSC_INCLUDE_DIR)
file(STRINGS ${BLOSC_INCLUDE_DIR}/blosc.h _ver_strings
REGEX "BLOSC_VERSION_[^ ]* [0-9]+"
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/packages/FindHDF4.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ find_path(HDF4_INCLUDE_DIR hdf.h
hdf
hdf4
)
mark_as_advanced(HDF4_INCLUDE_DIR)

if(HDF4_INCLUDE_DIR AND EXISTS "${HDF4_INCLUDE_DIR}/hfile.h")
file(STRINGS "${HDF4_INCLUDE_DIR}/hfile.h" hdf4_version_string
Expand Down
4 changes: 3 additions & 1 deletion cmake/modules/thirdparty/FindInt128.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@ if(INT128_TEST)
else(INT128_TEST)
set(INT128_FOUND FALSE CACHE BOOL "NOT Found 128-bit integer type")
endif(INT128_TEST)
mark_as_advanced(INT128_TYPE)
mark_as_advanced(INT128_FOUND)

set(CMAKE_REQUIRED_DEFINITIONS ${SAFE_CMAKE_REQUIRED_DEFINITIONS})
set(CMAKE_REQUIRED_DEFINITIONS ${SAFE_CMAKE_REQUIRED_DEFINITIONS})
5 changes: 5 additions & 0 deletions doc/source/build_hints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ It is also required for the :ref:`/vsicrypt/ <vsicrypt>` virtual file system.
``CRYPTOPP_LIBRARY_DEBUG`` can also be specified to a similar library for
building Debug releases.

.. option:: CRYPTOPP_USE_ONLY_CRYPTODLL_ALG=ON/OFF

Defaults to OFF. Might be required to set to ON when linking against
cryptopp.dll

.. option:: GDAL_USE_CRYPTOPP=ON/OFF

Control whether to use CryptoPP. Defaults to ON when CryptoPP is found.
Expand Down
9 changes: 4 additions & 5 deletions gdal.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# CMake4GDAL project is distributed under X/MIT license. See accompanying file LICENSE.txt.

# Switches to control build targets(cached)
option(ENABLE_GNM "Build GNM module" ON)
option(ENABLE_PAM "Set ON to enable pam" ON)
option(BUILD_APPS "Build command utilities" ON)
option(BUILD_DOCS "Build documents" ON)
option(ENABLE_GNM "Build GNM (Geography Network Model) component" ON)
option(ENABLE_PAM "Set ON to enable Persistent Auxiliary Metadata (.aux.xml)" ON)
option(BUILD_APPS "Build command line utilities" ON)
option(BUILD_DOCS "Build documentation" ON)

# This option is to build drivers as plugins, for drivers that have external dependencies, that are not parf of GDAL
# core dependencies Examples are netCDF, HDF4, Oracle, PDF, etc. This global setting can be overridden at the driver
Expand All @@ -16,7 +16,6 @@ option(GDAL_ENABLE_PLUGINS "Set ON to build drivers that have non-core external
option(GDAL_ENABLE_PLUGINS_NO_DEPS "Set ON to build drivers that have no non-core external dependencies as plugin" OFF)
mark_as_advanced(GDAL_ENABLE_PLUGINS_NO_DEPS)

option(GDAL_ENABLE_QHULL "use qhull" ON)
option(ENABLE_IPO "Enable Inter-Procedural Optimization if possible" OFF)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
option(GDAL_ENABLE_MACOSX_FRAMEWORK "Enable Framework on Mac OS X" OFF)
Expand Down
1 change: 0 additions & 1 deletion ogr/ogrsf_frmts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ ogr_optional_driver(dgn DGN)
ogr_optional_driver(gmt GMT)
ogr_optional_driver(ntf NTF)
ogr_optional_driver(rec REC)
option(ENABLE_S57_BUILTIN_CLASSES "Set ON to build s57 driver with builin classes" OFF)
ogr_optional_driver(s57 S57)
ogr_optional_driver(tiger "U.S. Census TIGER/Line")
ogr_optional_driver(geoconcept GEOCONCEPT)
Expand Down
7 changes: 1 addition & 6 deletions port/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,8 @@ if (GDAL_USE_OPENSSL
endif ()
endif ()

if (CRYPTOPP_USE_ONLY_CRYPTODLL_ALG AND NOT BUILD_SHARED_LIBS)
if (CRYPTOPP_USE_ONLY_CRYPTODLL_ALG)
# Define USE_ONLY_CRYPTODLL_ALG is running against cryptopp.dll, but not if statically linking
# USE_ONLY_CRYPTODLL_ALG=YES
#
# When linking against the DLL: CRYPTOPP_LIB = c:/install-cryptopp-x64/lib/cryptopp.lib
#
# When linking against the static lib: CRYPTOPP_LIB = c:/install-cryptopp-x64/lib/cryptlib.lib
target_compile_definitions(cpl PRIVATE -DUSE_ONLY_CRYPTODLL_ALG)
endif ()

Expand Down

0 comments on commit 1fbdf1c

Please sign in to comment.