microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22k stars 6.12k forks source link

Add log4cxx to vcpkg #6125

Closed SergeiDelov closed 3 years ago

SergeiDelov commented 5 years ago

Yes, I know vcpkg has log4cplus in ports, but if log4cxx was used in the existing code no one will switch to log4cplus. log4cxx is well documented; APR dependency is already in ports.

MicheleBe commented 5 years ago

I endorse the insertion of the library, many thanks

ziglar0 commented 4 years ago

has log4cxx been added?

trueqbit commented 4 years ago

has log4cxx been added?

@stephen-webb is currently working on it, right? Any reason not to make a draft PR, Stephen?

stephen-webb commented 4 years ago

It is not a PR because my PR that adds cmake build files to log4cxx has not been merged into the log4cxx repository. So there is not an official release archive to use in the vcpkg port file.

I am hoping the log4cxx maintainers will accept my PR. Then I can make a vcpkg PR.

For now, you could clone my vcpkg fork ( https://github.com/stephen-webb/vcpkg.git) that has a portfile,cmake for log4cxx pointing to my forked log4cxx.

Regards Stephen Webb

On Sat, Jan 4, 2020 at 12:06 AM klaus triendl notifications@github.com wrote:

has log4cxx been added?

@stephen-webb https://github.com/stephen-webb is currently working on it https://github.com/stephen-webb/vcpkg/tree/add-log4cxx-port, right? Any reason not to make a draft PR, Stephen?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/6125?email_source=notifications&email_token=ANLOSDVQCWQCNUY42U2STPTQ34Z4FA5CNFSM4HGVQQPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIBCROA#issuecomment-570566840, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLOSDXVPO7QF6UUTI22ZWLQ34Z4FANCNFSM4HGVQQPA .

dhkatz commented 4 years ago

It's possible to get this port working without needing a merge into the library's repository.

You can include a CMakeLists.txt with the port and simply copy it into the downloaded source repository.

This is how we accomplished CMake support for sdl2-gfx

stephen-webb commented 4 years ago

The log4cxx PR I made consists of 20 CMakeLists.txt files in 20 directories. Given the complexity of log4cxx the changes would be better kept in the log4cxx repository.

Also #8579 (which has been waiting attention from vcpkg committer for months) is a prerequisite for non-windows systems,

On Mon, Jan 6, 2020 at 9:15 AM David Katz notifications@github.com wrote:

It's possible to get this port working without needing a merge into the library's repository.

You can include a CMakeLists.txt with the port and simply copy it into the downloaded source repository.

This is how we accomplished CMake support for sdl2-gfx https://github.com/microsoft/vcpkg/tree/7ac7a463433c9e1d166b7e5951b6706dc88d3719/ports/sdl2-gfx

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/6125?email_source=notifications&email_token=ANLOSDREKGJSRQWZK3GY6BTQ4JLXFA5CNFSM4HGVQQPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIEA46Q#issuecomment-570953338, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLOSDXFVTETGGJV7PLHWC3Q4JLXFANCNFSM4HGVQQPA .

trueqbit commented 4 years ago

Does vcpkg require an official release archive/tag? It doesn't seem like Thorsten is addressing the pull request any time soon... A draft PR would help discussing it (e.g. I didn't succeed to build your vcpkg port on Windows).

stephen-webb commented 4 years ago

vcpkg guidelines recommended using official releases.

Could you share the problem you had (including the visual studio version)? I used VS2019 community,

trueqbit commented 4 years ago

I am using VS2019 16.4.3 with the msvc 14.24 toolset. All dependencies are compiling fine, but your log4cxx port fails (even it's building the release version it refers to a missing ucrtd.lib).

The relevant error extracted from buildtrees\log4cxx\x86-windows-rel\CMakeFiles\CMakeError.log:

LINK : fatal error LNK1104: cannot open file 'ucrtd.lib'
[E:\projects\stephen-webb-vcpkg\buildtrees\log4cxx\x86-windows-rel\CMakeFiles\3.16.0\CompilerIdCXX\CompilerIdCXX.vcxproj]
stephen-webb commented 4 years ago

I see in #6324 this issue was resolved by reinstalling windows sdk and vcpkg

LeeGDavis commented 4 years ago

Not sure if this is the correct place for this, however... @stephen-webb running your fork I get the following error on log4cxx on windows 10 with the x64-windows triplet.

Building package log4cxx[core]:x64-windows...
-- Downloading https://github.com/stephen-webb/logging-log4cxx/archive/master.tar.gz...
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:99 (message):

  File does not have expected hash:

          File path: [ D:/Projects/vcpkg/downloads/temp/stephen-webb-logging-log4cxx-master.tar.gz ]
      Expected hash: [ ffa6b7dbcb77224565f523ba45919f2f388b8067fb7e26653e5e41b4c5a07b82b8b627b2ff06ea8a4fae8cf3a5a8e8959c3f53e332d4b7b125018b11c9b7abbb ]
        Actual hash: [ 87c244d6f52c768830cfb7514eb7ebef05c4a445cb2e43e064e9df7c9d10e43e031318cd19e4dd1f7858e3460d24605bc6382c809ab1f6f6bdf108cf60236faa ]

  The file may have been corrupted in transit.  This can be caused by
  proxies.  If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY
  environment variables to
  "https://user:password@your-proxy-ip-address:port/".

Call Stack (most recent call first):
  scripts/cmake/vcpkg_download_distfile.cmake:182 (test_hash)
  scripts/cmake/vcpkg_from_github.cmake:132 (vcpkg_download_distfile)
  ports/log4cxx/portfile.cmake:2 (vcpkg_from_github)
  scripts/ports.cmake:94 (include)
stephen-webb commented 4 years ago

Just edit your copy of ports/log4cxx/portFile.cmake and replace the hash with the actual hash. Then retry the "vcpkg install log4cxx".

As the git master changes, the hash will change. I have not been updating my vcpkg fork every time I commit to my log4cxx fork (and do not plan to start doing that).

Regards Stephen Webb

On Thu, Mar 5, 2020 at 2:52 PM Lee Davis notifications@github.com wrote:

Not sure if this is the correct place for this, however... @stephen-webb https://github.com/stephen-webb running your fork I get the following error on log4cxx on window with the x64-windows triplet.

Building package log4cxx[core]:x64-windows... -- Downloading https://github.com/stephen-webb/logging-log4cxx/archive/master.tar.gz... CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:99 (message):

File does not have expected hash:

      File path: [ D:/Projects/vcpkg/downloads/temp/stephen-webb-logging-log4cxx-master.tar.gz ]
  Expected hash: [ ffa6b7dbcb77224565f523ba45919f2f388b8067fb7e26653e5e41b4c5a07b82b8b627b2ff06ea8a4fae8cf3a5a8e8959c3f53e332d4b7b125018b11c9b7abbb ]
    Actual hash: [ 87c244d6f52c768830cfb7514eb7ebef05c4a445cb2e43e064e9df7c9d10e43e031318cd19e4dd1f7858e3460d24605bc6382c809ab1f6f6bdf108cf60236faa ]

The file may have been corrupted in transit. This can be caused by proxies. If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment variables to "https://user:password@your-proxy-ip-address:port/".

Call Stack (most recent call first): scripts/cmake/vcpkg_download_distfile.cmake:182 (test_hash) scripts/cmake/vcpkg_from_github.cmake:132 (vcpkg_download_distfile) ports/log4cxx/portfile.cmake:2 (vcpkg_from_github) scripts/ports.cmake:94 (include)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/6125?email_source=notifications&email_token=ANLOSDSRDS3U5M5JLYQXOZDRF4OWVA5CNFSM4HGVQQPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN3TJ4I#issuecomment-595014897, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLOSDWAOKGTGA3MMTA2VM3RF4OWVANCNFSM4HGVQQPA .

LeeGDavis commented 4 years ago

Thanks @stephen-webb, sounds good!

LeeGDavis commented 4 years ago

@stephen-webb making the hash correction allows the build to continue and it appears successful, however it looks like it is not able to find this package in cmake with find_package. I imagine the cmake files are not being copied to some particular location expected by the CMAKE_TOOLCHAIN_FILE? I'm new to vcpkg, so trying to get my head wrapped around all this.

The package log4cxx:x64-windows provides CMake targets:

    find_package(log4cxx CONFIG REQUIRED)
    target_link_libraries(main PRIVATE log4cxx::log4cxx)
CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:285 (_find_package):

  Could not find a package configuration file provided by "log4cxx" with any
  of the following names:

    log4cxxConfig.cmake
    log4cxx-config.cmake

  Add the installation prefix of "log4cxx" to CMAKE_PREFIX_PATH or set
  "log4cxx_DIR" to a directory containing one of the above files.  If
  "log4cxx" provides a separate development package or SDK, be sure it has
  been installed.
stephen-webb commented 4 years ago

What type of system are you using?

Have you read https://vcpkg.readthedocs.io/en/latest/users/integration/ ?

On Thu, Mar 5, 2020 at 6:37 PM Lee Davis notifications@github.com wrote:

@stephen-webb https://github.com/stephen-webb making the hash correction allows the build to continue and it appears successful, however it looks like it is not able to find this package in cmake with find_package. I imagine the cmake files are not being copied to some particular location expected by the CMAKE_TOOLCHAIN_FILE? I'm new to vcpkg, so trying to get my head wrapped around all this.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/6125?email_source=notifications&email_token=ANLOSDTIZPJ2DKQM5KGFNK3RF5JDRA5CNFSM4HGVQQPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN4BNFY#issuecomment-595072663, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLOSDVAHZCTKTEMODVVJXTRF5JDRANCNFSM4HGVQQPA .

LeeGDavis commented 4 years ago

@stephen-webb I did read through that integration and believe I have it correct, but wouldn't put it past me to miss something here... Machine: aws ami of Windows Server 2016 MSVC 19.24.28316.0 CMake 3.16

We pass in the Tool chain and default triplet to cmake when we call it. Example: cmake foo/bar -A x64 -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static

cmake message indicates these are set:

-- CMAKE_TOOLCHAIN_FILE: [C:/vcpkg/scripts/buildsystems/vcpkg.cmake]
-- VCPKG_DEFAULT_TRIPLET: []
-- VCPKG_TARGET_TRIPLET: [x64-windows-static]

Other packages like curl and jsoncpp are found without issue, but it dies on log4cxx.

LeeGDavis commented 4 years ago

@stephen-webb looking through the generated code it appears that there is no log4cxxConfig.cmake, but log4cxx-targets.cmake this might just be a naming convention issue?

stephen-webb commented 4 years ago

Yes, it is a naming problem. I will do a PR to fix the CMakeLists.txt.

Meanwhile you could try renaming log4cxx-targets.cmake to log4cxxConfig.cmake

On Fri, Mar 6, 2020 at 3:50 AM Lee Davis notifications@github.com wrote:

@stephen-webb https://github.com/stephen-webb looking through the generated code it appears that there is no log4cxxConfig.cmake, but log4cxx-targets.cmake this might just be a naming convention issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/6125?email_source=notifications&email_token=ANLOSDR4AJU6C3KXNA6UPT3RF7J4FA5CNFSM4HGVQQPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN6AUNQ#issuecomment-595331638, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLOSDQGCOPI3BFSNWIZIXLRF7J4FANCNFSM4HGVQQPA .

stephen-webb commented 4 years ago

After renaming, the following cmake code can by used to compile and link find_package(log4cxx) add_executable( myApplication ...) target_include_directories(myApplication PRIVATE $<TARGET_PROPERTY:log4cxx::log4cxx,INTERFACE_INCLUDE_DIRECTORIES>) target_link_libraries( myApplication PRIVATE log4cxx::log4cxx)

LeeGDavis commented 4 years ago

Changing the name to config worked and I ran into another linking issue with vcpkg on another static lib I need to resolve first, but the "default" find_package seemed to work without error atm. I'll test those other options shortly. Thanks again @stephen-webb!

LeeGDavis commented 4 years ago

@stephen-webb so far that looks good. I'm running into a separate issue with jsoncpp finding headers in nested directories, so once that is resolved there could be something else, but I will keep you posted.

LeeGDavis commented 4 years ago

@stephen-webb Ran into another problem while working through a separate issue. I tried the triplet x64-windows-static (was using x64-windows previously) and got the following exception:

Building package log4cxx[core]:x64-windows-static...
-- Downloading https://github.com/leegdavis/logging-log4cxx/archive/master.tar.gz...
-- Extracting source C:/vcpkg/downloads/leegdavis-logging-log4cxx-master.tar.gz
-- Using source at C:/vcpkg/buildtrees/log4cxx/src/master-35bde37959
-- Configuring x64-windows-static
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):

    Command failed: ninja -v
    Working Directory: C:/vcpkg/buildtrees/log4cxx/x64-windows-static-rel/vcpkg-parallel-configure
    Error code: 1
    See logs for more information:
      C:\vcpkg\buildtrees\log4cxx\config-x64-windows-static-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:295 (vcpkg_execute_required_process)
  ports/log4cxx/portfile.cmake:10 (vcpkg_configure_cmake)
  scripts/ports.cmake:94 (include)

Error: Building package log4cxx:x64-windows-static failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: log4cxx:x64-windows-static
  Vcpkg version: 2020.01.17-nohash-external

C:/vcpkg/downloads/leegdavis-logging-log4cxx-master.tar.gz, just includes the renaming and nothing else.

stephen-webb commented 4 years ago

I have updated my vcpkg fork from https://github.com/microsoft/vcpkg.git.

It fixed a strange problem I had

LeeGDavis commented 4 years ago

Tried that fork just now and got what appears to be the same error, however a lot more output from the config-x64-windows-static-out.log:

Starting package 61/65: log4cxx:x64-windows-static
Building package log4cxx[core]:x64-windows-static...
-- Downloading https://github.com/stephen-webb/logging-log4cxx/archive/master.tar.gz...
-- Extracting source C:/vcpkg/downloads/stephen-webb-logging-log4cxx-master.tar.gz
-- Using source at C:/vcpkg/buildtrees/log4cxx/src/master-095f23a6e8
-- Configuring x64-windows-static
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
    Command failed: ninja -v
    Working Directory: C:/vcpkg/buildtrees/log4cxx/x64-windows-static-rel/vcpkg-parallel-configure
    Error code: 1
    See logs for more information:
      C:\vcpkg\buildtrees\log4cxx\config-x64-windows-static-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:295 (vcpkg_execute_required_process)
  ports/log4cxx/portfile.cmake:10 (vcpkg_configure_cmake)
  scripts/ports.cmake:90 (include)

Error: Building package log4cxx:x64-windows-static failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: log4cxx:x64-windows-static
  Vcpkg version: 2020.02.04-nohash-external

C:\vcpkg\buildtrees\log4cxx\config-x64-windows-static-out.log config-x64-windows-static-out.log

stephen-webb commented 4 years ago

I have changed the portfile.cmake to allow static build in my vcpkg fork. The patch is as follows:

diff --git a/ports/log4cxx/portfile.cmake b/ports/log4cxx/portfile.cmake index 1216eec2c..59e2a5c83 100644 --- a/ports/log4cxx/portfile.cmake +++ b/ports/log4cxx/portfile.cmake @@ -10,7 +10,7 @@ vcpkg_from_github( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS

LeeGDavis commented 4 years ago

@stephen-webb I just ran this through and got a new error, I'm going to be out for most of the day today, but will try and have a look at your config this evening, if not Monday.

Starting package 61/65: log4cxx:x64-windows-static
Building package log4cxx[core]:x64-windows-static...
-- Downloading https://github.com/stephen-webb/logging-log4cxx/archive/master.tar.gz...
-- Extracting source C:/vcpkg/downloads/stephen-webb-logging-log4cxx-master.tar.gz
-- Using source at C:/vcpkg/buildtrees/log4cxx/src/master-095f23a6e8
-- Configuring x64-windows-static
-- Building x64-windows-static-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:136 (message):
    Command failed: "C:/Program Files/CMake/bin/cmake.exe" --build . --config Debug --target install -- /p:VCPkgLocalAppDataDisabled=true /p:UseIntelMKL=No /m
    Working Directory: C:/vcpkg/buildtrees/log4cxx/x64-windows-static-dbg
    See logs for more information:
      C:\vcpkg\buildtrees\log4cxx\install-x64-windows-static-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_cmake.cmake:91 (vcpkg_execute_build_process)
  scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
  ports/log4cxx/portfile.cmake:16 (vcpkg_install_cmake)
  scripts/ports.cmake:90 (include)

Error: Building package log4cxx:x64-windows-static failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: log4cxx:x64-windows-static
  Vcpkg version: 2020.02.04-nohash-external

install-x64-windows-static-dbg-out.log config-x64-windows-static-out.log

stephen-webb commented 4 years ago

It seems that linking log4cxx statically on Windows is going to be very difficult. Are you sure you need to link statically?

On Mon, Mar 9, 2020 at 3:00 AM Lee Davis notifications@github.com wrote:

@stephen-webb https://github.com/stephen-webb I just ran this through and got a new error, I'm going to be out for most of the day today, but will try and have a look at your config this evening, if not Monday.

Starting package 61/65: log4cxx:x64-windows-static Building package log4cxx[core]:x64-windows-static... -- Downloading https://github.com/stephen-webb/logging-log4cxx/archive/master.tar.gz... -- Extracting source C:/vcpkg/downloads/stephen-webb-logging-log4cxx-master.tar.gz -- Using source at C:/vcpkg/buildtrees/log4cxx/src/master-095f23a6e8 -- Configuring x64-windows-static -- Building x64-windows-static-dbg CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:136 (message): Command failed: "C:/Program Files/CMake/bin/cmake.exe" --build . --config Debug --target install -- /p:VCPkgLocalAppDataDisabled=true /p:UseIntelMKL=No /m Working Directory: C:/vcpkg/buildtrees/log4cxx/x64-windows-static-dbg See logs for more information: C:\vcpkg\buildtrees\log4cxx\install-x64-windows-static-dbg-out.log

Call Stack (most recent call first): scripts/cmake/vcpkg_build_cmake.cmake:91 (vcpkg_execute_build_process) scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake) ports/log4cxx/portfile.cmake:16 (vcpkg_install_cmake) scripts/ports.cmake:90 (include)

Error: Building package log4cxx:x64-windows-static failed with: BUILD_FAILED Please ensure you're using the latest portfiles with .\vcpkg update, then submit an issue at https://github.com/Microsoft/vcpkg/issues including: Package: log4cxx:x64-windows-static Vcpkg version: 2020.02.04-nohash-external

install-x64-windows-static-dbg-out.log https://github.com/microsoft/vcpkg/files/4303462/install-x64-windows-static-dbg-out.log config-x64-windows-static-out.log https://github.com/microsoft/vcpkg/files/4303463/config-x64-windows-static-out.log

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/6125?email_source=notifications&email_token=ANLOSDTZ24BWQEATNYSB76DRGPFLTA5CNFSM4HGVQQPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOEZXGA#issuecomment-596220824, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLOSDSAEJXSY4ZMAAJYOMLRGPFLTANCNFSM4HGVQQPA .

LeeGDavis commented 4 years ago

Yes, as far as I understand. This is a custom app that ships as a single executable with the exception of libcef. I thought things were being statically linked until we ran into a problem with boost linking and it seemed the issue was we were not setup with the right static triplet, but in doing so uncovered the issues above.

To provide a little more context. This is a pre-existing application we are upgrading to 64bit and upgrading all the static libs at the same time (log4cxx being one of them). It seemed like vcpkg was the most streamlined way to achieve this, then trying to manage all the setup and building ourselves with the newer versions of the given libraries. At the same time also moving everything to cmake. Are you suggesting to bundle the dll's and link dynamically?

Ideally if I can keep everything working the same with the exception of 64bit that would be preferred...

stephen-webb commented 4 years ago

OK, I think I have it worked out. I have updated my fork of log4cxx with the changes

On Mon, Mar 9, 2020 at 2:30 PM Lee Davis notifications@github.com wrote:

Yes, as far as I understand. This is a custom app that ships as a single executable with the exception of libcef. I thought things were being statically linked until we ran into a problem with boost linking and it seemed the issue was we were not setup with the right static triplet, but in doing so uncovered the issues above.

To provide a little more context. This is a pre-existing application we are upgrading to 64bit and upgrading all the static libs at the same time (log4cxx being one of them). It seemed like vcpkg was the most streamlined way to achieve this, then trying to manage all the setup and building ourselves with the newer versions of the given libraries. At the same time also moving everything to cmake. Are you suggesting to bundle the dll's and link dynamically?

Ideally if I can keep everything working the same with the exception of 64bit that would be preferred...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/6125?email_source=notifications&email_token=ANLOSDVFJIMB3VWG5ES63NTRGRWIBA5CNFSM4HGVQQPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOFQYFI#issuecomment-596315157, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLOSDXJSM6QLE5XNN7YJKDRGRWIBANCNFSM4HGVQQPA .

stephen-webb commented 4 years ago

Note that you must define LOG4CXX_STATIC when compiling any file that includes a log4cxx header file.

stephen-webb commented 4 years ago

You will also need to include apr-1 find_library(APR_LIBRARIES NAMES apr-1)

On Mon, Mar 9, 2020 at 3:19 PM Stephen Webb swebb2066@gmail.com wrote:

Note that you must define LOG4CXX_STATIC when compiling any file that includes a log4cxx header file.

LeeGDavis commented 4 years ago

Ohh, missed that last one. I will kick this off right now and let you know. Thanks again @stephen-webb!

LeeGDavis commented 4 years ago

Oddly ran into the hash issue again. I am running off of master.

Starting package 61/65: log4cxx:x64-windows-static
Building package log4cxx[core]:x64-windows-static...
-- Downloading https://github.com/stephen-webb/logging-log4cxx/archive/master.tar.gz...
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:99 (message):

  File does not have expected hash:

          File path: [ C:/vcpkg/downloads/temp/stephen-webb-logging-log4cxx-master.tar.gz ]
      Expected hash: [ 73400110241821ac903c4c1d889adbedf6404eac70da537b634206d59aa3d13bb89e6584eb6646aa21a185b40615aca40972246ba43f8ddf46ecc9d3a73f9551 ]
        Actual hash: [ 2f0a9afcc67974b4fa5e8c344ef8233169ad4a94f7a205d7d9ba7ba452f97c092adfb704b9f3b60b056d7b9cdb5afd9014310bc957041c847449725e63c3e2a6 ]

  The file may have been corrupted in transit.  This can be caused by
  proxies.  If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY
  environment variables to
  "https://user:password@your-proxy-ip-address:port/".

Call Stack (most recent call first):
  scripts/cmake/vcpkg_download_distfile.cmake:182 (test_hash)
  scripts/cmake/vcpkg_from_github.cmake:132 (vcpkg_download_distfile)
  ports/log4cxx/portfile.cmake:2 (vcpkg_from_github)
  scripts/ports.cmake:90 (include)

Error: Building package log4cxx:x64-windows-static failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: log4cxx:x64-windows-static
  Vcpkg version: 2020.02.04-nohash-external
stephen-webb commented 4 years ago

Not odd, as I am not updating my vcpkg fork every time I commit to my log4cxx fork.

I have added another commit to handle the 2.2.7 version of expat used by vcpkg.

LeeGDavis commented 4 years ago

NP, I can deal with that hash on my end!

LeeGDavis commented 4 years ago

I think I need to update my cmake config from log4cxx::log4cxx to just log4cxx in target_include_directories and target_link_libraries. Going to kick this off and will check in the am. I feel like I can almost see the light.

CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:188 (_add_executable):

  Target "APPNAME" links to target "log4cxx::log4cxx" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
Call Stack (most recent call first):
  win/foo/CMakeLists.txt:137 (add_executable)

CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:188 (_add_executable):

  Target "APPNAME" links to target "log4cxx::log4cxx" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
Call Stack (most recent call first):
  win/foo/CMakeLists.txt:137 (add_executable)

CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:188 (_add_executable):

  Target "APPNAME" links to target "log4cxx::log4cxx" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
Call Stack (most recent call first):
  win/foo/CMakeLists.txt:137 (add_executable)

CMake Error at win/foo/CMakeLists.txt:155 (target_include_directories):

  Error evaluating generator expression:

    $<TARGET_PROPERTY:log4cxx::log4cxx,INTERFACE_INCLUDE_DIRECTORIES>

  Target "log4cxx::log4cxx" not found.

CMake Error at win/foo/CMakeLists.txt:155 (target_include_directories):

  Error evaluating generator expression:

    $<TARGET_PROPERTY:log4cxx::log4cxx,INTERFACE_INCLUDE_DIRECTORIES>

  Target "log4cxx::log4cxx" not found.

CMake Error at win/foo/CMakeLists.txt:155 (target_include_directories):

  Error evaluating generator expression:

    $<TARGET_PROPERTY:log4cxx::log4cxx,INTERFACE_INCLUDE_DIRECTORIES>

  Target "log4cxx::log4cxx" not found.

CMake Error at win/foo/CMakeLists.txt:155 (target_include_directories):

  Error evaluating generator expression:

    $<TARGET_PROPERTY:log4cxx::log4cxx,INTERFACE_INCLUDE_DIRECTORIES>

  Target "log4cxx::log4cxx" not found.

CMake Error at win/foo/CMakeLists.txt:155 (target_include_directories):

  Error evaluating generator expression:

    $<TARGET_PROPERTY:log4cxx::log4cxx,INTERFACE_INCLUDE_DIRECTORIES>

  Target "log4cxx::log4cxx" not found.

CMake Error at win/foo/CMakeLists.txt:155 (target_include_directories):

  Error evaluating generator expression:

    $<TARGET_PROPERTY:log4cxx::log4cxx,INTERFACE_INCLUDE_DIRECTORIES>

  Target "log4cxx::log4cxx" not found.

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
LeeGDavis commented 4 years ago

@stephen-webb That appears to work!!!

I'm running into a new issue, but I think it has nothing to do with your changes above and have opened https://github.com/microsoft/vcpkg/issues/10364. It's as if It can't find some libs it should be able to just locate in windows, by adding to target_link_libraries

CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:189 (_add_executable):
  Target "INSIGHT" links to target "ws2_32::@<000001D9FFC6C600>" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  win/SBClient/CMakeLists.txt:142 (add_executable)

CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:189 (_add_executable):
  Target "INSIGHT" links to target "mswsock::@<000001D9FFC6C600>" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  win/SBClient/CMakeLists.txt:142 (add_executable)

CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:189 (_add_executable):
  Target "INSIGHT" links to target "rpcrt4::@<000001D9FFC6C600>" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  win/SBClient/CMakeLists.txt:142 (add_executable)
stephen-webb commented 4 years ago

You need to add system libraries to your executable target. For example, to link log4cxx test executables, I had to add set(APR_SYSTEM_LIBS ws2_32 mswsock rpcrt4) ... target_link_libraries(${testName} PRIVATE log4cxx ${APR_UTIL_LIBRARIES} ${XMLLIB_LIBRARIES} ${APR_LIBRARIES} ${APR_SYSTEM_LIBS})

Linking statically is hard because you need to know all the dependencies of all your dependencies!

On Tue, Mar 10, 2020 at 6:33 AM Lee Davis notifications@github.com wrote:

@stephen-webb https://github.com/stephen-webb That appears to work!!!

I'm running into a new issue, but I think it has nothing to do with your changes above and have opened #10364 https://github.com/microsoft/vcpkg/issues/10364. It's as if It can't find some libs it should be able to just locate in windows, by adding to target_link_libraries

CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:189 (_add_executable): Target "INSIGHT" links to target "ws2_32::@<000001D9FFC6C600>" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Call Stack (most recent call first): win/SBClient/CMakeLists.txt:142 (add_executable)

CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:189 (_add_executable): Target "INSIGHT" links to target "mswsock::@<000001D9FFC6C600>" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Call Stack (most recent call first): win/SBClient/CMakeLists.txt:142 (add_executable)

CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:189 (_add_executable): Target "INSIGHT" links to target "rpcrt4::@<000001D9FFC6C600>" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? Call Stack (most recent call first): win/SBClient/CMakeLists.txt:142 (add_executable)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/6125?email_source=notifications&email_token=ANLOSDTADJJ73PEQZAN3DD3RGVHDJA5CNFSM4HGVQQPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOIYEVY#issuecomment-596738647, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLOSDWURWGI2WZPZ3MFA6TRGVHDJANCNFSM4HGVQQPA .

LeeGDavis commented 4 years ago

Goodness, yes, it appears so. I'll keep you posted if we run into any other issues with log4cxx port, but all changes seem to be good! The only thing I have is a fork with the updated hash atm.

LeeGDavis commented 4 years ago

I think I misunderstood at first, I thought this was another lib that was creating this dependency issue. This is making more sense.

Now after adding the APR_SYSTEM_LIBS to the target_link_libraries, I receive the same issue. These seem like standard libs that I shouldn't have to search for... Simply adding them as a target link library I thought would be enough? I've also tried adding those three deps with the .lib extension, still same error.

Output from cmake regarding build env

-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.14393.
-- The C compiler identification is MSVC 19.24.28316.0
-- The CXX compiler identification is MSVC 19.24.28316.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
LeeGDavis commented 4 years ago

@stephen-webb the solution file generated by cmake seems there is a weird reference in the linker command line. This could simply be my ignorance in build solution terminology. However it is failing on ws2_32::@<0000022A016FDDA0>.lib" "mswsock::@<0000022A016FDDA0>.lib" "rpcrt4::@<0000022A016FDDA0>.lib" "odbc32.lib::@<0000022A016FDDA0>.lib:


Linker Command Line:
/OUT:"C:\jenkins\workspace\FOO.exe" /MANIFEST:NO /NXCOMPAT /PDB:"C:/jenkins/workspace/FOO.pdb" /DYNAMICBASE "comctl32.lib" "rpcrt4.lib" "shlwapi.lib" "ws2_32.lib" "dbghelp.lib" "Delayimp.lib" "PowrProf.lib" "Propsys.lib" "psapi.lib" "SetupAPI.lib" "version.lib" "wbemuuid.lib" "winmm.lib" "C:\vcpkg\installed\x64-windows-static\debug\lib\apr-1.lib" "mswsock.lib" "C:\vcpkg\installed\x64-windows-static\debug\lib\jsoncpp.lib" "C:\vcpkg\installed\x64-windows-static\debug\lib\libcurl-d.lib" "C:\vcpkg\installed\x64-windows-static\lib\log4cxx.lib" "..\lib\cef\Debug\libcef.lib" "..\..\libcef_dll_wrapper\Debug\libcef_dll_wrapper.lib" "glu32.lib" "imm32.lib" "opengl32.lib" "d3d11.lib" "odbc32.lib" "oleacc.lib" "wldap32.lib" "advapi32.lib" "crypt32.lib" "C:\vcpkg\installed\x64-windows-static\debug\lib\zlibd.lib" "C:\vcpkg\installed\x64-windows-static\lib\aprutil-1.lib" "C:\vcpkg\installed\x64-windows-static\lib\expat.lib" "C:\vcpkg\installed\x64-windows-static\lib\apr-1.lib" "ws2_32::@<0000022A016FDDA0>.lib" "mswsock::@<0000022A016FDDA0>.lib" "rpcrt4::@<0000022A016FDDA0>.lib" "odbc32.lib::@<0000022A016FDDA0>.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "comdlg32.lib" /LARGEADDRESSAWARE /IMPLIB:"C:/jenkins/workspace/Debug/FOO.lib" /DEBUG /MACHINE:X64 /INCREMENTAL /PGD:"C:\jenkins\workspace\Debug\FOO.pgd" /SUBSYSTEM:WINDOWS /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"FOO.dir\Debug\FOO.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"C:/Program Files (x86)/Windows Kits/10/Lib/10.0.18362.0/um/x64" /LIBPATH:"C:/Program Files (x86)/Windows Kits/10/Lib/10.0.18362.0/um/x64/Debug" /TLBID:1```
LeeGDavis commented 4 years ago

Also the file c:\vcpkg\buildtrees\log4cxx\x64-windows-static-rel\CMakeFiles\Export\share\cmake\log4cxx\log4cxxConfig.cmake contains these references in the INTERFACE_LINK_LIBRARIES

stephen-webb commented 4 years ago

Sorry, I do not know - it is a cmake/microsoft internals thing that generates the command line.

On Wed, Mar 11, 2020 at 8:18 AM Lee Davis notifications@github.com wrote:

Also the file c:\vcpkg\buildtrees\log4cxx\x64-windows-static-rel\CMakeFiles\Export\share\cmake\log4cxx\log4cxxConfig.cmake contains these references in the INTERFACE_LINK_LIBRARIES

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/6125?email_source=notifications&email_token=ANLOSDSZ7C5Y4NP3TOTKU3LRG2VBVA5CNFSM4HGVQQPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEONGWNA#issuecomment-597322548, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLOSDTCYWSJFYVRWQA2LC3RG2VBVANCNFSM4HGVQQPA .

LeeGDavis commented 4 years ago

@stephen-webb if we alter the file, C:\vcpkg\installed\x64-windows-static\share\cmake\log4cxx\log4cxxConfig.cmake INTERFACE_LINK_LIBRARIES it seems to resolve the static linking issue.

Original:

set_target_properties(log4cxx PROPERTIES
  INTERFACE_COMPILE_DEFINITIONS "LOG4CXX_STATIC"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "C:/vcpkg/installed/x64-windows-static/lib/aprutil-1.lib;C:/vcpkg/installed/x64-windows-static/lib/expat.lib;C:/vcpkg/installed/x64-windows-static/lib/apr-1.lib;\$<LINK_ONLY:ws2_32::@<000001B645770100>>;\$<LINK_ONLY:mswsock::@<000001B645770100>>;\$<LINK_ONLY:rpcrt4::@<000001B645770100>>;\$<LINK_ONLY:odbc32.lib::@<000001B645770100>>"
)

Updated:

set_target_properties(log4cxx PROPERTIES
  INTERFACE_COMPILE_DEFINITIONS "LOG4CXX_STATIC"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "C:/vcpkg/installed/x64-windows-static/lib/aprutil-1.lib;C:/vcpkg/installed/x64-windows-static/lib/expat.lib;C:/vcpkg/installed/x64-windows-static/lib/apr-1.lib;ws2_32;mswsock;rpcrt4;odbc32.lib"
)

Note: the references ws2_32, mswsock, rpcrt4 can also contain a .lib extension and it works fine.

I also don't understand the https://cmake.org/cmake/help/v3.16/manual/cmake-generator-expressions.7.html#output-related-expressions $<LINK_ONLY:...>

LeeGDavis commented 4 years ago

We've rewritten log4cxxConfig.cmake as part of our build scripts as a workaround for now. It is not ideal, but not entirely sure how to address that one at this point...

LeeGDavis commented 4 years ago

@stephen-webb Just a followup on our eventual solution:

  1. Perform the above steps with the log4cxxConfig.cmake.
  2. Cmake Entries:
    find_library(APR_LIBRARIES NAMES apr-1)
    find_package(log4cxx CONFIG REQUIRED)
    target_include_directories("YOURTARGET" PRIVATE
    $<TARGET_PROPERTY:log4cxx,INTERFACE_INCLUDE_DIRECTORIES>
    )
    target_link_libraries("YOURTARGET"
    debug "C:/vcpkg/installed/x64-windows-static/debug/lib/apr-1.lib"
    optimized "C:/vcpkg/installed/x64-windows-static/lib/apr-1.lib"
    debug "C:/vcpkg/installed/x64-windows-static/debug/lib/aprapp-1.lib"
    optimized "C:/vcpkg/installed/x64-windows-static/lib/aprapp-1.lib"
    debug "C:/vcpkg/installed/x64-windows-static/debug/lib/aprutil-1.lib"
    optimized "C:/vcpkg/installed/x64-windows-static/lib/aprutil-1.lib"
    debug "C:/vcpkg/installed/x64-windows-static/debug/lib/expat.lib"
    optimized "C:/vcpkg/installed/x64-windows-static/lib/expat.lib"
    debug "C:/vcpkg/installed/x64-windows-static/debug/lib/log4cxx.lib"
    optimized "C:/vcpkg/installed/x64-windows-static/lib/log4cxx.lib"
    )

    We had to manually specifiy the lib locations, as the debug versions never got picked up in the target link libraries via log4cxx.

stephen-webb commented 4 years ago

Thanks for the information.

The problem is that APR does not provide a find module. I would suggest you copy the log4cxx FindAPR.cmake and FindAPR-Util.cmake into your repository so that you can simplify your CMakeLists.txt to:

FindAPR and FindAPR-util are not provided by APR and APR-Util so source

them locally list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/src/cmake")

Find Apache Runtime

find_package(APR REQUIRED)

Find Apache Runtime Utilities

find_package(APR-Util REQUIRED)

On Tue, Mar 17, 2020 at 9:53 AM Lee Davis notifications@github.com wrote:

@stephen-webb https://github.com/stephen-webb Just a followup on our eventual solution:

  1. Perform the above steps with the log4cxxConfig.cmake.
  2. Cmake Entries:

find_library(APR_LIBRARIES NAMES apr-1) find_package(log4cxx CONFIG REQUIRED) target_include_directories("INSIGHT" PRIVATE $<TARGET_PROPERTY:log4cxx,INTERFACE_INCLUDE_DIRECTORIES> ) target_link_libraries("YOURTARGET" debug "C:/vcpkg/installed/x64-windows-static/debug/lib/apr-1.lib" optimized "C:/vcpkg/installed/x64-windows-static/lib/apr-1.lib" debug "C:/vcpkg/installed/x64-windows-static/debug/lib/aprapp-1.lib" optimized "C:/vcpkg/installed/x64-windows-static/lib/aprapp-1.lib" debug "C:/vcpkg/installed/x64-windows-static/debug/lib/aprutil-1.lib" optimized "C:/vcpkg/installed/x64-windows-static/lib/aprutil-1.lib" debug "C:/vcpkg/installed/x64-windows-static/debug/lib/expat.lib" optimized "C:/vcpkg/installed/x64-windows-static/lib/expat.lib" debug "C:/vcpkg/installed/x64-windows-static/debug/lib/log4cxx.lib" optimized "C:/vcpkg/installed/x64-windows-static/lib/log4cxx.lib" )

We had to manually specifiy the lib locations, as the debug versions never got picked up in the target link libraries via log4cxx .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/6125#issuecomment-599793624, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLOSDWBSAQC5OIM5IQE7HDRH2UW3ANCNFSM4HGVQQPA .

LeeGDavis commented 4 years ago

Implementing the above did work and did find the libraries:

-- APR LIBS --- APR_UTIL_LIBRARIES: [C:/vcpkg/installed/x64-windows-static/debug/lib/aprutil-1.lib] XMLLIB_LIBRARIES: [C:/vcpkg/installed/x64-windows-static/debug/lib/expat.lib] APR_LIBRARIES: [C:/vcpkg/installed/x64-windows-static/debug/lib/apr-1.lib] APR_SYSTEM_LIBS: [ws2_32;mswsock;rpcrt4]

Excuse my ignorance on CMAKE, but is there a good way to have debug vs release/optimized libraries found/exposed given a debug vs release build if you will?

stephen-webb commented 4 years ago

Not sure if I understand your question, but as vcpkg builds both debug and release versions, they can each be used when building your application.

You can use the standard cmake "--config" parameter. For example:

cmake --build {mybuildDir} --config Release

On Wed, Mar 25, 2020 at 6:20 AM Lee Davis notifications@github.com wrote:

Implementing the above did work and did find the libraries:

-- APR LIBS --- APR_UTIL_LIBRARIES: [C:/vcpkg/installed/x64-windows-static/debug/lib/aprutil-1.lib] XMLLIB_LIBRARIES: [C:/vcpkg/installed/x64-windows-static/debug/lib/expat.lib] APR_LIBRARIES: [C:/vcpkg/installed/x64-windows-static/debug/lib/apr-1.lib] APR_SYSTEM_LIBS: [ws2_32;mswsock;rpcrt4]

Excuse my ignorance on CMAKE, but is there a good way to have debug vs release/optimized libraries found/exposed given a debug vs release build if you will?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/vcpkg/issues/6125#issuecomment-603456195, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANLOSDSC6YGCOH6I2JJCDVTRJEBY3ANCNFSM4HGVQQPA .

LeeGDavis commented 4 years ago

Yes, we are using --config (Release or Debug) however, for the Release build the libraries listed above all point to the debug entries, so only our debug builds succeed. We ran into this issue with newer version of Boost as well, so figured it was something we were doing wrong, then we also realized that some libs like curl and jsoncpp seemed to work fine in this manner.