diff options
| -rw-r--r-- | docs/source/install.rst | 24 | ||||
| -rw-r--r-- | src/CMakeLists.txt | 20 | ||||
| -rw-r--r-- | src/bin_gie.cmake | 6 | ||||
| -rwxr-xr-x | test/fuzzers/build.sh | 16 |
4 files changed, 46 insertions, 20 deletions
diff --git a/docs/source/install.rst b/docs/source/install.rst index 73cc6e00..208b55d4 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -322,33 +322,43 @@ CMake configure options Options to configure a CMake are provided using ``-D<var>=<value>``. All cached entries can be viewed using ``cmake -LAH`` from a build directory. +.. option:: BUILD_APPS=ON + + Build PROJ applications. Default is ON. Control the default value for + BUILD_CCT, BUILD_CS2CS, BUILD_GEOD, BUILD_GIE, BUILD_PROJ, BUILD_PROJINFO + and BUILD_PROJSYNC. + Note that changing its value after having configured once will not change + the value of the individual BUILD_CCT, ... options. + + .. versionchanged:: 8.2 + .. option:: BUILD_CCT=ON - Build :ref:`cct`, default ON. + Build :ref:`cct`, default is the value of BUILD_APPS. .. option:: BUILD_CS2CS=ON - Build :ref:`cs2cs`, default ON. + Build :ref:`cs2cs`,default is the value of BUILD_APPS. .. option:: BUILD_GEOD=ON - Build :ref:`geod`, default ON. + Build :ref:`geod`, default is the value of BUILD_APPS. .. option:: BUILD_GIE=ON - Build :ref:`gie`, default ON. + Build :ref:`gie`, default is the value of BUILD_APPS. .. option:: BUILD_PROJ=ON - Build :ref:`proj`, default ON. + Build :ref:`proj`, default is the value of BUILD_APPS. .. option:: BUILD_PROJINFO=ON - Build :ref:`projinfo`, default ON. + Build :ref:`projinfo`, default is the value of BUILD_APPS. .. option:: BUILD_PROJSYNC=ON - Build :ref:`projsync`, default ON. + Build :ref:`projsync`, default is the value of BUILD_APPS. .. option:: BUILD_SHARED_LIBS diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 534bc311..311cdbac 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,20 +3,23 @@ include(lib_proj.cmake) # configure executable build +option(BUILD_APPS + "Build PROJ applications (default value for BUILD_CCT, BUILD_CS2CS, etc.)" ON) + option(BUILD_CCT - "Build cct (coordinate conversion and transformation tool)" ON) + "Build cct (coordinate conversion and transformation tool)" "${BUILD_APPS}") option(BUILD_CS2CS - "Build cs2cs (coordinate systems to coordinate systems translation tool)" ON) + "Build cs2cs (coordinate systems to coordinate systems translation tool)" "${BUILD_APPS}") option(BUILD_GEOD - "Build geod (computation of geodesic lines)" ON) + "Build geod (computation of geodesic lines)" "${BUILD_APPS}") option(BUILD_GIE - "Build gie (geospatial integrity investigation environment)" ON) + "Build gie (geospatial integrity investigation environment)" "${BUILD_APPS}") option(BUILD_PROJ - "Build proj (cartographic projection tool)" ON) + "Build proj (cartographic projection tool)" "${BUILD_APPS}") option(BUILD_PROJINFO - "Build projinfo (SRS and coordinate operation metadata/query tool)" ON) + "Build projinfo (SRS and coordinate operation metadata/query tool)" "${BUILD_APPS}") option(BUILD_PROJSYNC - "Build projsync (synchronize transformation support data)" ON) + "Build projsync (synchronize transformation support data)" "${BUILD_APPS}") if(NOT MSVC) @@ -69,7 +72,8 @@ if(BUILD_PROJINFO) set(BIN_TARGETS ${BIN_TARGETS} binprojinfo) endif() -if(BUILD_GIE) +# Always build gie if testing is requested +if(BUILD_GIE OR BUILD_TESTING) include(bin_gie.cmake) set(BIN_TARGETS ${BIN_TARGETS} gie) endif() diff --git a/src/bin_gie.cmake b/src/bin_gie.cmake index a26ead3e..6ad7d4ab 100644 --- a/src/bin_gie.cmake +++ b/src/bin_gie.cmake @@ -11,8 +11,10 @@ add_executable(gie ${GIE_SRC} ${GIE_INCLUDE}) target_link_libraries(gie PRIVATE ${PROJ_LIBRARIES}) target_compile_options(gie PRIVATE ${PROJ_CXX_WARN_FLAGS}) -install(TARGETS gie - DESTINATION ${BINDIR}) +if(BUILD_GIE) + install(TARGETS gie + DESTINATION ${BINDIR}) +endif() if(MSVC AND BUILD_SHARED_LIBS) target_compile_definitions(gie PRIVATE PROJ_MSVC_DLL_IMPORT=1) diff --git a/test/fuzzers/build.sh b/test/fuzzers/build.sh index 54909fea..25c43fa2 100755 --- a/test/fuzzers/build.sh +++ b/test/fuzzers/build.sh @@ -50,10 +50,20 @@ make -j$(nproc) make install cd .. -./autogen.sh -SQLITE3_CFLAGS=-I/usr/include SQLITE3_LIBS=-lsqlite3 TIFF_CFLAGS=-I$SRC/install/include TIFF_LIBS="-L$SRC/install/lib -ltiff" ./configure --disable-shared --with-curl=$SRC/install/bin/curl-config +mkdir build +cd build +cmake .. -DBUILD_SHARED_LIBS:BOOL=OFF \ + -DCURL_INCLUDE_DIR:PATH="$SRC/install/include" \ + -DCURL_LIBRARY_RELEASE:FILEPATH="$SRC/install/lib/libcurl.a" \ + -DTIFF_INCLUDE_DIR:PATH="$SRC/install/include" \ + -DTIFF_LIBRARY_RELEASE:FILEPATH="$SRC/install/lib/libtiff.a" \ + -DCMAKE_INSTALL_PREFIX=$SRC/install \ + -DBUILD_APPS:BOOL=OFF \ + -DBUILD_TESTING:BOOL=OFF make clean -s make -j$(nproc) -s +make install +cd .. EXTRA_LIBS="-lpthread -Wl,-Bstatic -lsqlite3 -L$SRC/install/lib -ltiff -lcurl -lssl -lcrypto -lz -Wl,-Bdynamic" @@ -66,7 +76,7 @@ build_fuzzer() echo "Building fuzzer $fuzzerName" $CXX $CXXFLAGS -std=c++11 -fvisibility=hidden -Isrc -Iinclude \ $sourceFilename $* -o $OUT/$fuzzerName \ - $LIB_FUZZING_ENGINE src/.libs/libproj.a $EXTRA_LIBS + $LIB_FUZZING_ENGINE "$SRC/install/lib/libproj.a" $EXTRA_LIBS } build_fuzzer proj_crs_to_crs_fuzzer test/fuzzers/proj_crs_to_crs_fuzzer.cpp |
