Files
CPM.cmake/cmake/testing.cmake
Lars Melchior 4064a45552 Add CPM_SOURCE_CACHE environmental variable support and keep existing sources (#83)
* read CPM_SOURCE_CACHE from environment

* update readme

* cleanup

* add cache tests
2019-10-10 20:13:10 +02:00

23 lines
584 B
CMake

function(ASSERT_EQUAL)
if (NOT ARGC EQUAL 2)
message(FATAL_ERROR "assertion failed: invalid argument count: ${ARGC}")
endif()
if (NOT ${ARGV0} STREQUAL ${ARGV1})
message(FATAL_ERROR "assertion failed: '${ARGV0}' != '${ARGV1}'")
else()
message(STATUS "test passed: '${ARGV0}' == '${ARGV1}'")
endif()
endfunction()
function(ASSERT_EMPTY)
if (NOT ARGC EQUAL 0)
message(FATAL_ERROR "assertion failed: input ${ARGC} not empty: '${ARGV}'")
endif()
endfunction()
function(ASSERTION_FAILED)
message(FATAL_ERROR "assertion failed: ${ARGN}")
endfunction()