You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Thorsten Schöning (Jira)" <lo...@logging.apache.org> on 2020/08/23 15:06:00 UTC

[jira] [Comment Edited] (LOGCXX-510) Build problems using CMAKE and Visual Studio 2019 Community

    [ https://issues.apache.org/jira/browse/LOGCXX-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17182714#comment-17182714 ] 

Thorsten Schöning edited comment on LOGCXX-510 at 8/23/20, 3:05 PM:
--------------------------------------------------------------------

I'm successfully able to build the lib now:  [^CMakeSettings.json] 

What doesn't properly work is running the tests using "ctest": That looks for DLLs for log4cxx and expat in some special directories only and can't find them there. The DLLs for APR and APR-Util are found, most likely because I simply configured their paths using APR_DLL and APR_UTIL_DLL. Can't find something similar for EXPAT and LOG4CXX itself, though. After copying the DLLs of EXPAT and LOG4CXX into one of the dirs CMAKE seems to use automatically, at least some tests start to run.

How is that supposed to work? Where does "ctest" look for DLLs by convention by default? Is that something CMAKE does by convention or do those directories need to be part of some "CMakeLists.txt" or ...? Some of the checked directories are part of the build, but don't look like they should contain the necessary DLLs automatically to me:

{quote}
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\0.11.0-SNAPSHOT\src\out\build\x64-Debug\src\test\cpp
{quote}

It seems "ctest" is ignoring most of the environment a shell provides by default. Only the following places are searched for "sed.exe", even though it is definitely in "PATH" in the shell I execute "ctest" in. That's probably the same reason why DLLs are not found when simply added to "PATH", like I tried as well.

{quote}
17:01:13,1357558	patternlayouttest.exe	3564	CreateFile	C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\0.11.0-SNAPSHOT\src\out\build\x64-Debug\src\test\cpp\sed.exe	NAME NOT FOUND	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
17:01:13,1361219	patternlayouttest.exe	3564	CreateFile	C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\0.11.0-SNAPSHOT\src\src\test\resources\sed.exe	NAME NOT FOUND	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
17:01:13,1364906	patternlayouttest.exe	3564	CreateFile	C:\Windows\System32\sed.exe	NAME NOT FOUND	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
17:01:13,1368278	patternlayouttest.exe	3564	CreateFile	C:\Windows\System\sed.exe	NAME NOT FOUND	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
17:01:13,1371538	patternlayouttest.exe	3564	CreateFile	C:\Windows\sed.exe	NAME NOT FOUND	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
17:01:13,1374245	patternlayouttest.exe	3564	CreateFile	C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\0.11.0-SNAPSHOT\src\src\test\resources\=\sed.exe	PATH NOT FOUND	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
17:01:13,1377732	patternlayouttest.exe	3564	CreateFile	C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C\X-OS\APR\apr\1.7.0\src\out\install\x64-Debug\bin\sed.exe	NAME NOT FOUND	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
17:01:13,1381116	patternlayouttest.exe	3564	CreateFile	C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C\X-OS\APR\apr-util\1.6.1\src\out\install\x64-Debug\bin\sed.exe	NAME NOT FOUND	Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
{quote}


was (Author: tschoening):
I'm successfully able to build the lib now:  [^CMakeSettings.json] 

What doesn't properly work is running the tests using "ctest": That looks for DLLs for log4cxx and expat in some special directories only and can't find them there. The DLLs for APR and APR-Util are found, most likely because I simply configured their paths using APR_DLL and APR_UTIL_DLL. Can't find something similar for EXPAT and LOG4CXX itself, though. After copying the DLLs of EXPAT and LOG4CXX into one of the dirs CMAKE seems to use automatically, at least some tests start to run.

How is that supposed to work? Where does "ctest" look for DLLs by convention by default? Is that something CMAKE does by convention or do those directories need to be part of some "CMakeLists.txt" or ...? Some of the checked directories are part of the build, but don't look like they should contain the necessary DLLs automatically to me:

{quote}
C:\Users\tschoening\Documents\Svn\Src\Libs\trunk\C++\Logging\log4cxx\0.11.0-SNAPSHOT\src\out\build\x64-Debug\src\test\cpp
{quote}

> 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
>         Attachments: CMP00079.png, CMakeSettings.json, 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)