From 806e1d21a3940672ced9c1cfeb81aeec8bf0b463 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Thu, 31 Mar 2022 11:26:14 +0200 Subject: Fix perl testing and enable it by default The module files for testing were installed in the wrong location and blib wasn't even enabled. Fix the location and use plain PERL5LIB. Hook it up to ctest by using add_test instead of a custom target, which even conflicted with ctest's own target. Fixes #171 --- bindings/perl/lib/CMakeLists.txt | 2 +- bindings/perl/src/CMakeLists.txt | 2 +- bindings/perl/t/CMakeLists.txt | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bindings/perl/lib/CMakeLists.txt b/bindings/perl/lib/CMakeLists.txt index 9856627..7c36e51 100644 --- a/bindings/perl/lib/CMakeLists.txt +++ b/bindings/perl/lib/CMakeLists.txt @@ -1,2 +1,2 @@ -add_custom_target(PMlibproxy ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Libproxy.pm ${CMAKE_BINARY_DIR}/perl/blib/lib/Libproxy.pm) +add_custom_target(PMlibproxy ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Libproxy.pm ${CMAKE_BINARY_DIR}/perl/Net/Libproxy.pm) install( FILES Libproxy.pm DESTINATION ${PX_PERL_ARCH}/Net ) diff --git a/bindings/perl/src/CMakeLists.txt b/bindings/perl/src/CMakeLists.txt index 05176c4..29e656d 100644 --- a/bindings/perl/src/CMakeLists.txt +++ b/bindings/perl/src/CMakeLists.txt @@ -9,7 +9,7 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Libproxy.c set(Libproxy_LIB_SRCS Libproxy.c) -set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/perl/blib/arch/auto/Net) +set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/perl/auto/Net/Libproxy) add_library(PLlibproxy SHARED ${Libproxy_LIB_SRCS}) set(PLlibproxy_LIB_DEPENDENCIES libproxy pthread) diff --git a/bindings/perl/t/CMakeLists.txt b/bindings/perl/t/CMakeLists.txt index 8007124..cb18fd3 100644 --- a/bindings/perl/t/CMakeLists.txt +++ b/bindings/perl/t/CMakeLists.txt @@ -1 +1,2 @@ -add_custom_target(test prove -b ${CMAKE_CURRENT_SOURCE_DIR}) +add_test(NAME perl COMMAND prove -b ${CMAKE_CURRENT_SOURCE_DIR}) +set_property(TEST perl APPEND PROPERTY ENVIRONMENT "PERL5LIB=${CMAKE_BINARY_DIR}/perl") -- cgit v1.2.1