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

Introduce catch2 3.7.1 #1473

Merged
merged 6 commits into from
Oct 2, 2024
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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"source_location": "cpp",
"stdfloat": "cpp",
"text_encoding": "cpp",
"print": "cpp"
"print": "cpp",
"geometry": "cpp"
},
"C_Cpp.vcFormat.indent.namespaceContents": false,
"editor.formatOnSave": true,
Expand Down
43 changes: 40 additions & 3 deletions 3rdparty/catch2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
project(${CATCH2_LIBRARY})

set(CATCH2_MAJOR_VERSION 2 PARENT_SCOPE)
set(CATCH2_MINOR_VERSION 13 PARENT_SCOPE)
set(CATCH2_PATCH_VERSION 7 PARENT_SCOPE)
set(CATCH2_MAJOR_VERSION 3 PARENT_SCOPE)
set(CATCH2_MINOR_VERSION 7 PARENT_SCOPE)
set(CATCH2_PATCH_VERSION 1 PARENT_SCOPE)

vp_include_directories(${CMAKE_CURRENT_SOURCE_DIR})

file(GLOB lib_srcs *.cpp)
file(GLOB lib_hdrs *.hpp)

add_library(${CATCH2_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
target_compile_definitions(${CATCH2_LIBRARY} PRIVATE "CATCH_AMALGAMATED_CUSTOM_MAIN")

if(UNIX)
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
endif()

if((VISP_CXX_STANDARD EQUAL VISP_CXX_STANDARD_11) AND CXX11_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_CXX_FLAGS}")
elseif((VISP_CXX_STANDARD EQUAL VISP_CXX_STANDARD_14) AND CXX14_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX14_CXX_FLAGS}")
elseif((VISP_CXX_STANDARD EQUAL VISP_CXX_STANDARD_17) AND CXX17_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX17_CXX_FLAGS}")
endif()

if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${CATCH2_LIBRARY} PROPERTIES FOLDER "3rdparty")
endif()

set_target_properties(${CATCH2_LIBRARY}
PROPERTIES OUTPUT_NAME ${CATCH2_LIBRARY}
DEBUG_POSTFIX "${VISP_DEBUG_POSTFIX}"
COMPILE_PDB_NAME ${CATCH2_LIBRARY}
COMPILE_PDB_NAME_DEBUG "${CATCH2_LIBRARY}${VISP_DEBUG_POSTFIX}"
ARCHIVE_OUTPUT_DIRECTORY ${VISP_3P_LIBRARY_OUTPUT_PATH}
)

if(NOT BUILD_SHARED_LIBS)
vp_install_target(${CATCH2_LIBRARY} EXPORT VISPModules ARCHIVE DESTINATION ${VISP_3P_LIB_INSTALL_PATH} COMPONENT dev)
endif()
7 changes: 4 additions & 3 deletions 3rdparty/catch2/README.VISP
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
WHAT IS CATCH2:
---------------

Catch2 is a modern, C++-native, header-only, test framework for unit-tests, TDD and BDD - using C++11, C++14, C++17 and later
Catch2 is a modern, C++-native, header-only, test framework for unit-tests, TDD and BDD - using C++11, C++14, C++17
and later.

SOURCE CODE:
------------
Expand All @@ -17,5 +18,5 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
CONTENT:
--------

The catch.hpp file is a copy of the latest version of the single header that was downloaded from https://github.com/catchorg/Catch2/releases/download/v2.13.7/catch.hpp

The catch_amalgamated.hpp and catch_amalgamated.cpp files are a copy of the latest version of the single header that
was downloaded from https://github.com/catchorg/Catch2/releases/tag/v3.7.1
Loading
Loading