mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-16 22:27:41 -05:00
add unit tests and determine version from GIT_TAG (#66)
* add unit tests * determine package version from git tag. closes #54. * update readme * bugfix * update example * update gitignore
This commit is contained in:
30
test/unit/dependency_properties.cmake
Normal file
30
test/unit/dependency_properties.cmake
Normal file
@@ -0,0 +1,30 @@
|
||||
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
||||
|
||||
include(${CPM_PATH}/CPM.cmake)
|
||||
include(${CPM_PATH}/testing.cmake)
|
||||
|
||||
set(CPM_DRY_RUN ON)
|
||||
|
||||
CPMAddPackage(
|
||||
NAME A
|
||||
GIT_TAG 1.2.3
|
||||
)
|
||||
|
||||
CPM_GET_PACKAGE_VERSION(A VERSION)
|
||||
ASSERT_EQUAL(${VERSION} "1.2.3")
|
||||
|
||||
CPMAddPackage(
|
||||
NAME B
|
||||
GIT_TAG v2.3.1
|
||||
)
|
||||
|
||||
CPM_GET_PACKAGE_VERSION(B VERSION)
|
||||
ASSERT_EQUAL(${VERSION} "2.3.1")
|
||||
|
||||
CPMAddPackage(
|
||||
NAME C
|
||||
GIT_TAG v3.1.2-a
|
||||
)
|
||||
|
||||
CPM_GET_PACKAGE_VERSION(C VERSION)
|
||||
ASSERT_EQUAL(${VERSION} "3.1.2")
|
||||
Reference in New Issue
Block a user