-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CMake subdir and install tests to ci.yml
- Loading branch information
Showing
5 changed files
with
319 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2018, 2019, 2021 Peter Dimov | ||
# 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.5...3.16) | ||
|
||
project(boost_graph_install_test LANGUAGES CXX) | ||
|
||
if(BOOST_RUNTIME_LINK STREQUAL "static") | ||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") | ||
endif() | ||
|
||
find_package(boost_graph REQUIRED) | ||
|
||
add_executable(main main.cpp) | ||
target_link_libraries(main Boost::graph) | ||
|
||
enable_testing() | ||
add_test(NAME main COMMAND main) | ||
|
||
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure --no-tests=error -C $<CONFIG>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2006 The Trustees of Indiana University. | ||
|
||
// Use, modification and distribution is subject to 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) | ||
|
||
// Authors: Douglas Gregor | ||
// Andrew Lumsdaine | ||
|
||
// Make sure adjacency_list works with EdgeListS=setS | ||
#include <boost/graph/adjacency_list.hpp> | ||
|
||
using namespace boost; | ||
|
||
typedef adjacency_list< vecS, vecS, undirectedS, no_property, no_property, | ||
no_property, setS > | ||
GraphType; | ||
|
||
int main() | ||
{ | ||
GraphType g(10); | ||
add_vertex(g); | ||
add_edge(0, 5, g); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2018, 2019, 2021 Peter Dimov | ||
# 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.5...3.16) | ||
|
||
project(boost_graph_subdir_test LANGUAGES CXX) | ||
|
||
if(BOOST_RUNTIME_LINK STREQUAL "static") | ||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") | ||
endif() | ||
|
||
# Put .dll in the same directory as .exe | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
|
||
set(BOOST_INCLUDE_LIBRARIES graph) | ||
|
||
add_subdirectory(../../../../ deps/boost) | ||
|
||
add_executable(main main.cpp) | ||
target_link_libraries(main Boost::graph) | ||
|
||
enable_testing() | ||
add_test(NAME main COMMAND main) | ||
|
||
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure --no-tests=error -C $<CONFIG>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2006 The Trustees of Indiana University. | ||
|
||
// Use, modification and distribution is subject to 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) | ||
|
||
// Authors: Douglas Gregor | ||
// Andrew Lumsdaine | ||
|
||
// Make sure adjacency_list works with EdgeListS=setS | ||
#include <boost/graph/adjacency_list.hpp> | ||
|
||
using namespace boost; | ||
|
||
typedef adjacency_list< vecS, vecS, undirectedS, no_property, no_property, | ||
no_property, setS > | ||
GraphType; | ||
|
||
int main() | ||
{ | ||
GraphType g(10); | ||
add_vertex(g); | ||
add_edge(0, 5, g); | ||
} |