Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Support for Fetching PackageProject.cmake from CPM.cmake #635

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 5 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,9 @@ option(BOOST_UT_BUILD_TESTS "Build the tests" ${PROJECT_IS_TOP_LEVEL})
option(BOOST_UT_ENABLE_INSTALL "Enable install targets" ${PROJECT_IS_TOP_LEVEL})
option(BOOST_UT_USE_WARNINGS_AS_ERORS "Build the tests" ${PROJECT_IS_TOP_LEVEL})
option(BOOST_UT_DISABLE_MODULE "Disable ut module" OFF)
option(BOOST_UT_ALLOW_CPM_USE "Do not reach out across network for CPM" ON)

if(BOOST_UT_ENABLE_INSTALL AND NOT CMAKE_SKIP_INSTALL_RULES)
if(BOOST_UT_ALLOW_CPM_USE)
# ---- Add dependencies via CPM ----
# see https://github.com/cpm-cmake/CPM.cmake for more info

include(cmake/CPM.cmake)

# PackageProject.cmake will be used to make our target installable
CPMAddPackage(
NAME PackageProject.cmake
GITHUB_REPOSITORY TheLartians/PackageProject.cmake
VERSION 1.10.0
)
else()
include(cmake/PackageProject.cmake)
endif()
endif()

add_library(ut INTERFACE)

if(BOOST_UT_ALLOW_CPM_USE)
add_library(Boost::ut ALIAS ut)
endif()

if(NOT DEFINED INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR include/${PROJECT_NAME}-${PROJECT_VERSION}/include)
endif()
Expand Down Expand Up @@ -85,6 +62,7 @@ if(BOOST_UT_DISABLE_MODULE)
endif()

if(BOOST_UT_ENABLE_INSTALL AND NOT CMAKE_SKIP_INSTALL_RULES)
include(cmake/PackageProject.cmake)
# Create target Boost::ut and install target
packageProject(
NAME ${PROJECT_NAME}
Expand All @@ -99,6 +77,10 @@ if(BOOST_UT_ENABLE_INSTALL AND NOT CMAKE_SKIP_INSTALL_RULES)
)
endif()

if(NOT TARGET Boost::ut)
add_library(Boost::ut ALIAS ut)
endif()

if (EMSCRIPTEN)
set(CMAKE_EXECUTABLE_SUFFIX ".js")
target_link_options(ut INTERFACE
Expand Down
21 changes: 0 additions & 21 deletions cmake/CPM.cmake

This file was deleted.

Loading