mirror of
https://github.com/boostorg/cmake.git
synced 2026-01-19 04:02:15 +00:00
Add support for BOOST_TEST_PREFIX to BoostTest
This commit is contained in:
@@ -11,6 +11,7 @@ set(BOOST_TEST_COMPILE_FEATURES "")
|
||||
set(BOOST_TEST_INCLUDE_DIRECTORIES "")
|
||||
set(BOOST_TEST_SOURCES "")
|
||||
set(BOOST_TEST_WORKING_DIRECTORY "")
|
||||
set(BOOST_TEST_PREFIX "")
|
||||
|
||||
# Include guard
|
||||
|
||||
@@ -62,18 +63,12 @@ function(boost_test)
|
||||
set(__TYPE run)
|
||||
endif()
|
||||
|
||||
if(NOT __PREFIX)
|
||||
set(__PREFIX ${PROJECT_NAME})
|
||||
endif()
|
||||
|
||||
if(NOT __NAME)
|
||||
list(GET __SOURCES 0 __NAME)
|
||||
get_filename_component(__NAME ${__NAME} NAME_WE)
|
||||
string(MAKE_C_IDENTIFIER ${__NAME} __NAME)
|
||||
endif()
|
||||
|
||||
set(__NAME ${__PREFIX}-${__NAME})
|
||||
|
||||
if(__UNPARSED_ARGUMENTS)
|
||||
message(AUTHOR_WARNING "Extra arguments for test '${__NAME}' ignored: ${__UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
@@ -95,6 +90,7 @@ function(boost_test)
|
||||
set(BOOST_TEST_INCLUDE_DIRECTORIES "")
|
||||
set(BOOST_TEST_SOURCES "")
|
||||
set(BOOST_TEST_WORKING_DIRECTORY "")
|
||||
set(BOOST_TEST_PREFIX "")
|
||||
|
||||
endif()
|
||||
|
||||
@@ -109,6 +105,16 @@ function(boost_test)
|
||||
set(BOOST_TEST_WORKING_DIRECTORY ${__WORKING_DIRECTORY})
|
||||
endif()
|
||||
|
||||
if(__PREFIX)
|
||||
set(BOOST_TEST_PREFIX ${__PREFIX})
|
||||
endif()
|
||||
|
||||
if(NOT BOOST_TEST_PREFIX)
|
||||
set(BOOST_TEST_PREFIX ${PROJECT_NAME})
|
||||
endif()
|
||||
|
||||
set(__NAME ${BOOST_TEST_PREFIX}-${__NAME})
|
||||
|
||||
if(MSVC)
|
||||
|
||||
__boost_test_list_replace(BOOST_TEST_COMPILE_OPTIONS "-fexceptions" "/GX")
|
||||
|
||||
@@ -52,10 +52,11 @@ boost_test(TYPE run NAME run_subdir SOURCES include_subdir.cpp INCLUDE_DIRECTORI
|
||||
set(BOOST_TEST_COMPILE_OPTIONS -fno-rtti -fno-exceptions)
|
||||
set(BOOST_TEST_LINK_LIBRARIES Boost::config)
|
||||
set(BOOST_TEST_INCLUDE_DIRECTORIES subdir)
|
||||
set(BOOST_TEST_PREFIX boost_cmake_test_globals)
|
||||
|
||||
boost_test(SOURCES requires_no_rtti.cpp PREFIX boost_cmake_test_globals)
|
||||
boost_test(SOURCES requires_no_exceptions.cpp PREFIX boost_cmake_test_globals)
|
||||
boost_test(SOURCES include_subdir.cpp PREFIX boost_cmake_test_globals)
|
||||
boost_test(SOURCES requires_no_rtti.cpp)
|
||||
boost_test(SOURCES requires_no_exceptions.cpp)
|
||||
boost_test(SOURCES include_subdir.cpp)
|
||||
|
||||
# boost_test_jamfile
|
||||
|
||||
|
||||
Reference in New Issue
Block a user