Rename CMake/pkg-config target Catch2Main to Catch2WithMain

This describes the reality better, as it also links in the rest
of Catch2.

The on-disk name of the static library remains just `Catch2Main`,
as that is what it is -- single main function -- and on-disk artifacts
cannot describe link dependencies.
This commit is contained in:
Martin Hořeňovský
2020-05-03 18:54:38 +02:00
parent 33c58dad41
commit 19ecad6f68
6 changed files with 18 additions and 15 deletions

View File

@@ -269,19 +269,22 @@ target_include_directories(Catch2
)
add_library(Catch2Main STATIC
add_library(Catch2WithMain STATIC
${SOURCES_DIR}/internal/catch_main.cpp
)
add_library(Catch2::Catch2Main ALIAS Catch2Main)
target_link_libraries(Catch2Main PUBLIC Catch2)
add_library(Catch2::Catch2WithMain ALIAS Catch2WithMain)
target_link_libraries(Catch2WithMain PUBLIC Catch2)
set_target_properties(Catch2WithMain
PROPERTIES
OUTPUT_NAME "Catch2Main"
)
if (NOT_SUBPROJECT)
# create and install an export set for catch target as Catch2::Catch
install(
TARGETS
Catch2
Catch2Main
Catch2WithMain
EXPORT
Catch2Targets
DESTINATION
@@ -342,5 +345,5 @@ if (CATCH_BUILD_EXAMPLES OR CATCH_BUILD_EXTRA_TESTS)
)
endif()
list(APPEND CATCH_WARNING_TARGETS Catch2 Catch2Main)
list(APPEND CATCH_WARNING_TARGETS Catch2 Catch2WithMain)
set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE)