Commit b6d97ffa authored by Mateusz Loskot's avatar Mateusz Loskot

Implement new source tree layout #125

First set of changes incorporating new structure of source tree.
It also applies some of changes planned as part of buried headers feature #25

Work in progress, requires testing before merging into develop branch
parent e62595ab
*.swp
*.kate-swp
_build*
src/build
tags
tmp
*.swp
*.kate-swp
###############################################################################
#
# This file is part of CMake configuration for SOCI library
#
# Copyright (C) 2009-2013 Mateusz Loskot <mateusz@loskot.net>
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
###############################################################################
# General settings
###############################################################################
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR)
project(SOCI)
###############################################################################
# SOCI CMake modules
###############################################################################
# Path to additional CMake modules
set(CMAKE_MODULE_PATH ${SOCI_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH ${SOCI_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
include(SociUtilities)
colormsg(_HIBLUE_ "Configuring SOCI:")
###############################################################################
# SOCI version information
###############################################################################
include(SociVersion)
soci_version(MAJOR 3 MINOR 2 PATCH 1)
###############################################################################
# Build features and variants
###############################################################################
include(SociSystemInfo)
include(SociConfig)
boost_report_value(SOCI_PLATFORM_NAME)
boost_report_value(SOCI_COMPILER_NAME)
option(SOCI_STATIC "Enable build of static libraries" ON)
boost_report_value(SOCI_STATIC)
option(SOCI_TESTS "Enable build of collection of SOCI tests" ON)
boost_report_value(SOCI_TESTS)
# Put the libaries and binaries that get built into directories at the
# top of the build tree rather than in hard-to-find leaf
# directories. This simplifies manual testing and the use of the build
# tree rather than installed Boost libraries.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
###############################################################################
# Find SOCI dependencies
###############################################################################
set(SOCI_CORE_DEPENDENCIES)
include(SociDependencies)
###############################################################################
# Installation
###############################################################################
if(APPLE OR CMAKE_SIZEOF_VOID_P EQUAL 4)
set(SOCI_LIBDIR "lib")
else()
set(SOCI_LIBDIR "lib64")
endif()
set(BINDIR "bin" CACHE PATH "The directory to install binaries into.")
set(LIBDIR ${SOCI_LIBDIR} CACHE PATH "The directory to install libraries into.")
set(DATADIR "share" CACHE PATH "The directory to install data files into.")
set(INCLUDEDIR "include" CACHE PATH "The directory to install includes into.")
###############################################################################
# Enable tests
###############################################################################
enable_testing()
# Configure for testing with dashboard submissions to CDash
#include(CTest) # disabled as unused
# Define "make check" as alias for "make test"
add_custom_target(check COMMAND ctest)
###############################################################################
# Build configured components
###############################################################################
include(SociBackend)
include_directories(${SOCI_SOURCE_DIR}/include/soci)
add_subdirectory(src)
add_subdirectory(tests)
message(STATUS "")
......@@ -19,6 +19,10 @@
#
# List of SOCI dependncies
#
set(SOCI_CORE_DEPENDENCIES
Threads
Boost)
set(SOCI_BACKENDS_DB_DEPENDENCIES
MySQL
ODBC
......@@ -28,8 +32,8 @@ set(SOCI_BACKENDS_DB_DEPENDENCIES
Firebird
DB2)
set(SOCI_BACKENDS_ALL_DEPENDENCIES
Boost
set(SOCI_ALL_DEPENDENCIES
${SOCI_CORE_DEPENDENCIES}
${SOCI_BACKENDS_DB_DEPENDENCIES})
#
......@@ -69,7 +73,7 @@ option(WITH_VALGRIND "Run tests under valgrind" OFF)
#
# Detect available dependencies
#
foreach(external ${SOCI_BACKENDS_ALL_DEPENDENCIES})
foreach(external ${SOCI_ALL_DEPENDENCIES})
string(TOUPPER "${external}" EXTERNAL)
option(WITH_${EXTERNAL} "Attempt to find and configure ${external}" ON)
if(WITH_${EXTERNAL})
......
......@@ -5,7 +5,7 @@
################################################################################
# Copyright (C) 2007 Douglas Gregor <doug.gregor@gmail.com>
# Copyright (C) 2007 Troy Straszheim
# Copyright (C) 2010 Mateusz Loskot <mateusz@loskot.net>
# Copyright (C) 2010-2013 Mateusz Loskot <mateusz@loskot.net>
#
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
......@@ -362,10 +362,10 @@ endmacro()
#
# Pretty-print of given property of current directory.
#
macro(soci_report_directory_property PROPNAME)
function(soci_report_directory_property PROPNAME)
get_directory_property(${PROPNAME} ${PROPNAME})
boost_report_value(${PROPNAME})
endmacro()
endfunction()
#
# Scans the current directory and returns a list of subdirectories.
......
set(Boost_FIND_QUIETLY TRUE)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.33.1 COMPONENTS date_time)
if (NOT Boost_date_time_FOUND)
if (NOT Boost_DATE_TIME_FOUND)
find_package(Boost 1.33.1)
endif()
......
......@@ -3,8 +3,3 @@ set(MySQL_FIND_QUIETLY TRUE)
find_package(MySQL)
boost_external_report(MySQL INCLUDE_DIR LIBRARIES)
#if(MYSQL_FOUND)
# include_directories(${MYSQL_INCLUDE_DIR})
# add_definitions(-DHAVE_MYSQL)
#endif()
\ No newline at end of file
set(Threads_FIND_QUIETLY TRUE)
find_package(Threads)
message(STATUS "X: ${Threads_FOUND}")
boost_external_report(Threads LIBRARIES)
boost_report_value(CMAKE_THREAD_LIBS_INIT)
......@@ -81,6 +81,7 @@ if(DB2_LIBRARY)
get_filename_component(DB2_LIBRARY_DIR ${DB2_LIBRARY} PATH)
endif()
# TODO: To be removed to avoid setting *_directories at random directory-scope
if(DB2_INCLUDE_DIR AND DB2_LIBRARY_DIR)
set(DB2_FOUND TRUE)
......
# soci/include/private
Private headers do not define any parts of public interface,
are not installed in user's filesystem.
Private headers only define common features used internally.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment