File: standalone-tests.patch

package info (click to toggle)
log4cxx 1.4.0-1%2Bdeb13u1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 5,636 kB
  • sloc: cpp: 47,740; xml: 1,041; sh: 43; makefile: 17
file content (43 lines) | stat: -rw-r--r-- 1,502 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- a/src/test/CMakeLists.txt
+++ b/src/test/CMakeLists.txt
@@ -15,4 +15,29 @@
 # limitations under the License.
 #
 
+cmake_minimum_required(VERSION 3.13)
+
+project(log4cxx_debian_autopkgtest LANGUAGES CXX)
+
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+include_directories(${APR_INCLUDE_DIRS})
+
+#cmake_policy(SET CMP0115 OLD)
+
+include(CTest)
+
+find_package(log4cxx REQUIRED)
+find_package(Threads REQUIRED)
+find_package(EXPAT REQUIRED)
+
+find_package(PkgConfig REQUIRED)
+# The FindAPR macro shipped with log4cxx seems to be subtle broken
+# It seems to prefer the static lib and not passing all libs required for APR, yielding
+# a link error. pkg-config works fine, otoh.
+# Downside: The defined vars are APR_INCLUDE_DIR*S* (plural) instead of singular.
+pkg_check_modules(APR REQUIRED apr-1)
+pkg_check_modules(APR_UTIL REQUIRED apr-util-1)
+
 add_subdirectory(cpp)
--- a/src/test/cpp/CMakeLists.txt
+++ b/src/test/cpp/CMakeLists.txt
@@ -17,6 +17,8 @@
 
 # Components required by all tests
 add_library(testingFramework STATIC abts.cpp appenderskeletontestcase.cpp logunit.cpp vectorappender.cpp writerappendertestcase.cpp )
+include_directories(${APR_INCLUDE_DIRS})
+
 target_compile_definitions(testingFramework PRIVATE ${LOG4CXX_COMPILE_DEFINITIONS} ${APR_COMPILE_DEFINITIONS} ${APR_UTIL_COMPILE_DEFINITIONS} )
 target_include_directories(testingFramework PRIVATE ${CMAKE_CURRENT_LIST_DIR} $<TARGET_PROPERTY:log4cxx,INCLUDE_DIRECTORIES>)
 add_subdirectory(util)