Skip to content
Open
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
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ target_compile_features(boost_format INTERFACE cxx_std_11)

if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")

add_subdirectory(test)
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)

message(STATUS "Using CMake version ${CMAKE_VERSION}")

set(Boost_DEBUG ON)
find_package(Boost 1.85 CONFIG REQUIRED COMPONENTS assert config core optional smart_ptr throw_exception utility)

endif()

# Follow the Boost convention: don't build test targets by default,
# and only when explicitly requested by building target tests
add_subdirectory(test EXCLUDE_FROM_ALL)

endif()
19 changes: 19 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.8...3.20)

add_executable(format_test1 format_test1.cpp)
target_link_libraries(format_test1 Boost::format)

add_executable(format_test2 format_test2.cpp)
target_link_libraries(format_test2 Boost::format)

add_executable(format_test3 format_test3.cpp)
target_link_libraries(format_test3 Boost::format)

add_executable(format_test_enum format_test_enum.cpp)
target_link_libraries(format_test_enum Boost::format)

add_executable(format_test_exceptions format_test_exceptions.cpp)
target_link_libraries(format_test_exceptions Boost::format)

add_executable(format_test_wstring format_test_wstring.cpp)
target_link_libraries(format_test_wstring Boost::format)