You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ts...@apache.org on 2020/02/09 20:19:44 UTC
[logging-log4cxx] 04/49: Fix issues building on Linux
This is an automated email from the ASF dual-hosted git repository.
tschoening pushed a commit to branch ghpr_14_replace-ant-build-with-cmake
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
commit e3000f6ade371f418a3c72e69589d5af53083abb
Author: Stephen Webb <st...@sabreautonomous.com.au>
AuthorDate: Sat Oct 12 18:34:37 2019 +1100
Fix issues building on Linux
---
CMakeLists.txt | 6 +++---
src/main/include/CMakeLists.txt | 8 ++++----
src/test/cpp/CMakeLists.txt | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c688f1..acd270a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,13 +4,13 @@ project(log4cxx VERSION 0.10.0 LANGUAGES CXX)
# Find Apache Runtime
find_package(apr QUIET)
# If APR find module sets the cache, the following will do nothing
-find_path(APR_INCLUDE_DIR apr.h)
+find_path(APR_INCLUDE_DIR apr.h PATH_SUFFIXES apr-1)
find_library(APR_LIBRARIES NAMES libapr-1 apr-1)
# Find Apache Runtime Utilities
find_package(apr-util QUIET)
# If APR-UTIL find module sets the cache, the following will do nothing
-find_path(APR_UTIL_INCLUDE_DIR apu.h)
+find_path(APR_UTIL_INCLUDE_DIR apu.h PATH_SUFFIXES apr-1)
find_library(APR_UTIL_LIBRARIES NAMES libaprutil-1 aprutil-1)
## Testing
@@ -38,7 +38,7 @@ install(TARGETS log4cxx EXPORT log4cxxTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
-IF(LOG4CXX_INSTALL_PDB)
+IF(WIN32 AND LOG4CXX_INSTALL_PDB)
INSTALL(FILES $<TARGET_PDB_FILE:log4cxx>
DESTINATION ${CMAKE_INSTALL_BINDIR}
CONFIGURATIONS RelWithDebInfo Debug
diff --git a/src/main/include/CMakeLists.txt b/src/main/include/CMakeLists.txt
index 680101d..0afef45 100644
--- a/src/main/include/CMakeLists.txt
+++ b/src/main/include/CMakeLists.txt
@@ -88,10 +88,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/private/log4cxx_private.h.in
add_custom_target(configure_log4cxx
COMMAND "${CMAKE_COMMAND}" -E echo "Checking configuration"
DEPENDS
- ${CMAKE_CURRENT_SOURCE_DIR}/include/log4cxx/log4cxx.h.in
- ${CMAKE_CURRENT_SOURCE_DIR}/include/log4cxx/private/log4cxx_private.h.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/log4cxx.h.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx/private/log4cxx_private.h.in
BYPRODUCTS
- ${CMAKE_CURRENT_BINARY_DIR}/include/log4cxx/log4cxx.h
- ${CMAKE_CURRENT_BINARY_DIR}/include/log4cxx/private/log4cxx_private.h
+ ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/log4cxx.h
+ ${CMAKE_CURRENT_BINARY_DIR}/log4cxx/private/log4cxx_private.h
)
endif()
diff --git a/src/test/cpp/CMakeLists.txt b/src/test/cpp/CMakeLists.txt
index ad3665f..7a0ada9 100644
--- a/src/test/cpp/CMakeLists.txt
+++ b/src/test/cpp/CMakeLists.txt
@@ -50,7 +50,7 @@ add_subdirectory(xml)
foreach(testName IN LISTS ALL_LOG4CXX_TESTS)
target_include_directories(${testName} PRIVATE ${CMAKE_CURRENT_LIST_DIR} $<TARGET_PROPERTY:log4cxx,INCLUDE_DIRECTORIES>)
- target_link_libraries(${testName} PRIVATE log4cxx testingFramework testingUtilities ${APR_LIBRARIES})
+ target_link_libraries(${testName} PRIVATE testingFramework testingUtilities log4cxx ${APR_LIBRARIES})
add_test(NAME ${testName}
COMMAND ${testName} -v
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../resources