Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Removed autotools makefiles, installed cmake build system
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Gilbert committed Oct 15, 2014
1 parent cf50d5a commit 5f748af
Show file tree
Hide file tree
Showing 20 changed files with 488 additions and 854 deletions.
36 changes: 1 addition & 35 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,40 +1,6 @@
# http://www.gnu.org/software/automake
Makefile.in

# http://www.gnu.org/software/autoconf
/autom4te.cache
/aclocal.m4
/compile
/configure
/depcomp
/install-sh
/missing
/build-aux

# Generated files
autoscan.log
libtool
ltmain.sh
stamp-h1
config.*
Makefile
Makefile.in
.deps
.libs
src/served/version.hpp
*.o
*.lo
*.la
*_test
coverage.info
coverage
*.gcno
*.gcda
Doxyfile
/doc
.dirstamp
*.pc
*.log
*.trs

# Hideous eclipse
.autotools
Expand Down
102 changes: 102 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Copyright (C) 2014 MediaSift Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

#
# Project Properties
#
CMAKE_MINIMUM_REQUIRED (VERSION 2.6.2)
PROJECT (served)
SET (APPLICATION_NAME "Served HTTP REST Library")
SET (APPLICATION_CODENAME "${PROJECT_NAME}")
SET (APPLICATION_COPYRIGHT_YEARS "2014")
SET (APPLICATION_VERSION_MAJOR 1)
SET (APPLICATION_VERSION_MINOR 0)
SET (APPLICATION_VERSION_PATCH 0)
SET (APPLICATION_VERSION_TYPE DS1)
SET (APPLICATION_VERSION_STRING "${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINOR}.${APPLICATION_VERSION_PATCH}-${APPLICATION_VERSION_TYPE}")
SET (APPLICATION_VENDOR_ID "com.datasift")
SET (APPLICATION_VENDOR_NAME "DataSift")
SET (APPLICATION_VENDOR_URL "datasift.com")
SET (APPLICATION_ID "${APPLICATION_VENDOR_ID}.${PROJECT_NAME}")

#
# Configurable Options
#
OPTION (SERVED_BUILD_SHARED "Build shared object" ON)
OPTION (SERVED_BUILD_STATIC "Build static library" OFF)
OPTION (SERVED_BUILD_TESTS "Build unit test suite" ON)

#
# Debugging Options
#
SET (CMAKE_VERBOSE_MAKEFILE 0) # Use 1 for debugging, 0 for release

#
# Project Output Paths
#
SET (MAINFOLDER ${PROJECT_SOURCE_DIR})
SET (EXECUTABLE_OUTPUT_PATH "${MAINFOLDER}/bin")
SET (LIBRARY_OUTPUT_PATH "${MAINFOLDER}/lib")

#
# Project Search Paths
#
LIST (APPEND CMAKE_PREFIX_PATH "${MAINFOLDER}")
SET (CMAKE_MODULE_PATH "${MAINFOLDER}/cmake")
INCLUDE_DIRECTORIES ("${MAINFOLDER}/src")

#
# Locate Project Prerequisites
#
FIND_PACKAGE (Boost 1.53 COMPONENTS "system" REQUIRED)
INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES (${Boost_LIBRARY_DIRS})

INCLUDE (FindRAGEL)
FIND_PACKAGE (RAGEL)

INCLUDE (EnableStdCXX11)
ENABLE_STDCXX11 ()

#
# Configure Files
#
FILE (GLOB_RECURSE CONFIGINPUTS1 src/served/*.hpp.in.cmake)
LIST (APPEND CONFIGINPUTS "${CONFIGINPUTS1}")
FOREACH (CONFIGINPUT ${CONFIGINPUTS})
STRING (REPLACE ".hpp.in.cmake" ".hpp" CONFIGOUTPUT "${CONFIGINPUT}")
CONFIGURE_FILE ("${CONFIGINPUT}" "${CONFIGOUTPUT}")
ENDFOREACH (CONFIGINPUT ${CONFIGINPUTS})

#
# Add Build Targets
#
ADD_SUBDIRECTORY (src)
IF (SERVED_BUILD_TESTS)
ENABLE_TESTING (true)
ADD_SUBDIRECTORY (test)
ENDIF (SERVED_BUILD_TESTS)

#
# Add Install Targets
#
IF (EXISTS "${MAINFOLDER}/src/${PROJECT_NAME}" AND IS_DIRECTORY "${MAINFOLDER}/src/${PROJECT_NAME}")
INSTALL (DIRECTORY "${MAINFOLDER}/src/${PROJECT_NAME}" DESTINATION "${PROJECT_NAME}")
ENDIF (EXISTS "${MAINFOLDER}/src/${PROJECT_NAME}" AND IS_DIRECTORY "${MAINFOLDER}/src/${PROJECT_NAME}")
71 changes: 0 additions & 71 deletions Makefile.am

This file was deleted.

74 changes: 0 additions & 74 deletions Makefile.am.coverage

This file was deleted.

2 changes: 0 additions & 2 deletions autogen.sh

This file was deleted.

1 change: 1 addition & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
served_test
36 changes: 36 additions & 0 deletions cmake/EnableStdCXX11.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# ====================================================================
# Copyright (C) 2014 MediaSift Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# ====================================================================

include(CheckCXXCompilerFlag)

macro(ENABLE_STDCXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)

if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
endmacro()
Loading

0 comments on commit 5f748af

Please sign in to comment.