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

cmake: Prevent it from searching for packages in / when cross-compiling for Windows #25319

Closed

Conversation

DavidEGrayson
Copy link
Contributor

@DavidEGrayson DavidEGrayson commented Apr 29, 2017

Motivation for this change

I was using the CMake from nixpkgs in my own project (outside of nixpkgs) to cross-compile some software for Windows. That software uses the find_package command to find Qt5Widgets. CMake was finding the Qt5Widgets package on my build system and trying (unsuccessfully) to use it. Obviously, that goes against the whole point of purity in Nix. This pull request adds a patch that comments out a line that adds / to the CMAKE_SYSTEM_PREFIX_PATH. Thanks!

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@DavidEGrayson, thanks for your PR! By analyzing the history of the files in this pull request, we identified @7c6f434c, @abbradar and @dtzWill to be potential reviewers.

@7c6f434c
Copy link
Member

I wonder if it is enough of a rebuild to target into staging… GTK2, GTK3, Qt5, Qt4 all depend on CMake, for example.

@Mic92
Copy link
Member

Mic92 commented Apr 29, 2017

I think this should go into staging.

@DavidEGrayson
Copy link
Contributor Author

Thank you for taking a look. The new pull request is ready: #25330

@Mic92 Mic92 closed this May 1, 2017
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

Successfully merging this pull request may close these issues.

None yet

4 participants