[
https://issues.apache.org/jira/browse/LOGCXX-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17258448#comment-17258448
]
Thorsten Schöning edited comment on LOGCXX-510 at 1/4/21, 7:37 PM:
-------------------------------------------------------------------
I'm running into problems again when building the current MASTER:
{quote}Schweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandSchweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandFehler CMake Error at
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\master\src\src\CMakeLists.txt:4
(target_link_libraries): Attempt to add link library "EXPAT::EXPAT" to target
"log4cxx" which is not built in this directory.
This is allowed only when policy CMP0079 is set to NEW.
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\master\src\src\CMakeLists.txt
4
{quote}
The already added "cmake_policy(SET CMP0079 NEW)" needs to be moved tot he top
of the file to take EXPAT into account as well to workaround this problem.
Though, the already mentioned problem with "log4cxx.rc" comes up again:
{quote}Schweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandSchweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandFehler CMake Error at main/cpp/CMakeLists.txt:6
(add_library): Cannot find source file:
log4cxx.rc
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\master\src\src\main/cpp/CMakeLists.txt
6
{quote}
I couldn't find how I worked around that in the past... :-/
There are additional warnings I can't remember of in the past:
{quote}Schweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandSchweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandWarnung CMake Warning (dev) in
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\master\src\src\CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.18)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".This warning is for project
developers. Use -Wno-dev to suppress it.
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\master\src\src\CMakeLists.txt
1
{quote}
{quote}Schweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandSchweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandWarnung CMake Warning (dev) in
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\master\src\src\CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of code
such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.This warning is for project developers. Use -Wno-dev to suppress it.
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\master\src\src\CMakeLists.txt
1
{quote}
{quote}Schweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandSchweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandWarnung CMake Warning (dev) at main/cpp/CMakeLists.txt:6
(add_library): Policy CMP0028 is not set: Double colon in target name means
ALIAS or IMPORTED target. Run "cmake --help-policy CMP0028" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Target "log4cxx" links to target "EXPAT::EXPAT" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?This warning is for project developers. Use -Wno-dev
to suppress it.
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\master\src\src\main/cpp/CMakeLists.txt
6
{quote}
{quote}Schweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandSchweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandWarnung CMake Warning (dev) at
main/resources/CMakeLists.txt:3 (target_sources): Policy CMP0076 is not set:
target_sources() command converts relative paths to absolute. Run "cmake
--help-policy CMP0076" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
A private source from a directory other than that of target "log4cxx" has a
relative path.This warning is for project developers. Use -Wno-dev to suppress
it.
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\master\src\src\main/resources/CMakeLists.txt
3
{quote}
The only thing I remembered to have done since I tried last was upgrading
Visual Studio, bu it's still 19 Community.
was (Author: tschoening):
I'm running into problems again when building the current MASTER:
{quote}Schweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandSchweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandFehler CMake Error at
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\master\src\src\CMakeLists.txt:4
(target_link_libraries): Attempt to add link library "EXPAT::EXPAT" to target
"log4cxx" which is not built in this directory.
This is allowed only when policy CMP0079 is set to NEW.
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\master\src\src\CMakeLists.txt
4
{quote}
The already added "cmake_policy(SET CMP0079 NEW)" needs to be moved tot he top
of the file to take EXPAT into account as well to workaround this problem.
Though, the already mentioned problem with "log4cxx.rc" comes up again:
{quote}Schweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandSchweregrad Code Beschreibung Projekt Datei Zeile
UnterdrückungszustandFehler CMake Error at main/cpp/CMakeLists.txt:6
(add_library): Cannot find source file:
log4cxx.rc
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\master\src\src\main/cpp/CMakeLists.txt
6
{quote}
I couldn't find how I worked around that in the past... :-/
> Build problems using CMAKE and Visual Studio 2019 Community
> -----------------------------------------------------------
>
> Key: LOGCXX-510
> URL: https://issues.apache.org/jira/browse/LOGCXX-510
> Project: Log4cxx
> Issue Type: Bug
> Components: Build
> Affects Versions: 0.11.0
> Reporter: Thorsten Schöning
> Assignee: Thorsten Schöning
> Priority: Major
> Fix For: 0.12.0
>
> Attachments: CMP00079.png, CMakeSettings.json,
> cmake_settings_using_vs_gui 02.png, cmake_settings_using_vs_gui.zip,
> missing_log4cxx_rc.png, set_target_properties.png
>
>
> I just tested building log4cxx using CMAKE and Visual Studio 2019 Community.
> Things failed and I want to use this bug to document everything that I've
> found, because for some things I'm not sure how to handle them properly. Will
> create a new branch to maintain the fixes I came along, so that those can at
> best be later reviewed by others. The branch of interest is currently named
> "logcxx_510_cmake_vs2019_compat".
--
This message was sent by Atlassian Jira
(v8.3.4#803005)