Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-05-03 18:54:38 +0200
committerMartin Hořeňovský2020-05-03 18:54:38 +0200
commit19ecad6f68154df2ba182c93224bdda8d7527b34 (patch)
tree6ed9ad0b61d00074efd7466ce85eed1cacf8c108
parent33c58dad419ccce92882e9edbe4fc6124bc193ee (diff)
downloadcatch3-19ecad6f68154df2ba182c93224bdda8d7527b34.tar.gz
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.
-rw-r--r--CMake/catch2-with-main.pc.in (renamed from CMake/catch2-main.pc.in)6
-rw-r--r--CMake/catch2.pc.in2
-rw-r--r--CMakeLists.txt6
-rw-r--r--conanfile.py2
-rw-r--r--examples/CMakeLists.txt2
-rw-r--r--src/CMakeLists.txt15
6 files changed, 18 insertions, 15 deletions
diff --git a/CMake/catch2-main.pc.in b/CMake/catch2-with-main.pc.in
index 4189cc77..122f1f96 100644
--- a/CMake/catch2-main.pc.in
+++ b/CMake/catch2-with-main.pc.in
@@ -2,9 +2,9 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
pkg_version=@Catch2_VERSION@
-Name: Catch2-Main
-Description: Links in the default main function for Catch2
+Name: Catch2-With-Main
+Description: A modern, C++-native test framework for C++14 and above (links in default main)
Version: ${pkg_version}
Requires: catch2 = ${pkg_version}
Cflags: -I${includedir}
-Libs: -L${libdir} -lCatch2Main
+Libs: -L${libdir} -lCatch2WithMain
diff --git a/CMake/catch2.pc.in b/CMake/catch2.pc.in
index 183114b6..c37eb8ad 100644
--- a/CMake/catch2.pc.in
+++ b/CMake/catch2.pc.in
@@ -2,7 +2,7 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
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
Version: @Catch2_VERSION@
Cflags: -I${includedir}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e1359824..ad069449 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -166,14 +166,14 @@ if (NOT_SUBPROJECT)
@ONLY
)
configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake/catch2-main.pc.in
- ${CMAKE_CURRENT_BINARY_DIR}/catch2-main.pc
+ ${CMAKE_CURRENT_SOURCE_DIR}/CMake/catch2-with-main.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/catch2-with-main.pc
@ONLY
)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/catch2.pc"
- "${CMAKE_CURRENT_BINARY_DIR}/catch2-main.pc"
+ "${CMAKE_CURRENT_BINARY_DIR}/catch2-with-main.pc"
DESTINATION
${PKGCONFIG_INSTALL_DIR}
)
diff --git a/conanfile.py b/conanfile.py
index 3a1bf224..1379f8c4 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -40,6 +40,6 @@ class CatchConan(ConanFile):
def package_info(self):
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_multi"] = "Catch2"
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index d7c6fe93..af34d437 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -52,7 +52,7 @@ set(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_EXTENSIONS OFF)
endforeach()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0a4a21f7..4b1c81d0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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)