mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 05:16:10 +01:00
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:
parent
33c58dad41
commit
19ecad6f68
@ -2,9 +2,9 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
|||||||
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||||
pkg_version=@Catch2_VERSION@
|
pkg_version=@Catch2_VERSION@
|
||||||
|
|
||||||
Name: Catch2-Main
|
Name: Catch2-With-Main
|
||||||
Description: Links in the default main function for Catch2
|
Description: A modern, C++-native test framework for C++14 and above (links in default main)
|
||||||
Version: ${pkg_version}
|
Version: ${pkg_version}
|
||||||
Requires: catch2 = ${pkg_version}
|
Requires: catch2 = ${pkg_version}
|
||||||
Cflags: -I${includedir}
|
Cflags: -I${includedir}
|
||||||
Libs: -L${libdir} -lCatch2Main
|
Libs: -L${libdir} -lCatch2WithMain
|
@ -2,7 +2,7 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
|||||||
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||||
|
|
||||||
Name: Catch2
|
Name: Catch2
|
||||||
Description: A modern, C++-native, header-only, test framework for C++14 and above
|
Description: A modern, C++-native, test framework for C++14 and above
|
||||||
URL: https://github.com/catchorg/Catch2
|
URL: https://github.com/catchorg/Catch2
|
||||||
Version: @Catch2_VERSION@
|
Version: @Catch2_VERSION@
|
||||||
Cflags: -I${includedir}
|
Cflags: -I${includedir}
|
||||||
|
@ -166,14 +166,14 @@ if (NOT_SUBPROJECT)
|
|||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/catch2-main.pc.in
|
${CMAKE_CURRENT_SOURCE_DIR}/CMake/catch2-with-main.pc.in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/catch2-main.pc
|
${CMAKE_CURRENT_BINARY_DIR}/catch2-with-main.pc
|
||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
install(
|
install(
|
||||||
FILES
|
FILES
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/catch2.pc"
|
"${CMAKE_CURRENT_BINARY_DIR}/catch2.pc"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/catch2-main.pc"
|
"${CMAKE_CURRENT_BINARY_DIR}/catch2-with-main.pc"
|
||||||
DESTINATION
|
DESTINATION
|
||||||
${PKGCONFIG_INSTALL_DIR}
|
${PKGCONFIG_INSTALL_DIR}
|
||||||
)
|
)
|
||||||
|
@ -40,6 +40,6 @@ class CatchConan(ConanFile):
|
|||||||
|
|
||||||
def package_info(self):
|
def package_info(self):
|
||||||
self.cpp_info.libs = [
|
self.cpp_info.libs = [
|
||||||
'Catch2Main', 'Catch2'] if self.options.with_main else ['Catch2']
|
'Catch2WithMain', 'Catch2'] if self.options.with_main else ['Catch2']
|
||||||
self.cpp_info.names["cmake_find_package"] = "Catch2"
|
self.cpp_info.names["cmake_find_package"] = "Catch2"
|
||||||
self.cpp_info.names["cmake_find_package_multi"] = "Catch2"
|
self.cpp_info.names["cmake_find_package_multi"] = "Catch2"
|
||||||
|
@ -52,7 +52,7 @@ set(ALL_EXAMPLE_TARGETS
|
|||||||
)
|
)
|
||||||
|
|
||||||
foreach( name ${ALL_EXAMPLE_TARGETS} )
|
foreach( name ${ALL_EXAMPLE_TARGETS} )
|
||||||
target_link_libraries( ${name} Catch2 Catch2Main )
|
target_link_libraries( ${name} Catch2 Catch2WithMain )
|
||||||
set_property(TARGET ${name} PROPERTY CXX_STANDARD 14)
|
set_property(TARGET ${name} PROPERTY CXX_STANDARD 14)
|
||||||
set_property(TARGET ${name} PROPERTY CXX_EXTENSIONS OFF)
|
set_property(TARGET ${name} PROPERTY CXX_EXTENSIONS OFF)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
@ -269,19 +269,22 @@ target_include_directories(Catch2
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
add_library(Catch2Main STATIC
|
add_library(Catch2WithMain STATIC
|
||||||
${SOURCES_DIR}/internal/catch_main.cpp
|
${SOURCES_DIR}/internal/catch_main.cpp
|
||||||
)
|
)
|
||||||
add_library(Catch2::Catch2Main ALIAS Catch2Main)
|
add_library(Catch2::Catch2WithMain ALIAS Catch2WithMain)
|
||||||
target_link_libraries(Catch2Main PUBLIC Catch2)
|
target_link_libraries(Catch2WithMain PUBLIC Catch2)
|
||||||
|
set_target_properties(Catch2WithMain
|
||||||
|
PROPERTIES
|
||||||
|
OUTPUT_NAME "Catch2Main"
|
||||||
|
)
|
||||||
|
|
||||||
if (NOT_SUBPROJECT)
|
if (NOT_SUBPROJECT)
|
||||||
# create and install an export set for catch target as Catch2::Catch
|
# create and install an export set for catch target as Catch2::Catch
|
||||||
install(
|
install(
|
||||||
TARGETS
|
TARGETS
|
||||||
Catch2
|
Catch2
|
||||||
Catch2Main
|
Catch2WithMain
|
||||||
EXPORT
|
EXPORT
|
||||||
Catch2Targets
|
Catch2Targets
|
||||||
DESTINATION
|
DESTINATION
|
||||||
@ -342,5 +345,5 @@ if (CATCH_BUILD_EXAMPLES OR CATCH_BUILD_EXTRA_TESTS)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND CATCH_WARNING_TARGETS Catch2 Catch2Main)
|
list(APPEND CATCH_WARNING_TARGETS Catch2 Catch2WithMain)
|
||||||
set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE)
|
set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE)
|
||||||
|
Loading…
Reference in New Issue
Block a user