mirror of
https://github.com/boostorg/predef.git
synced 2025-07-30 03:47:14 +02:00
Cleanups of cmake build use support.
This commit is contained in:
@ -48,11 +48,9 @@ matrix:
|
|||||||
exclude:
|
exclude:
|
||||||
- env: TRAVIS_EMPTY_JOB_WORKAROUND=true
|
- env: TRAVIS_EMPTY_JOB_WORKAROUND=true
|
||||||
include:
|
include:
|
||||||
# cmake self-test
|
# Check CMake project use support.
|
||||||
- env: TEST_CMAKE=TRUE #Only for easier identification in travis web gui
|
- env: TEST_CMAKE
|
||||||
os: linux
|
# Skip all the unneeded steps from the normal unit test jobs
|
||||||
|
|
||||||
# skip all the unneeded steps from the normal unit test jobs
|
|
||||||
install: true
|
install: true
|
||||||
before_script: true
|
before_script: true
|
||||||
before_cache: true
|
before_cache: true
|
||||||
@ -60,6 +58,7 @@ matrix:
|
|||||||
after_success: true
|
after_success: true
|
||||||
after_failure: true
|
after_failure: true
|
||||||
after_script: true
|
after_script: true
|
||||||
|
# Build CMake simple test project that uses Predef.
|
||||||
script:
|
script:
|
||||||
- mkdir __build__ && cd __build__
|
- mkdir __build__ && cd __build__
|
||||||
- cmake ../test/test_cmake
|
- cmake ../test/test_cmake
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
# Copyright 2018 Mike Dev
|
# Copyright Mike Dev 2018
|
||||||
|
# Copyright Rene Rivera 2018
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
# 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
|
# See accompanying file LICENSE_1_0.txt or copy at
|
||||||
#
|
# http://www.boost.org/LICENSE_1_0.txt
|
||||||
# NOTE: CMake support for Boost.Predef is currently experimental at best
|
|
||||||
# and the interface is likely to change in the future
|
# NOTE:
|
||||||
|
# CMake support for Boost.Predef is currently experimental at best and the
|
||||||
|
# interface is likely to change in the future
|
||||||
#
|
#
|
||||||
# This file provides mininmal cmake support (no unit-tests,
|
# This file provides mininmal cmake support (no unit-tests,
|
||||||
# no installation) for integration into a "host" cmake project
|
# no installation) for integration into a "host" cmake project
|
||||||
@ -14,13 +17,22 @@
|
|||||||
# on this library. I.e:
|
# on this library. I.e:
|
||||||
#
|
#
|
||||||
# target_link_libraries( <my-exe/lib> PUBLIC Boost::predef )
|
# target_link_libraries( <my-exe/lib> PUBLIC Boost::predef )
|
||||||
#
|
|
||||||
|
|
||||||
cmake_minimum_required( VERSION 3.5 )
|
# Only need the basic minimum of project, add_library, and
|
||||||
|
# target_include_directories commands.
|
||||||
|
cmake_minimum_required( VERSION 3.0 )
|
||||||
|
|
||||||
|
# Don't set VERSION, as that's a pita to keep up to date with the version
|
||||||
|
# header. And don't set LANGUAGES as we are multi-language and header
|
||||||
|
# only, so it's irrelevant.
|
||||||
project( BoostPredef )
|
project( BoostPredef )
|
||||||
|
|
||||||
|
# Simple INTERFACE, and header only, library target.
|
||||||
add_library( boost_predef INTERFACE )
|
add_library( boost_predef INTERFACE )
|
||||||
|
|
||||||
|
# The only usage requirement is include dir for consumers.
|
||||||
target_include_directories( boost_predef INTERFACE include )
|
target_include_directories( boost_predef INTERFACE include )
|
||||||
|
|
||||||
|
# Add an alias to be compatible with consumers that may have used the
|
||||||
|
# FindBoost script.
|
||||||
add_library( Boost::predef ALIAS boost_predef )
|
add_library( Boost::predef ALIAS boost_predef )
|
||||||
|
|
||||||
|
@ -1,21 +1,29 @@
|
|||||||
# Copyright 2018 Mike Dev
|
# Copyright Mike Dev 2018
|
||||||
|
# Copyright Rene Rivera 2018
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
# 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
|
# See accompanying file LICENSE_1_0.txt or copy at
|
||||||
#
|
# http://www.boost.org/LICENSE_1_0.txt
|
||||||
# NOTE: This does NOT run the unit tests for Boost.Predef.
|
|
||||||
# It only tests, if the CMakeLists.txt file in predef's
|
|
||||||
# root directory works as expected (i.e. it provides the
|
|
||||||
# target Boost::predef which in turn provides the
|
|
||||||
# correct include directory )
|
|
||||||
|
|
||||||
cmake_minimum_required( VERSION 3.5 )
|
# NOTE:
|
||||||
|
# This does NOT run the unit tests for Boost.Predef.
|
||||||
|
# It only tests, if the CMakeLists.txt file in predef's
|
||||||
|
# root directory works as expected (i.e. it provides the
|
||||||
|
# target Boost::predef which in turn provides the
|
||||||
|
# correct include directory )
|
||||||
|
|
||||||
|
# We have very simple cmake requirements we we still require the new style
|
||||||
|
# declarative targets.
|
||||||
|
cmake_minimum_required( VERSION 3.0 )
|
||||||
|
|
||||||
project( BoostPredefCMakeSelfTest )
|
project( BoostPredefCMakeSelfTest )
|
||||||
|
|
||||||
# Process cmake file at root of library and use ${CMAKE_CURRENT_BINARY_DIR}/libs/boost_predef as workspace
|
# Process cmake file at root of library and use
|
||||||
|
# ${CMAKE_CURRENT_BINARY_DIR}/libs/boost_predef as workspace
|
||||||
add_subdirectory( ../.. ${CMAKE_CURRENT_BINARY_DIR}/libs/boost_predef )
|
add_subdirectory( ../.. ${CMAKE_CURRENT_BINARY_DIR}/libs/boost_predef )
|
||||||
|
|
||||||
|
# The executable just includes a predef header to verify that it's used.
|
||||||
add_executable( boost_predef_cmake_test_prj main.cpp )
|
add_executable( boost_predef_cmake_test_prj main.cpp )
|
||||||
|
|
||||||
|
# The executable needs to "use" the Predef "library" to get the usage
|
||||||
|
# requirements added to the executable build.
|
||||||
target_link_libraries( boost_predef_cmake_test_prj Boost::predef )
|
target_link_libraries( boost_predef_cmake_test_prj Boost::predef )
|
||||||
|
|
||||||
|
@ -1,7 +1,19 @@
|
|||||||
// Dummy executable, just to make sure
|
/*
|
||||||
// that we can find the Boost.predef header files
|
Copyright Mike Dev 2018
|
||||||
|
Copyright 2018 Rene Rivera
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Dummy executable, just to make sure that we can find the Boost.predef header
|
||||||
|
files.
|
||||||
|
*/
|
||||||
|
|
||||||
#include <boost/predef.h>
|
#include <boost/predef.h>
|
||||||
|
|
||||||
int main() {
|
int main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user