Commit graph

34 commits

Author SHA1 Message Date
Dan Huantes
f871471d90 Added Namespace to Exported Target
[CMakeLists.txt]
- It is standard practice to have a namespace
for an imported target.  Added UnitTest++::
as the namespace argument so that
find_package(UnitTest++) will result in
UnitTest++::UnitTest++ target that will
be used in target_link_libraries.
- Updated target_link_libraries for
TestUnitTest++ as an example
2020-04-07 18:07:24 -05:00
Dan Huantes
c269666681 Version made explicitly 3 parts
- Updated to appveyor.yml and
configure.ac to 2.1.0 to
match CMake project version.
2019-10-17 08:23:46 -05:00
Dan Huantes
bdef2bdd62 UnitTest++ now correctly supports CMake's find_package config mode
[CMakeLists.txt]
- Bumped cmake minimum requirement to go to 3.0 as this
appears to be earliest version that transitive usage
requirements are supported.
- Added version to project so that is evident
when looking at CMakeLists.txt
- Removed include_directories as that command
affects more than just UnitTest++ in favor
of target_include_directories.
- The target_include_directories uses the
generator expressions to do the same thing
for the BUILD_INTERFACE condition but only
affects UnitTest++.  The INSTALL_INTERFACE
ensures that when UnitTest++ is installed
client applications calling find_package
for UnitTest++ only have to add the
UnitTest++ target to the target_link_libraries
and will get the correct include path
for UnitTest++ added to their include paths.
- Added DEBUG_POSTFIX to both library and
unit test to distinguish them from each other
as they are installed into the same directory
and would otherwise overwrite one another.
- Added Versioning using write_basic_package_version_file
to the install so that a client can call
find_package(UnitTest++ 2.1 REQUIRED) and it will be
able to confirm the version.  If the version is updated
you could theoretically ahve a version 2.2, 2.3 ,etc...
and the find_package mechanism will find the correct one.
the SameMajorVersion option in that call indicates
that 2.3 is compatible with 2.1 or in other words if
find_package(UnitTest++ 2.1 REQUIRED) is called and
2.3 is installed that satisfies the condition but
if only 3.0 was installed it will fail because of
'SameMajorVersion'.
- Also added installation for the Version file.
2019-08-15 07:26:45 -05:00
Martin Moene
a6fdaeef12 Use if (MSVC) as per issue #160 2017-07-08 11:09:38 +02:00
Patrick Johnmeyer
ee996164f2 Merge branch 'master' into feature-MSVC-Clang 2017-06-30 23:31:18 -05:00
Gabriel Hare
0b15459ee4 Downgrade message to STATUS and do not declare C++11 as a requirement. 2017-02-02 21:56:48 -08:00
Christoph Willing
0757ba8f90
Add support for LIB_SUFFIX
Signed-off-by: Christoph Willing <chris.willing@iinet.net.au>
2017-01-23 17:49:12 +10:00
Iblis Lin
85bade33f5 cmake: fix pkgconfig dir path on FreeBSD 2017-01-14 23:00:24 +08:00
Gabriel Hare
a2fe23887a Use “MATCHES” instead of “STREQUAL” to avoid ambiguous comparison.
NOTE: Unlike STREQUAL this comparison is supported pre and post CMake v3.1.0
2016-12-15 02:50:09 -08:00
Gabriel Hare
bb49539107 Revert "Increase CMake version to resolve developer warnings regarding implicit quoted dereference in STREQUAL comparison"
This reverts commit 8f7a263446.
2016-12-15 02:46:13 -08:00
Gabriel Hare
c4ab9d31ed Identify Clang compiler when used as an MSVC extension 2016-12-15 00:40:03 -08:00
Gabriel Hare
8f7a263446 Increase CMake version to resolve developer warnings regarding implicit quoted dereference in STREQUAL comparison 2016-12-15 00:31:56 -08:00
Gabriel Hare
9eba823269 Demonstrate that compiler is identified as MSVC when VS2014 Clang extension is used 2016-12-14 23:11:20 -08:00
Evan Danaher
40f90dc601 Build pkgconfig file with CMake, not just with autoconf. 2016-12-01 12:52:48 -05:00
Patrick Johnmeyer
7d7ba0aba4 Re-enable ignored-qualifiers warning and fix 2016-08-27 20:41:41 -05:00
Patrick Johnmeyer
e161d44077 Use CMake SET instead of string CONCAT
string(CONCAT...) was not available in older versions of CMake
targeted by this project.
2016-08-27 10:04:54 -05:00
Patrick Johnmeyer
f0044e919d Up warning level to -Wall/extra/error for non-MSVC
UTPP_AMPLIFY_WARNINGS can be turned OFF to disable the new behavior.
2016-08-27 09:54:32 -05:00
Patrick Johnmeyer
7c15942751 Up warning level to /W4 /WX for MSVC-like compilers
Also adds a CMake option, UTPP_AMPLIFY_WARNINGS, that can be turned
OFF to disable the new behavior.
2016-08-27 08:26:05 -05:00
Patrick Johnmeyer
6b69ed78ba Skip test build with same option as run
As part of this, changed the option name to
`UTPP_INCLUDE_TESTS_IN_BUILD`. The test target is still added to the
build and can be built/run separately using the CMake --target option.
2016-07-18 21:13:03 -05:00
Patrick Johnmeyer
14f317c40c Eliminate double-negative in option name / value
UTPP_SKIP_TESTS_AS_BUILD_STEP with a default value of OFF was an
unfortunate choice, so this changes it to UTPP_RUN_TESTS_AS_BUILD_STEP
with a default value of ON.
2016-07-18 20:49:18 -05:00
Patrick Johnmeyer
fa97152619 Add UTPP_SKIP_TESTS_AS_BUILD_STEP CMake option
Helps address #104.
2016-07-18 20:49:18 -05:00
Patrick Johnmeyer
032e495bba Merge branch 'master' of https://github.com/jasonhorsburgh/unittest-cpp into jasonhorsburgh-master
Conflicts:
	CMakeLists.txt
2016-04-19 22:08:24 -05:00
Kilian Köppchen
451ba1e2bc Fix spelling of UTPP_USE_PLUS_SIGN option comment. 2016-04-14 15:23:10 +02:00
Jason Horsburgh
e88121f69e Add support for CMake find_package()
Added export configuration for UnitTest++ target and installed the export and config file in libs/cmake/UnitTest++.
Added basic UnitTest++Config.cmake file which includes exported targets file and sets UTPP_INCLUDE_DIRS to the install location of the includes directory, this allows UnitTest++ to be used as a normal target in your own CMakeLists.txt file.

e.g.:

    find_package(UnitTest++ REQUIRED NO_MODULE)
    add_executable(foo ...)
    include_directories(${UTPP_INCLUDE_DIRS})
    target_link_libraries(foo UnitTest++)

which will ensure the library and installed headers paths are set up correctly for your own target.
2016-03-15 12:14:19 +00:00
Anna Gringauze
0a14abb0a5 Added support for VS2015 2015-09-22 07:36:28 -07:00
Patrick Johnmeyer
2ee151af76 Change unit tests to run as post-build step.
This is how it used to be in most of the old project files. The
CMake conversion required the tests to be run manually after the
build, either by running the binary directly or by calling CTest.
This commit removes the 'dependency' on CTest and restores the
old build process.
2015-04-04 01:31:04 -05:00
Patrick Johnmeyer
ce196f218a Add support and project files for Visual Studio 2012 2013-03-24 01:13:10 -05:00
Patrick Johnmeyer
c23edddd15 - Fixed include path in CMakeLists.txt 2013-03-23 22:24:57 -05:00
Patrick Johnmeyer
859e6250d2 Move src to UnitTest++ and move src/tests to tests.
CMakeLists was modified to support this, then include paths for the
test executable also had to be modified to include UnitTest++.
2013-02-20 00:22:14 -06:00
Patrick Johnmeyer
deb7e2736d Ensure all headers, including platform, are being installed. 2013-02-20 00:13:07 -06:00
Patrick Johnmeyer
13a6c9e6ad Add install targets and install path customization.
This commit adds install() directives to the CMake file. By default,
headers will be installed to CMAKE_INSTALL_PREFIX/include/UnitTest++
and libUnitTest++.a will be installed to CMAKE_INSTALL_PREFIX/lib.

If the user defines UTPP_USE_PLUS_SIGN=OFF when generating, the ++
will be replaced with PP in both the library file name and the
include path.
2013-02-19 23:35:10 -06:00
Patrick Johnmeyer
c702d69a85 Revert "Add install targets and install path customization."
This reverts commit 1fa77e11c6.
2013-02-19 23:33:33 -06:00
Patrick Johnmeyer
8a58afab17 Add install targets and install path customization.
This commit adds install() directives to the CMake file. By default,
headers will be installed to CMAKE_INSTALL_PREFIX/include/UnitTest++
and libUnitTest++.a will be installed to CMAKE_INSTALL_PREFIX/lib.

If the user defines UTPP_USE_PLUS_SIGN=OFF when generating, the ++
will be replaced with PP in both the library file name and the
include path.
2013-02-19 23:26:18 -06:00
Aaron Simmons
062241c85d adding CMakeLists.txt 2012-11-15 10:07:33 -07:00