Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ant build with cmake #14

Merged
merged 54 commits into from
Feb 16, 2020
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
a853310
Add support for building and testing with cmake
stephen-webb Oct 6, 2019
774ea16
Add support for building and testing with cmake
stephen-webb Oct 7, 2019
b472300
Simplify integration into vcpkg
stephen-webb Oct 11, 2019
e3000f6
Fix issues building on Linux
stephen-webb Oct 12, 2019
80a9fdb
Disable building tests by default to conform with vcpkg guidelines
stephen-webb Oct 13, 2019
d919ea1
Provide find modules for APR and APR-Util. Add the version resource t…
stephen-webb Jan 28, 2020
c244c28
Build examples when building tests
stephen-webb Jan 31, 2020
e64b7cf
Use cmake from maven to build and only use ant for site deployment an…
stephen-webb Jan 31, 2020
5b5ec13
Set release date to today.
stephen-webb Jan 31, 2020
a71f936
Set the letter case of find modules to that required by case sensitiv…
stephen-webb Jan 31, 2020
e5f8af1
Set the letter case of find modules to that required by case sensitiv…
stephen-webb Jan 31, 2020
704a80f
Merge branch 'master' of https://github.com/apache/logging-log4cxx
stephen-webb Jan 31, 2020
6c1e0b6
Set the letter case of find modules to that required by case sensitiv…
stephen-webb Jan 31, 2020
472d97b
Set the letter case of find modules to that required by case sensitiv…
stephen-webb Jan 31, 2020
5b81898
Set the letter case of find modules to that required by case sensitiv…
stephen-webb Jan 31, 2020
0504bc5
Merge branch 'master' of https://github.com/stephen-webb/logging-log4cxx
stephen-webb Jan 31, 2020
4ffba69
Merge https://github.com/apache/logging-log4cxx
stephen-webb Jan 31, 2020
c3146a5
Add JSON appender and test
stephen-webb Jan 31, 2020
73f7333
Add JSON appender and test
stephen-webb Jan 31, 2020
426660e
Merge https://github.com/apache/logging-log4cxx into replace-ant-buil…
stephen-webb Jan 31, 2020
f3edfc4
Merge branch 'master' of https://github.com/stephen-webb/logging-log4cxx
stephen-webb Jan 31, 2020
48c597b
Fix some test case failures
stephen-webb Jan 31, 2020
08d6176
Fix some test case failures
stephen-webb Jan 31, 2020
dc7dc14
Remove unused files
stephen-webb Jan 31, 2020
b3bec51
Remove unused files
stephen-webb Jan 31, 2020
7995db2
Merge branch 'replace-ant-build-with-cmake' of https://github.com/ste…
stephen-webb Jan 31, 2020
8dc8120
Fix some test case failures
stephen-webb Jan 31, 2020
4745721
Use automatic checks instead of options for log4cxx_private.h configu…
stephen-webb Feb 1, 2020
c4f1b3d
Provide install directory variables as defined by the GNU Coding Stan…
stephen-webb Feb 1, 2020
6862c5e
Use semantic versioning symbolic links in the installed target
stephen-webb Feb 1, 2020
f133149
Install a pkgconfig file on unix systems
stephen-webb Feb 1, 2020
d08e392
Fix failing defaultinittestcase
stephen-webb Feb 3, 2020
06875bd
Revert "Fix failing defaultinittestcase"
stephen-webb Feb 3, 2020
b9d9b0e
Fix failing defaultinittestcase
stephen-webb Feb 3, 2020
cd4a455
Only include smtpappendertestcase when libesmtp is available
stephen-webb Feb 6, 2020
d5b5c38
Run autoconf during packaging if the OS is unix
stephen-webb Feb 7, 2020
e0b4e4d
Remove ant build references from build instructions. Add instructions…
stephen-webb Feb 7, 2020
ac90504
Change to cmake-maven-plugin that works on Windows
stephen-webb Feb 7, 2020
6ae3567
Fix typo in instructions for building from source on Windows
stephen-webb Feb 7, 2020
d0c6cae
Allow maven to be used with generators that need to be told which con…
stephen-webb Feb 7, 2020
b971dd0
Make socketservertestcase work independently of ant build
stephen-webb Feb 8, 2020
a261ca7
Remove cpptasks as a dependency
stephen-webb Feb 8, 2020
84d3b60
Add platform specific instructions for cmake install
stephen-webb Feb 9, 2020
178598b
Allow tests on Windows to be run from ctest
stephen-webb Feb 9, 2020
2027010
Merge branch 'replace-ant-build-with-cmake' of https://github.com/ste…
stephen-webb Feb 9, 2020
c8eb659
Halt with an error if either APR or APR-Util cannot be found
stephen-webb Feb 9, 2020
c36fea0
Make the file render properly.
ams-tschoening Feb 9, 2020
bb9ab5f
Enhance support for paths with spaces by simply using a different div…
ams-tschoening Feb 9, 2020
e2c3533
Make the file render properly.
ams-tschoening Feb 9, 2020
05e107a
Allow the socketservertestcase to be run on Windows
stephen-webb Feb 10, 2020
0e5aee9
Allow the socketservertestcase to be built with Java 8
stephen-webb Feb 10, 2020
13a1eed
Fix abnormal termination fault in socketservertestcase. Remove C++11 …
stephen-webb Feb 10, 2020
af0134a
Prevent test case failures on Windows by excluding tests that require…
stephen-webb Feb 10, 2020
3775ffa
Prevent socketservertestcase failures when using Maven to build and test
stephen-webb Feb 11, 2020
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
52 changes: 52 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.13)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to have a lower version of cmake? What I generally do is to target the version of CMake that is in the oldstable version of Debian(as of right now, Debian 9(stretch) has cmake 3.7). This is not a requirement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I may have used some cmake that requires 3.13. It was 6 months ago so I cannot recall exact details.

I have been trying to follow best practices in Professional CMake (4th Edition)

include(src/cmake/projectVersionDetails.cmake)
project(log4cxx VERSION ${log4cxx_VER} LANGUAGES CXX)
include(CTest)

# FindAPR and FindAPR-util are not provided by APR and APR-Util so source them locally
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/src/cmake")

# 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 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 PATH_SUFFIXES apr-1)
find_library(APR_UTIL_LIBRARIES NAMES libaprutil-1 aprutil-1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this use FindPkgConfig and pkg_check_modules on Unix systems instead of find_package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DO APR and APR-UTIL provide support pkg-config?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I'm aware they do; I just tried this on Debian 10(buster), and it works properly though. I'm not sure what is best. Maybe this is better as a fallback if pkg_check_modules fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best practices from Professional CMake book include the statement:
"Use of the FindPkgConfig module should be reserved only for those situations where find_package()
is not suitable."

I am inclined to stick with find_package if that is OK.


# Building
add_subdirectory(src)

## Installing
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src/main/include/log4cxx
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/main/include/log4cxx
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)

install(TARGETS log4cxx EXPORT log4cxxTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
stephen-webb marked this conversation as resolved.
Show resolved Hide resolved
IF(WIN32 AND LOG4CXX_INSTALL_PDB)
INSTALL(FILES $<TARGET_PDB_FILE:log4cxx>
DESTINATION ${CMAKE_INSTALL_BINDIR}
CONFIGURATIONS RelWithDebInfo Debug
)
ENDIF()

# create export file which can be imported by other cmake projects
install(EXPORT log4cxxTargets
FILE log4cxx-targets.cmake
NAMESPACE log4cxx::
DESTINATION share/cmake/log4cxx
)
Loading