2
0
mirror of https://github.com/boostorg/mysql.git synced 2026-02-17 13:52:18 +00:00
Files
mysql/CMakeLists.txt
Ruben Perez dd2447c6cb Updated Boost version to 1.75.0
commit 5d0dafa324453ce731ddd2a427fa68490843b6c6
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 20 18:52:52 2020 +0100

    Added missing test exlussion on Windows

commit 52f1ce1eb6f43478451ee1c9761efa9a1f0c85bf
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 20 18:05:47 2020 +0100

    Trying to fix PS syntax errors 2

commit d680a874b069b8cc6c7965b226cda02f49438206
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 20 17:58:30 2020 +0100

    Fixing PS syntax errors

commit 84915ac269714fcfbfc6dc9e6ce10aefa395d33a
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 20 17:52:14 2020 +0100

    Changed Windows CMake builds to use latest Boost

commit 75aa757ae50f9c9d31cdb8018cf14e1dea5e6530
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 20 16:07:25 2020 +0100

    Removed conflictive build config under Windows

commit 7cd77f9204b842999233f8c6782caa3fbbf15a89
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Mon Dec 14 20:09:23 2020 +0100

    Desperate try to fix MSVC internal errors 2

commit f81de256735b1a705d03a7994cfecbce1a7581d4
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 20:44:59 2020 +0100

    Desperate try to fix stuff

commit 3a8f8d1caf8e8d906a7d96ba7edf62f2e3b09651
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 18:48:33 2020 +0100

    Reverted to using env var

commit 420427989274036fd04351531bdae2ebde621f5f
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 16:55:17 2020 +0100

    Changed CMake way of excluding tests to match b2's

commit 1db13f9e3df346135dadb1c2686ecafc0fe6c2df
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 16:33:05 2020 +0100

    Updated B2 CIs to explicitly run certain tests

commit 12700b387beb99f2ac1cf342291bc63f49d26a99
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 16:14:47 2020 +0100

    Updated test selection (sha256/unix) in b2

commit 0f23bddeb64203e5c570280e5e1de4a5ae083f94
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 16:14:34 2020 +0100

    Added internal script to setup b2 env

commit 13cf6b102b0d71f5496bcd433e3269ea297a9f26
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 14:00:30 2020 +0100

    Added option to skip UNIX socket tests (only cmake)

commit a35f668ae0a968ef01eb6517d9de86c45e07dceb
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sat Dec 12 21:38:06 2020 +0100

    Attempted to correct test filter problem

commit 29282e5a4fa6e4f5b7c5de56662b9cbea7758e06
Author: anarthal <rubenperez038@gmail.com>
Date:   Sat Dec 12 11:27:53 2020 -0800

    Fixes to build in MSVC

commit bc8599358435de946cba10cc7cbdc264bb793e5b
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sat Dec 5 13:57:56 2020 +0100

    Reduced concurrency on Unix cmake builds

commit 3e183277cb2b3c4480ec102f956a4683811d3f44
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Fri Dec 4 17:50:31 2020 +0100

    Test ssh keys

commit d91a4ebdb65444da1c5952444c571dc68de1cd7b
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Nov 29 19:59:07 2020 +0100

    Remove TODO.txt in favor of GitHub issues

commit fbe5e58966304b6fd87029af4657e6ed1aa2f2fd
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Nov 29 19:58:25 2020 +0100

    Updated to build with 1.75
2020-12-20 21:20:23 +01:00

115 lines
3.1 KiB
CMake

#
# Copyright (c) 2019-2020 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
#
# 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)
#
cmake_minimum_required(VERSION 3.13.0) # Determined by requiring Boost 1.70
project(boost_mysql VERSION 0.0.1)
# If we are the top-level project, enable testing
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)
if(BUILD_TESTING)
set(_TESTING_ENABLED ON)
endif()
# Valgrind tests and Valgrind-friendly code (e.g. mark SSL buffers as initialized)
option(BOOST_MYSQL_VALGRIND_TESTS OFF "Whether to run Valgrind tests or not (requires Valgrind)")
mark_as_advanced(BOOST_MYSQL_VALGRIND_TESTS)
# Build with coverage
option(BOOST_MYSQL_COVERAGE OFF "Whether to build using coverage")
mark_as_advanced(BOOST_MYSQL_COVERAGE)
endif()
# Includes
include(GNUInstallDirs)
# Dependencies
find_package(Boost 1.72.0 REQUIRED COMPONENTS system)
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
# Interface library (header-only)
add_library(boost_mysql INTERFACE)
add_library(Boost::mysql ALIAS boost_mysql)
target_link_directories(
boost_mysql
INTERFACE
${Boost_LIBRARY_DIRS} # Prevent link errors in Windows
)
target_link_libraries(
boost_mysql
INTERFACE
Boost::system
Threads::Threads
OpenSSL::Crypto
OpenSSL::SSL
)
target_include_directories(
boost_mysql
INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_compile_features(
boost_mysql
INTERFACE
cxx_std_11
)
# Asio bases C++ feature detection on __cplusplus. Make MSVC
# define it correctly
if (MSVC)
target_compile_options(boost_mysql INTERFACE /Zc:__cplusplus)
endif()
# Installing
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set_target_properties(boost_mysql PROPERTIES EXPORT_NAME mysql)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION include
)
install(
TARGETS boost_mysql
EXPORT boost_mysql_targets
)
install(
EXPORT boost_mysql_targets
FILE boost_mysql-targets.cmake
NAMESPACE Boost::
DESTINATION lib/cmake/boost_mysql
)
include(CMakePackageConfigHelpers)
configure_package_config_file(
cmake/config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/boost_mysql-config.cmake
INSTALL_DESTINATION lib/cmake/boost_mysql
)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/boost_mysql-config-version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/boost_mysql-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/boost_mysql-config-version.cmake
DESTINATION lib/cmake/boost_mysql
)
endif()
# Examples and tests
if(_TESTING_ENABLED)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/test_utils.cmake)
add_subdirectory(example)
add_subdirectory(test)
endif()