[osmium-tool] 82/97: CMake: Add option to build with or without libcryptopp.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Tue Jul 21 20:15:38 UTC 2015


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to tag v1.0.0
in repository osmium-tool.

commit 1fb7cf84244d4affa0f47425048e8bc54d3e10d5
Author: Jochen Topf <jochen at topf.org>
Date:   Fri Jan 30 15:45:24 2015 +0100

    CMake: Add option to build with or without libcryptopp.
---
 CMakeLists.txt           | 18 +++++++++++++++---
 doc/osmium-fileinfo.md   |  2 +-
 src/command_fileinfo.cpp |  2 --
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4d6145c..0b84447 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,8 +39,13 @@ include_directories(${Boost_INCLUDE_DIRS})
 find_package(Osmium REQUIRED COMPONENTS io)
 include_directories(${OSMIUM_INCLUDE_DIRS})
 
-find_package(Cryptopp)
-include_directories(${CRYPTOPP_INCLUDE_DIRS})
+#-----------------------------------------------------------------------------
+option(BUILD_WITH_CRYPTOPP "Build using libcryptopp" ON)
+
+if(BUILD_WITH_CRYPTOPP)
+    find_package(Cryptopp)
+    include_directories(${CRYPTOPP_INCLUDE_DIRS})
+endif()
 
 
 #-----------------------------------------------------------------------------
@@ -203,6 +208,13 @@ do_test(help2    "osmium --help"    "^Usage: .*Commands are:")
 do_test(help_cat "osmium help cat"  "^OSMIUM-CAT\\(1\\)")
 
 
+if(BUILD_WITH_CRYPTOPP AND CRYPTOPP_FOUND)
+    do_test(version_sha "osmium --version" "\nSHA support: enabled\n")
+else()
+    do_test(version_sha "osmium --version" "\nSHA support: disabled\n")
+endif()
+
+
 #-----------------------------------------------------------------------------
 
 include_directories(${PROJECT_BINARY_DIR}/src)
@@ -211,7 +223,7 @@ add_subdirectory(src)
 
 
 #-----------------------------------------------------------------------------
-if(NOT CRYPTOPP_FOUND)
+if(BUILD_WITH_CRYPTOPP AND NOT CRYPTOPP_FOUND)
     message(WARNING "=========================================================================
   Libcryptopp/crypto++ not found! - Some functionality will be missing.
   Install the library/headers to fix this. You might have to set the
diff --git a/doc/osmium-fileinfo.md b/doc/osmium-fileinfo.md
index 49ec436..5ab3ab8 100644
--- a/doc/osmium-fileinfo.md
+++ b/doc/osmium-fileinfo.md
@@ -64,7 +64,7 @@ and with exit code 1 if some other error occurred.
 
 # NOTES
 
-Calculation of the SHA1 is only available when Osmium was compiled with support
+Calculation of the SHA1 is only available if Osmium was compiled with support
 for it. Check **osmium --version** to see whether thats the case.
 
 
diff --git a/src/command_fileinfo.cpp b/src/command_fileinfo.cpp
index 2666777..eea24fa 100644
--- a/src/command_fileinfo.cpp
+++ b/src/command_fileinfo.cpp
@@ -40,8 +40,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #ifdef OSMIUM_WITH_CRYPTOPP
 # include <cryptopp/sha.h>
-#else
-# pragma message("Compiling without libcryptopp - fileinfo SHA will not be available")
 #endif
 
 bool CommandFileinfo::setup(const std::vector<std::string>& arguments) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osmium-tool.git



More information about the Pkg-grass-devel mailing list