mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 05:10:10 -05:00
Merge topic 'patch-FindLibLZMA-version'
08fc190c03 FindLibLZMA: Add LibLZMA_VERSION
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11001
This commit is contained in:
@@ -121,7 +121,7 @@ foreach(
|
||||
GIF GTK2
|
||||
HDF5
|
||||
Jasper JPEG
|
||||
LibArchive LIBLZMA LibXml2 LibXslt LTTngUST
|
||||
LibArchive LibLZMA LIBLZMA LibXml2 LibXslt LTTngUST
|
||||
OPENSCENEGRAPH
|
||||
PNG PostgreSQL Protobuf
|
||||
Ruby RUBY
|
||||
|
||||
@@ -4,6 +4,8 @@ include(CTest)
|
||||
|
||||
find_package(LibLZMA REQUIRED)
|
||||
|
||||
add_definitions(-DCMAKE_EXPECTED_LIBLZMA_VERSION="${LibLZMA_VERSION}")
|
||||
|
||||
add_executable(test_tgt main.c)
|
||||
target_link_libraries(test_tgt LibLZMA::LibLZMA)
|
||||
add_test(NAME test_tgt COMMAND test_tgt)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <assert.h>
|
||||
#include <lzma.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
static uint8_t const test_string[9] = "123456789";
|
||||
@@ -11,5 +12,8 @@ int main(void)
|
||||
uint32_t crc = lzma_crc32(test_string, sizeof(test_string), 0);
|
||||
assert(crc == test_vector);
|
||||
|
||||
return 0;
|
||||
printf("Found LibLZMA version %s, expected version %s\n",
|
||||
lzma_version_string(), CMAKE_EXPECTED_LIBLZMA_VERSION);
|
||||
|
||||
return strcmp(lzma_version_string(), CMAKE_EXPECTED_LIBLZMA_VERSION);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user