Open dreuter opened 2 years ago
Noetic targets Ubuntu 20.04. Is this in support of building Noetic from source on 22.04?
Noetic targets Ubuntu 20.04. Is this in support of building Noetic from source on 22.04?
Yes this is for a source build of noetic on Ubuntu 22.04 (or any rolling distro like Gentoo and Arch)
On Ubuntu 22.04
log4cxx
is configured to use the std library forshared_mutex
andshared_lock
. Unfortunately this requiresC++17
, because otherwise the reverse dependencies of rosconsole fail with an error like this:This means that if
log4cxx
requiresC++17
everything that linksrosconsole_log4xx
also needs to compile withC++17
enabled, which is why I am setting theCMAKE_CXX_STANDARD
andCMAKE_CXX_STANDARD_REQUIRED
in cfg extras. I am checking whether the standard is already set to a higher standard, to not overwrite the user settings, if they need a newer standard.Unfortunately we cannot set the
CXX_STANDARD
property onrosconsole_log4cxx
directly, since it is not exported withcatkin
.We cannot make
log4cxx
use boost, since this is an upstream package and the decision is made during configure time. Since this is an option that can be toggled by the provider of thelog4cxx
library and since it is not version dependent the best way I found to figure out whether the option was set or not is by "inspecting" thelog4cxx/boost-std-configuration.h
file.Unfortunately
try_compile
has no option to set theinclude_directories
when using the overload for a single source file and since we did notinclude_directories
LOG4CXX_INCLUDE_DIRS
at this point I created a small cmake project which includes thelog4cxx
headers. (We cannot execute thetry_compile
later, since it needs to run beforecatkin_package
)