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

Thorsten Schöning edited comment on LOGCXX-510 at 1/5/21, 11:34 AM:
--------------------------------------------------------------------

It looks to me "log4cxx.rc" really isn't found because of wrong paths. If I 
change the file "src/main/resources/CMakeLists.txt" to contain the following, 
things work:

{{# Configure
if(WIN32)
target_sources(log4cxx
 PRIVATE
 ../resources/log4cxx.rc
)
endif()}}

 
When I empty that file and change the one actually printing the error 
(src/main/cpp/CMakeLists.txt) in the same way, things work as well:

{{$<IF:$<BOOL:WIN32>,../resources/log4cxx.rc,''>}}

 

{{This even seems to be documented to me:}}

 
{quote}{{Specifies sources to use when building a target and/or its dependents. 
Relative source file paths are interpreted as being relative to the current 
source directory (i.e. 
[{{CMAKE_CURRENT_SOURCE_DIR}}|https://cmake.org/cmake/help/latest/variable/CMAKE_CURRENT_SOURCE_DIR.html#variable:CMAKE_CURRENT_SOURCE_DIR]).}}
{quote}
 

{{https://cmake.org/cmake/help/latest/command/target_sources.html}}


was (Author: tschoening):
It looks to me "log4cxx.rc" really isn't found because of wrong paths. If I 
change the file "src/main/resources/CMakeLists.txt" to contain the following, 
things work:

# Configure
if(WIN32)
target_sources(log4cxx
 PRIVATE
 ../resources/log4cxx.rc
)
endif()

 

When I empty that file and change the one actually printing the error 
(src/main/cpp/CMakeLists.txt) in the same way, things work as well:

{{ $<IF:$<BOOL:WIN32>,../resources/log4cxx.rc,''>}}

 

{{This even seems to be documented to me:}}

 
{quote}{{Specifies sources to use when building a target and/or its dependents. 
Relative source file paths are interpreted as being relative to the current 
source directory (i.e. 
[{{CMAKE_CURRENT_SOURCE_DIR}}|https://cmake.org/cmake/help/latest/variable/CMAKE_CURRENT_SOURCE_DIR.html#variable:CMAKE_CURRENT_SOURCE_DIR]).}}
{quote}
 

{{https://cmake.org/cmake/help/latest/command/target_sources.html}}

> 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, LOGCXX-510.patch, 
> 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)

Reply via email to