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 3d8c2432b3737a911dbb77da74722f4803d28b36
Author: Jochen Topf <joc...@topf.org>
Date:   Mon Jul 21 15:48:34 2014 +0200

    Add cmake build stuff.
    
    This does work but probably needs some polish before we get rid of the old
    Makefile.
---
 .gitignore               |  1 +
 CMakeLists.txt           | 94 ++++++++++++++++++++++++++++++++++++++++++++++++
 cmake/FindCryptopp.cmake | 34 ++++++++++++++++++
 cmake/FindOSMPBF.cmake   | 49 +++++++++++++++++++++++++
 cmake/FindOsmium.cmake   | 29 +++++++++++++++
 src/CMakeLists.txt       | 24 +++++++++++++
 src/command_fileinfo.cpp |  6 +++-
 7 files changed, 236 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index dfd5ee4..e4f8bf8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ osmium
 src/*.o
 doc/*.1
 doc/*.html
+build/*
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..747e422
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,94 @@
+
+project(osmium)
+
+set(OSMIUM_VERSION 0.0.1)
+
+cmake_minimum_required(VERSION 2.8.5)
+
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+
+#----------------------------------------------------------------------
+find_package(Threads REQUIRED)
+
+find_package(ZLIB REQUIRED)
+include_directories(${ZLIB_INCLUDE_DIRS})
+
+find_package(BZip2 REQUIRED)
+include_directories(${BZIP2_INCLUDE_DIRS})
+
+find_package(EXPAT REQUIRED)
+include_directories(${EXPAT_INCLUDE_DIRS})
+
+find_package(Protobuf REQUIRED)
+include_directories(${PROTOBUF_INCLUDE_DIRS})
+
+find_package(Boost COMPONENTS program_options REQUIRED)
+include_directories(${BOOST_INCLUDE_DIRS})
+
+find_package(Cryptopp REQUIRED)
+include_directories(${CRYPTOPP_INCLUDE_DIRS})
+
+find_package(OSMPBF REQUIRED)
+include_directories(${OSMPBF_INCLUDE_DIRS})
+
+find_package(Osmium REQUIRED)
+include_directories(${OSMIUM_INCLUDE_DIRS})
+
+#----------------------------------------------------------------------
+add_subdirectory(src)
+
+install(FILES README.md DESTINATION share/doc/osmium)
+
+#----------------------------------------------------------------------
+message(STATUS "Looking for cppcheck")
+find_program(CPPCHECK cppcheck)
+
+if(CPPCHECK)
+    message(STATUS "Looking for cppcheck - found")
+    set(CPPCHECK_OPTIONS 
--enable=warning,style,performance,portability,information,missingInclude)
+
+    # cpp doesn't find system includes for some reason, suppress that report
+    set(CPPCHECK_OPTIONS ${CPPCHECK_OPTIONS} --suppress=missingIncludeSystem)
+
+    add_custom_target(cppcheck ${CPPCHECK} --std=c++11 ${CPPCHECK_OPTIONS} 
${CMAKE_SOURCE_DIR}/src/*pp)
+else()
+    message(STATUS "Looking for cppcheck - not found")
+    message(STATUS "  Make target cppcheck not available")
+endif()
+
+
+#----------------------------------------------------------------------
+message(STATUS "Looking for pandoc")
+find_program(PANDOC pandoc)
+
+if(PANDOC)
+    message(STATUS "Looking for pandoc - found")
+    message(STATUS "  Manual pages will be built")
+    execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE PUBDATE 
OUTPUT_STRIP_TRAILING_WHITESPACE)
+    set(PANDOC_MAN_OPTIONS -s -t man --template 
${CMAKE_CURRENT_SOURCE_DIR}/doc/manpage.template --variable 
"description=osmium/${OSMIUM_VERSION}" --variable "date=${PUBDATE}")
+    set(PANDOC_HTML_OPTIONS -s -t html)
+
+    set(MAN_PAGES_1 osmium.1 osmium-apply-changes.1 osmium-cat.1 
osmium-fileinfo.1 osmium-merge-changes.1 osmium-time-filter.1)
+    set(MAN_PAGES_5 osmium-file-formats.5)
+    set(MAN_NAMES ${MAN_PAGES_1} ${MAN_PAGES_5})
+    set(MAN_FILES)
+    foreach(m IN LISTS MAN_NAMES)
+        set(mf ${CMAKE_BINARY_DIR}/${m})
+        string(REGEX REPLACE ".[0-9]\$" "" mws "${m}")
+        set(ms ${CMAKE_SOURCE_DIR}/doc/${mws}.md)
+        add_custom_command(OUTPUT ${mf}
+            COMMAND ${PANDOC} ${PANDOC_MAN_OPTIONS} -o ${mf} ${ms}
+            DEPENDS ${ms}
+            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+            COMMENT "Building manpage ${mf}"
+            VERBATIM)
+        list(APPEND MAN_FILES ${mf})
+    endforeach()
+
+    add_custom_target(man ALL DEPENDS ${MAN_FILES})
+else()
+    message(STATUS "Looking for pandoc - not found")
+    message(STATUS "  Manual pages will not be built")
+endif()
+
+#----------------------------------------------------------------------
diff --git a/cmake/FindCryptopp.cmake b/cmake/FindCryptopp.cmake
new file mode 100644
index 0000000..3a9f7c8
--- /dev/null
+++ b/cmake/FindCryptopp.cmake
@@ -0,0 +1,34 @@
+# - Find cryptopp
+# Find the native CRYPTOPP headers and libraries.
+#
+#  CRYPTOPP_INCLUDE_DIRS - where to find include files
+#  CRYPTOPP_LIBRARIES    - List of libraries when using cryptopp.
+#  CRYPTOPP_FOUND        - True if cryptopp found.
+
+# The library is called 'crypto++' on Linux, on OS/X it is called 'cryptopp'.
+
+# Look for the header file.
+find_path(CRYPTOPP_INCLUDE_DIR NAMES crypto++/sha.h)
+
+if(NOT CRYPTOPP_INCLUDE_DIR)
+    find_path(CRYPTOPP_INCLUDE_DIR NAMES cryptopp/sha.h)
+    if(CRYPTOPP_INCLUDE_DIR)
+        set(USE_CRYPTOPP 1)
+    endif()
+endif()
+
+# Look for the library.
+find_library(CRYPTOPP_LIBRARY NAMES crypto++ libcrypto++ cryptopp libcryptopp)
+
+# handle the QUIETLY and REQUIRED arguments and set CRYPTOPP_FOUND to TRUE if
+# all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CRYPTOPP
+                                  REQUIRED_VARS CRYPTOPP_LIBRARY 
CRYPTOPP_INCLUDE_DIR)
+
+# Copy the results to the output variables.
+if(CRYPTOPP_FOUND)
+  set(CRYPTOPP_INCLUDE_DIRS ${CRYPTOPP_INCLUDE_DIR})
+  set(CRYPTOPP_LIBRARIES ${CRYPTOPP_LIBRARY})
+endif()
+
diff --git a/cmake/FindOSMPBF.cmake b/cmake/FindOSMPBF.cmake
new file mode 100644
index 0000000..168d064
--- /dev/null
+++ b/cmake/FindOSMPBF.cmake
@@ -0,0 +1,49 @@
+# Locate OSMPBF library
+# This module defines
+#  OSMPBF_FOUND, if false, do not try to link to OSMPBF
+#  OSMPBF_LIBRARIES
+#  OSMPBF_INCLUDE_DIRS, where to find OSMPBF.hpp
+#
+# Note that the expected include convention is
+#  #include <osmpbf/osmpbf.h>
+# and not
+#  #include <osmpbf.h>
+
+FIND_PATH(OSMPBF_INCLUDE_DIR osmpbf/osmpbf.h
+  HINTS
+  $ENV{OSMPBF_DIR}
+  PATH_SUFFIXES include
+  PATHS
+  ~/Library/Frameworks
+  /Library/Frameworks
+  /usr/local
+  /usr
+  /opt/local # DarwinPorts
+  /opt
+)
+
+FIND_LIBRARY(OSMPBF_LIBRARY
+  NAMES osmpbf
+  HINTS
+  $ENV{OSMPBF_DIR}
+  PATH_SUFFIXES lib64 lib
+  PATHS
+  ~/Library/Frameworks
+  /Library/Frameworks
+  /usr/local
+  /usr
+  /opt/local
+  /opt
+)
+
+INCLUDE(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set OSMPBF_FOUND to TRUE if
+# all listed variables are TRUE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSMPBF DEFAULT_MSG OSMPBF_LIBRARY 
OSMPBF_INCLUDE_DIR)
+
+# Copy the results to the output variables.
+if(OSMPBF_FOUND)
+  set(OSMPBF_INCLUDE_DIRS ${OSMPBF_INCLUDE_DIR})
+  set(OSMPBF_LIBRARIES ${OSMPBF_LIBRARY})
+endif()
+
diff --git a/cmake/FindOsmium.cmake b/cmake/FindOsmium.cmake
new file mode 100644
index 0000000..07a1a93
--- /dev/null
+++ b/cmake/FindOsmium.cmake
@@ -0,0 +1,29 @@
+# - Find Osmium
+# Find the Osmium headers.
+#
+#  OSMIUM_INCLUDE_DIRS - Where to find include files.
+#  OSMIUM_FOUND        - True if Osmium found.
+
+# Look for the header file.
+find_path(OSMIUM_INCLUDE_DIR osmium/osm.hpp
+    PATH_SUFFIXES include
+    PATHS
+    ../libosmium
+    ~/Library/Frameworks
+    /Library/Frameworks
+    /usr/local
+    /usr/
+    /opt/local # DarwinPorts
+    /opt
+)
+
+# handle the QUIETLY and REQUIRED arguments and set OSMIUM_FOUND to TRUE if
+# all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSMIUM REQUIRED_VARS OSMIUM_INCLUDE_DIR)
+
+# Copy the results to the output variables.
+if(OSMIUM_FOUND)
+  set(OSMIUM_INCLUDE_DIRS ${OSMIUM_INCLUDE_DIR})
+endif()
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..96b5431
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,24 @@
+
+add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64)
+
+if(USE_CRYPTOPP)
+    add_definitions(-DUSE_CRYPTOPP=${USE_CRYPTOPP})
+endif()
+
+add_compile_options(-O3)
+add_compile_options(-std=c++11)
+add_compile_options(-Wall -Wextra -pedantic -Wredundant-decls 
-Wdisabled-optimization -Wctor-dtor-privacy -Wnon-virtual-dtor 
-Woverloaded-virtual -Wsign-promo -Wold-style-cast)
+
+if(APPLE)
+    add_compile_options(-stdlib=libc++)
+    set(LDFLAGS ${LDFLAGS} -stdlib=libc++)
+endif(APPLE)
+
+file(GLOB OSMIUM_SOURCE_FILES *.cpp)
+
+add_executable(osmium ${OSMIUM_SOURCE_FILES})
+
+target_link_libraries(osmium ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES} 
${BZIP2_LIBRARIES} ${EXPAT_LIBRARIES} ${PROTOBUF_LITE_LIBRARIES} 
${Boost_LIBRARIES} ${CRYPTOPP_LIBRARIES} ${OSMPBF_LIBRARY})
+
+install(TARGETS osmium DESTINATION bin)
+
diff --git a/src/command_fileinfo.cpp b/src/command_fileinfo.cpp
index 8d9349d..a850bf5 100644
--- a/src/command_fileinfo.cpp
+++ b/src/command_fileinfo.cpp
@@ -29,7 +29,11 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 #include <boost/program_options.hpp>
 namespace po = boost::program_options;
 
-#include <crypto++/sha.h>
+#ifdef USE_CRYPTOPP
+# include <cryptopp/sha.h>
+#else
+# include <crypto++/sha.h>
+#endif
 
 #include <osmium/io/any_input.hpp>
 #include <osmium/handler.hpp>

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

_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

Reply via email to