Skip to content

Commit

Permalink
First commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Apr 26, 2016
0 parents commit fd37227
Show file tree
Hide file tree
Showing 15 changed files with 4,265 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.ycm_extra_conf.pyc
46 changes: 46 additions & 0 deletions .ycm_extra_conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#-----------------------------------------------------------------------------
#
# Configuration for YouCompleteMe Vim plugin
#
# http://valloric.github.io/YouCompleteMe/
#
#-----------------------------------------------------------------------------

from os.path import realpath, dirname

basedir = dirname(realpath(__file__))

# some default flags
# for more information install clang-3.2-doc package and
# check UsersManual.html
flags = [
'-Werror',
'-Wall',
'-Wextra',
'-pedantic',
'-Wno-return-type',
'-Wno-unused-parameter',
'-Wno-unused-variable',

'-std=c++11',

# '-x' and 'c++' also required
# use 'c' for C projects
'-x',
'c++',

# libosmium include dirs
'-I%s/../libosmium/include' % basedir,
'-I/usr/include/gdal',
'-Iinclude',

]

# youcompleteme is calling this function to get flags
# You can also set database for flags. Check: JSONCompilationDatabase.html in
# clang-3.2-doc package
def FlagsForFile( filename ):
return {
'flags': flags,
'do_cache': True
}
149 changes: 149 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
#-----------------------------------------------------------------------------
#
# CMake Config
#
# OSM Area Tools
#
#-----------------------------------------------------------------------------

cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)


#-----------------------------------------------------------------------------
#
# Project version
#
#-----------------------------------------------------------------------------

project(osmium-area)

set(OAT_VERSION_MAJOR 0)
set(OAT_VERSION_MINOR 0)
set(OAT_VERSION_PATCH 1)

set(OAT_VERSION
${OAT_VERSION_MAJOR}.${OAT_VERSION_MINOR}.${OAT_VERSION_PATCH})

set(AUTHOR "Jochen Topf <jochen@topf.org>")


#-----------------------------------------------------------------------------
#
# Find external dependencies
#
#-----------------------------------------------------------------------------

find_package(Osmium COMPONENTS io ogr geos)
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS} include)


#-----------------------------------------------------------------------------
#
# Decide which C++ version to use (Minimum/default: C++11).
#
#-----------------------------------------------------------------------------
if(NOT MSVC)
if(NOT USE_CPP_VERSION)
set(USE_CPP_VERSION c++11)
endif()
message(STATUS "Use C++ version: ${USE_CPP_VERSION}")
# following only available from cmake 2.8.12:
# add_compile_options(-std=${USE_CPP_VERSION})
# so using this instead:
add_definitions(-std=${USE_CPP_VERSION})
endif()


#-----------------------------------------------------------------------------
#
# Compiler and Linker flags
#
#-----------------------------------------------------------------------------
set(USUAL_COMPILE_OPTIONS "-O3 -g -fno-omit-frame-pointer")

set(CMAKE_CXX_FLAGS_DEV "${USUAL_COMPILE_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
)

set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${USUAL_COMPILE_OPTIONS}"
CACHE STRING "Flags used by the compiler during RELWITHDEBINFO builds."
FORCE)


#-----------------------------------------------------------------------------
#
# Build Type
#
#-----------------------------------------------------------------------------
set(CMAKE_CONFIGURATION_TYPES "Debug Release RelWithDebInfo MinSizeRel 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 -fno-omit-frame-pointer)
endif()
add_definitions(${OSMIUM_WARNING_OPTIONS})
endif()

# Force RelWithDebInfo build type if none was given
if(CMAKE_BUILD_TYPE)
set(build_type ${CMAKE_BUILD_TYPE})
else()
set(build_type "RelWithDebInfo")
endif()

set(CMAKE_BUILD_TYPE ${build_type}
CACHE STRING
"Choose the type of build, options are: ${CMAKE_CONFIGURATION_TYPES}."
FORCE)


#-----------------------------------------------------------------------------
#
# Optional "cppcheck" target that checks C++ code
#
#-----------------------------------------------------------------------------
message(STATUS "Looking for cppcheck")
find_program(CPPCHECK cppcheck)

if(CPPCHECK)
message(STATUS "Looking for cppcheck - found")
set(CPPCHECK_OPTIONS --enable=all)

# cpp doesn't find system includes for some reason, suppress that report
set(CPPCHECK_OPTIONS ${CPPCHECK_OPTIONS} --suppress=missingIncludeSystem)

file(GLOB ALL_CODE src/*.cpp)

set(CPPCHECK_FILES ${ALL_CODE})

add_custom_target(cppcheck
${CPPCHECK}
--std=c++11 ${CPPCHECK_OPTIONS}
${CPPCHECK_FILES}
)
else()
message(STATUS "Looking for cppcheck - not found")
message(STATUS " Build target 'cppcheck' will not be available.")
endif(CPPCHECK)


#-----------------------------------------------------------------------------

add_definitions(${OSMIUM_WARNING_OPTIONS})

add_subdirectory(src)


#-----------------------------------------------------------------------------
Loading

0 comments on commit fd37227

Please sign in to comment.