Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ if(BUILD_SHARED_LIBS)
else()
add_library(qrencode ${QRENCODE_SRCS} ${QRENCODE_HDRS})
endif()
target_include_directories(qrencode INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
if(CMAKE_USE_PTHREADS_INIT)
target_link_libraries(qrencode Threads::Threads)
endif()
Expand Down
3 changes: 3 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,6 @@ if(TARGET ICONV::ICONV)
endif()
endif()

add_executable(test_cmake_target test_cmake_target.c)
target_link_libraries(test_cmake_target qrencode)
add_test(test_cmake_target test_cmake_target)
2 changes: 1 addition & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ noinst_PROGRAMS += pthread_qrencode
endif

TESTS = $(check_PROGRAMS)
EXTRA_DIST = test_all.sh test_basic.sh test_configure.sh frame URI_testset.inc CMakeLists.txt
EXTRA_DIST = test_all.sh test_basic.sh test_configure.sh frame URI_testset.inc CMakeLists.txt test_cmake_target.c

libdecoder_a_SOURCES = decoder.c decoder.h datachunk.c datachunk.h rsecc_decoder.c rsecc_decoder.h

Expand Down
9 changes: 9 additions & 0 deletions tests/test_cmake_target.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <qrencode.h>

int main(void)
{
QRcode *code = QRcode_encodeString("CMake target", 0, QR_ECLEVEL_L, QR_MODE_8, 1);
if(code == 0) return 1;
QRcode_free(code);
return 0;
}