You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by jeking3 <gi...@git.apache.org> on 2018/01/10 21:56:30 UTC

[GitHub] logging-log4cxx pull request #3: windows cmake build for log4cxx against apr...

GitHub user jeking3 opened a pull request:

    https://github.com/apache/logging-log4cxx/pull/3

    windows cmake build for log4cxx against apr-2

    I've used log4cxx for quite some time and I was surprised to find there are no project or cmake files for windows builds in the trunk.  In the past I have cobbled together various sources and made visual studio projects to wrap apr, apr-util, and log4cxx into a single build.  
    
    Today, I spent the day making a cmake build environment that leverages the latest apr-2 development trunk.
    
    When you build apr-2 with cmake on Windows you get a static and a shared library in the prefix output directory.  The static library is named `apr-2.lib` and the dynamic link library is `libapr-2.{dll,lib}`.  I accounted for this in the cmake, expecting folks to set `-DBUILD_SHARED_LIBS={ON|OFF}`.  There are a number of build warnings when building dynamic, and it looks like some dllexport declarations are missing.  This PR does not correct those shortcomings.
    
    I pulled some concepts from cmake files in the Apache Thrift project.
    
    Here is an example configuration run and the output for configuring a Static, Release, VS2010 build.  The out-of-tree build directory is `c:\Temp\log4cxx-build\Static\Release`.  The source tree is `c:\temp\logging-log4cxx`.  Files will be installed into `C:\temp\log4cxx-install\Static\Release`.
    
    In the build directory you get a full Visual Studio project that you can use if you want.
    
    ```
    c:\Temp\log4cxx-build\Static\Release>cmake -G"Visual Studio 10 2010 Win64" c:\temp\logging-log4cxx -DCMAKE_INSTALL_PREFIX=C:\temp\log4cxx-install\Static\Release -DAPR2_ROOT_DIR=C:\Build\org.apache\apr\install\Static\Release
    -- Configuring build environment for log4cxx version 0.11.1
    -- The C compiler identification is MSVC 16.0.40219.1
    -- The CXX compiler identification is MSVC 16.0.40219.1
    -- Check for working C compiler: c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe
    -- Check for working C compiler: c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe
    -- Check for working CXX compiler: c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found APR2: C:/build/org.apache/apr/install/Static/Release/include
    --
    -- Configuration Summary for log4cxx:
    --
    --   APR2_FOUND           TRUE
    --   APR2_INCLUDE_DIRS    C:/build/org.apache/apr/install/Static/Release/include
    --   APR2_LIBRARIES       C:/build/org.apache/apr/install/Static/Release/lib/libapr-2.lib
    --
    --   PROJECT_DESCRIPTION  Apache Logging Framework for C++
    --   PROJECT_NAME         log4cxx
    --   PROJECT_LICENSE      Apache Software License 2.0
    --   PROJECT_LICURL       http://www.apache.org/licenses/LICENSE-2.0
    --   PROJECT_URL          http://logging.apache.org/log4cxx/
    --   PROJECT_VERSION      0.11.1
    --
    --   Install Prefix       C:/Temp/log4cxx-install/Static/Release
    --   Language Level       c++98 [compiler must support it]
    --   Link Strategy        Shared with shared runtime
    --
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Temp/log4cxx-build/Static/Release
    ```
    
    It can then be built with:
    
    ```
    c:\Temp\log4cxx-build\Static\Release>cmake --build . --target install --config Release
    ```


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jeking3/logging-log4cxx cmake

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/logging-log4cxx/pull/3.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3
    
----
commit 7d726844c2d3200eb59b2d251c3cff1f24482d08
Author: James E. King, III <ji...@...>
Date:   2018-01-10T21:45:58Z

    windows cmake build for log4cxx against apr-2

----


---

[GitHub] logging-log4cxx issue #3: windows cmake build for log4cxx against apr-2

Posted by jeking3 <gi...@git.apache.org>.
Github user jeking3 commented on the issue:

    https://github.com/apache/logging-log4cxx/pull/3
  
    Not recommending a change in the overall build system.
    
    Following the Apache apr project, autotools is used on unix, and either cmake or a provided project is used on windows.  I think that will work here; we do something similar in Apache Thrift for windows support.
    
    The complete lack of windows build support at all in the project trunk is what worries me the most. 
     The instructions on the web site tell people to go to a directory that does not exist and use a project file that is not there.  See: https://logging.apache.org/log4cxx/latest_stable/building/vstudio.html
    
    Version 0.10.0 eliminated all visual studio project files from the project, leaving folks to cobble their own solution together, so this is an attempt at remedying it.


---

[GitHub] logging-log4cxx issue #3: LOGCXX-494: windows cmake build for log4cxx agains...

Posted by tschoening <gi...@git.apache.org>.
Github user tschoening commented on the issue:

    https://github.com/apache/logging-log4cxx/pull/3
  
    > Any update on this? It's almost 3 months old now and no updates from the log4cxx team.
    
    Because I responded on the mailing list:
    
    http://mail-archives.apache.org/mod_mbox/logging-dev/201801.mbox/<1913119533.20180111172120%40am-soft.de>
    
    At least I don't have any plans to deal with such a major change in the build currently, I simply don't have the time to do so.
    
    > Not recommending a change in the overall build system.
    
    It's either about the addition of CMAKE to what is already there or the replacement of something which is already there, both are major changes from my understanding. And we already have Autotools, Maven, Shell Scripts, ANT and none of those is properly integrated with each other to support everything which is needed, like development iteration, version number updates, release date updates, site generation etc.
    
    > The complete lack of windows build support at all in the project trunk is what worries me the most.
    
    Build support in trunk was/is available using ANT and cpptasks and at least for some recent versions of Visual Studio this worked:
    
    https://logging.apache.org/log4cxx/latest_stable/building/index.html
    
    > The instructions on the web site tell people to go to a directory that does not exist and use a project file that is not there.
    
    Because those instructions addressed a release.
    
    > Version 0.10.0 eliminated all visual studio project files from the project[...]
    
    I'm somewhat sure they have never been in trunk, but only in the release package and have been generated during the release process. If you look at the following packages, some generated projects are still available:
    
    https://dist.apache.org/repos/dist/dev/logging/log4cxx/


---

[GitHub] logging-log4cxx issue #3: windows cmake build for log4cxx against apr-2

Posted by tschoening <gi...@git.apache.org>.
Github user tschoening commented on the issue:

    https://github.com/apache/logging-log4cxx/pull/3
  
    Just some notes: While it has been discussed in the past to move to CMAKE already, keep in mind that the current build bases on Autotools and/or Maven and/or Ant deals with things like projetc files generation, website generation, development iteration incl. version numbers etc. as well. So it's not only about adding CMAKE support, but one needs to ultimately decide which parts of the current build tools are kept and all that.


---

[GitHub] logging-log4cxx issue #3: LOGCXX-494: windows cmake build for log4cxx agains...

Posted by jeking3 <gi...@git.apache.org>.
Github user jeking3 commented on the issue:

    https://github.com/apache/logging-log4cxx/pull/3
  
    Any update on this?  It's almost 3 months old now and no updates from the log4cxx team.


---