Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindECW.cmake always finds x64 libs on x64 Windows host #9106

Closed
mpdaly opened this issue Jan 19, 2024 · 0 comments
Closed

FindECW.cmake always finds x64 libs on x64 Windows host #9106

mpdaly opened this issue Jan 19, 2024 · 0 comments
Assignees

Comments

@mpdaly
Copy link
Contributor

mpdaly commented Jan 19, 2024

Expected behavior and actual behavior.

Expected: building GDAL as Win32/x86 should find the Win32 ECW SDK .lib-s, independent of the host platform architecture

Actual: FindECW.cmake always finds the x64 ECW SDK .lib-s on 64-bit host

Steps to reproduce the problem.

With native x86 tools

  • On 64-bit Windows, open the x86 Tools Command Prompt for VS 2022
  • Run CMake w/ ECW SDK enabled via ECW_ROOT=<path_to_ERDAS_ECW_JPEG_2000_SDK>

The output includes (with added debugging info):

-- CMAKE_SYSTEM_PROCESSOR=AMD64
-- ECW_ARCH=x64
-- Found ECW: <path_to_ERDAS_ECW_JPEG_2000_SDK>/lib/vc141/x64/NCSEcw.lib (found version "5.5")

With x64-to-x86 cross-compiling tools

  • On 64-bit Windows, open the x64_x86 Tools Command Prompt for VS 2022
  • Run CMake w/ ECW SDK enabled via ECW_ROOT=<path_to_ERDAS_ECW_JPEG_2000_SDK>

The output includes (with added debugging info):

-- CMAKE_SYSTEM_PROCESSOR=AMD64
-- ECW_ARCH=x64
-- Found ECW: <path_to_ERDAS_ECW_JPEG_2000_SDK>/lib/vc141/x64/NCSEcw.lib (found version "5.5")

In both cases the x64 folder is found, not the Win32.

The CMake documentation specifically warns against using CMAKE_SYSTEM_PROCESSOR.

Operating system

Windows 11 64-bit, w/ VS 2022

GDAL version and provenance

3.6 and later, 3.5 if building w/ CMake

@rouault rouault self-assigned this Jan 19, 2024
rouault added a commit that referenced this issue Jan 19, 2024
FindECW.cmake: make it work for Windows 32-bit builds (fixes #9106)
rouault added a commit that referenced this issue Jan 19, 2024
[Backport release/3.8] FindECW.cmake: make it work for Windows 32-bit builds (fixes #9106)
ralphraul pushed a commit to 1SpatialGroupLtd/gdal that referenced this issue Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants