[osmium-tool] 64/97: Build fixes: Dev build, Windows build. Cmake config cleanup.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Tue Jul 21 20:15:35 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 914e103b48f6cb459c8c04922ae6a0fb953e26cd
Author: Jochen Topf <jochen at topf.org>
Date:   Thu Jan 29 16:17:37 2015 +0100

    Build fixes: Dev build, Windows build. Cmake config cleanup.
---
 CMakeLists.txt           | 78 ++++++++++++++++++++++++++----------------------
 appveyor.yml             |  7 +++--
 src/CMakeLists.txt       |  7 +++++
 src/command_fileinfo.cpp |  4 +--
 4 files changed, 55 insertions(+), 41 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76ddf78..8e892b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,18 +1,20 @@
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 #
-#  Osmium Tool CMakeLists.txt
+#  CMake Config
 #
-#----------------------------------------------------------------------
+#  Osmium Tool
+#
+#-----------------------------------------------------------------------------
 
-cmake_minimum_required(VERSION 2.8.5)
+cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
 
 
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 #
 #  Project version
 #
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 
 project(osmium)
 
@@ -25,11 +27,11 @@ set(OSMIUM_VERSION ${OSMIUM_VERSION_MAJOR}.${OSMIUM_VERSION_MINOR}.${OSMIUM_VERS
 add_definitions(-DOSMIUM_VERSION="${OSMIUM_VERSION}")
 
 
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 #
 #  Find external dependencies
 #
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 
 find_package(Boost REQUIRED COMPONENTS program_options)
 include_directories(${Boost_INCLUDE_DIRS})
@@ -41,11 +43,11 @@ find_package(Cryptopp)
 include_directories(${CRYPTOPP_INCLUDE_DIRS})
 
 
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 #
 #  Optional "cppcheck" target that checks C++ code
 #
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 message(STATUS "Looking for cppcheck")
 find_program(CPPCHECK cppcheck)
 
@@ -63,11 +65,11 @@ else()
 endif(CPPCHECK)
 
 
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 #
 #  Optional "man" target to generate man pages
 #
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 message(STATUS "Looking for pandoc")
 find_program(PANDOC pandoc)
 
@@ -109,11 +111,11 @@ else()
 endif(PANDOC)
 
 
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 #
 #  Optional "format" target that formats C++ code
 #
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 message(STATUS "Looking for astyle")
 find_program(ASTYLE astyle)
 
@@ -127,11 +129,11 @@ else()
 endif(ASTYLE)
 
 
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 #
 #  Decide which C++ version to use (Minimum/default: C++11).
 #
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 
 if(NOT USE_CPP_VERSION)
     set(USE_CPP_VERSION c++11)
@@ -142,39 +144,43 @@ message(STATUS "Use C++ version: ${USE_CPP_VERSION}")
 # so using this instead:
 add_definitions(-std=${USE_CPP_VERSION})
 
-#----------------------------------------------------------------------
 
-set(CMAKE_CXX_FLAGS_NONE "-O3 -g"
-    CACHE STRING "Flags used by the compiler during all builds."
-    FORCE)
+#-----------------------------------------------------------------------------
+#
+#  Build Type
+#
+#-----------------------------------------------------------------------------
+set(CMAKE_CONFIGURATION_TYPES "Debug Release RelWithDebInfo MinSizeRel Dev")
 
-set(CMAKE_CXX_FLAGS_DEV "-O3 -g ${OSMIUM_WARNING_OPTIONS}"
-    CACHE STRING "Flags used by the compiler during developer builds."
-    FORCE)
-set(CMAKE_EXE_LINKER_FLAGS_DEV ""
-    CACHE STRING "Flags used by the linker during developer builds."
-    FORCE)
-mark_as_advanced(
-    CMAKE_CXX_FLAGS_DEV
-    CMAKE_EXE_LINKER_FLAGS_DEV
-)
+# In 'Dev' mode: compile with very strict warnings and turn them into errors.
+if(CMAKE_BUILD_TYPE STREQUAL "Dev")
+    if(NOT MSVC)
+        add_definitions(-Werror)
+    endif()
+    add_definitions(${OSMIUM_WARNING_OPTIONS})
+endif()
 
-set(CMAKE_CONFIGURATION_TYPES "Debug Release RelWithDebInfo MinSizeRel Dev")
+# Force RelWithDebInfo build type if none was given
+if(CMAKE_BUILD_TYPE)
+    set(build_type ${CMAKE_BUILD_TYPE})
+else()
+    set(build_type "RelWithDebInfo")
+endif()
 
-# Update the documentation string of CMAKE_BUILD_TYPE for GUIs
-set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
+set(CMAKE_BUILD_TYPE ${build_type}
+    CACHE STRING
     "Choose the type of build, options are: ${CMAKE_CONFIGURATION_TYPES}."
     FORCE)
 
 
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 
 include_directories(${PROJECT_BINARY_DIR}/src)
 
 add_subdirectory(src)
 
 
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
 if(NOT CRYPTOPP_FOUND)
     message(WARNING "=========================================================================
   Libcryptopp/crypto++ not found! - Some functionality will be missing.
@@ -184,4 +190,4 @@ if(NOT CRYPTOPP_FOUND)
 endif()
 
 
-#----------------------------------------------------------------------
+#-----------------------------------------------------------------------------
diff --git a/appveyor.yml b/appveyor.yml
index f103566..585cefe 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,6 +1,8 @@
+#-----------------------------------------------------------------------------
 #
-# Configuration for appveyor.com
+#  Configuration for continuous integration service at appveyor.com
 #
+#-----------------------------------------------------------------------------
 
 environment:
   matrix:
@@ -51,12 +53,11 @@ install:
   #- tree %LODEPSDIR%
   - cd c:\projects
   - git clone https://github.com/osmcode/libosmium.git
-  - git clone https://github.com/osmcode/osm-testdata.git
 
 build_script:
   - cd c:\projects\osmium-tool
   - mkdir build
   - cd build
   - cmake .. -LA -G "NMake Makefiles" -DOsmium_DEBUG=TRUE -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DBOOST_ROOT=%LODEPSDIR%\boost -DBoost_PROGRAM_OPTIONS_LIBRARY=%LODEPSDIR%\boost\lib\libboost_program_options-vc140-mt-1_57.lib -DOSMPBF_LIBRARY=%LODEPSDIR%\osmpbf\lib\osmpbf.lib -DOSMPBF_INCLUDE_DIR=%LODEPSDIR%\osmpbf\include -DPROTOBUF_LIBRARY=%LODEPSDIR%\protobuf\lib\libprotobuf.lib -DPROTOBUF_LITE_LIBRARY=%LODEPSDIR%\protobuf\lib\libprotobuf-lite.lib -DPROTOBUF_INCLUDE_DIR=%LODEPSDIR%\protobu [...]
-  - nmake
+  - nmake VERBOSE=1
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f325e0c..f910154 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,3 +1,10 @@
+#-----------------------------------------------------------------------------
+#
+#  CMake Config
+#
+#  Osmium Tool
+#
+#-----------------------------------------------------------------------------
 
 file(GLOB OSMIUM_SOURCE_FILES *.cpp)
 
diff --git a/src/command_fileinfo.cpp b/src/command_fileinfo.cpp
index 0fd6747..17a41a1 100644
--- a/src/command_fileinfo.cpp
+++ b/src/command_fileinfo.cpp
@@ -151,11 +151,11 @@ struct InfoHandler : public osmium::handler::Handler {
         ++nodes;
     }
 
-    void way(const osmium::Way& way) {
+    void way(const osmium::Way& /* way */) {
         ++ways;
     }
 
-    void relation(const osmium::Relation& relation) {
+    void relation(const osmium::Relation& /* relation */) {
         ++relations;
     }
 

-- 
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