Commit Graph

57 Commits

Author SHA1 Message Date
worldofpeace
883a1dffcf
Merge pull request #52859 from jtojnar/cmake-gid
cmake: use multiple outputs for GNUInstallDirs
2019-07-25 16:05:10 -04:00
Matthew Bauer
91f0c848f4 cmake: set BUILD_TESTING=OFF when doCheck is false
This means we can avoid building test suites that will never be run.
2019-03-09 14:32:55 -05:00
Florian Franzen
e0e4577c0f cmake: disable package registry 2019-01-31 10:17:55 +01:00
Jan Tojnar
c0d2f92459
cmake: use multiple outputs for GNUInstallDirs
CMake contains a module for more granular installation directories:

https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html

Let’s set the paths so that projects using the module can be more
easily split into multiple outputs.
2018-12-25 20:51:31 +01:00
Matthew Bauer
70e2b0bef0 cmake: also set CTEST_PARALLEL_LEVEL 2018-11-19 18:14:44 -06:00
Matthew Bauer
285eb9a894 cmake: set CTEST_OUTPUT_ON_FAILURE globally
We should always use this.
2018-11-19 16:16:16 -06:00
Matthieu Coudron
a6809c0dd0 cmake: don't override cmakeDir when set (#40687)
When dontUseCmakeBuildDir is true (aka the default), it overrides
cmakeDir regardless of the package configuration.

While packaging netbee, I needed to both keep dontUseCmakeBuildDir to
true (some hardcoded paths expect the build folder) and set cmakeDir
(since CMakeList.txt was in a subfolder) which proved impossible.
Here is the fix.
2018-06-03 12:28:28 +00:00
John Ericson
ce018be2d6
Merge pull request #40566 from obsidiansystems/strictDeps-for-18.03
cmake: Fix build and setup hook
2018-05-15 16:31:17 -04:00
John Ericson
0ff650a392 cmake: Fix build and setup hook
I screwed this up in 330ca731e8. I'm
sorry.
2018-05-15 15:24:22 -04:00
John Ericson
5e17335bd7 Merge remote-tracking branch 'upstream/staging' into strictDeps 2018-05-14 23:33:03 -04:00
John Ericson
330ca731e8 treewide: Get rid of all uses of crossConfig
The hack of using `crossConfig` to enforce stricter handling of
dependencies is replaced with a dedicated `strictDeps` for that purpose.
(Experience has shown that my punning was a terrible idea that made more
difficult and embarrising to teach teach.)

Now that is is clear, a few packages now use `strictDeps`, to fix
various bugs:

 - bintools-wrapper and cc-wrapper
2018-05-14 23:30:37 -04:00
Matthew Bauer
bd9b17f762 cmake: correctly detect clang compiler on macOS 2018-03-14 14:36:27 -05:00
Matthew Bauer
8beb809fd1 cmake: don't detect macOS deployment target 2018-03-14 14:31:53 -05:00
Matthew Bauer
acbf439fef cmake: disable detecting global macOS sdk 2018-03-14 14:30:10 -05:00
Matthew Bauer
b99cae3931 cmake: set CMAKE_FIND_FRAMEWORK=last 2018-03-14 14:20:07 -05:00
Will Dietz
e25a343716 cmake: don't force gcc, use more general cc/c++ 2018-02-13 12:39:34 -06:00
Will Dietz
37c2ac90e6 cmake: fix cross
TODO: toolchain file instead?
2018-02-13 09:44:29 -06:00
Daiderd Jordan
6f10cfc777
cmake: fix INSTALL_NAME_DIR for darwin libraries
When there's a lib output libraries won't be intalled to $prefix causing
output cycles.
2018-01-07 09:45:25 +01:00
John Ericson
046f091e0d treewide: Don't use envHook anymore
This commits needs a MAJOR audit as I oftentimes just guessed which of
`$hostOffset`, `$targetOffset`, or a fixed offset should be used.
2017-12-30 22:04:22 -05:00
Orivej Desh
031138b7f0 cmake: enable parallel building of cmake projects by default 2017-12-07 08:52:42 +00:00
Orivej Desh
da516f0404 cmake: generate for Ninja when the build phase is Ninja
This is overridable by providing a custom build phase or setting
dontUseNinjaBuild = true.
2017-12-07 08:52:42 +00:00
Matthew Bauer
24eb665695 cmake: setup CMAKE_FRAMEWORK_PATH
This tells cmake how to find macOS frameworks.

Fixes #26197
2017-10-21 02:27:09 -05:00
Linus Heckemann
28154f45a6 cmake setup hook: allow other build types 2017-05-10 14:33:20 +01:00
Michael Raskin
dabf09aa92 cmake: update setup-hook to take -isystem instead of -I into account 2016-09-08 09:10:00 +02:00
Thomas Tuegel
491f7f017c cmake: set LIBDIR and INCLUDEDIR for multiple outputs 2016-04-20 10:01:06 -05:00
Thomas Tuegel
a714284d8b cmake: don't set incompatible flags for multiple outputs 2016-01-31 21:15:03 -06:00
Thomas Tuegel
1087020a46 cmake: invoke configure hooks correctly
Otherwise, the multiple-outputs hooks will not fire correctly.
2016-01-31 21:15:03 -06:00
Luis G. Torres
ff35c4a5e2 Make cmake install libraries with full install names by default so that executables can find cmake-installed shared libraries at runtime on Darwin. Addresses #6821. 2015-03-30 21:25:44 -04:00
Eelco Dolstra
0acc4e6b26 cmake: Fix setup hook on bash < 4.0
This matters in nix-shell and stdenvNative on Darwin.

Fixes #3204.
2014-08-09 23:14:01 +02:00
Vladimír Čunát
3314be6b73 cmake: consistent names, to satisfy comments on #567 2013-06-27 16:33:24 +02:00
Vladimír Čunát
7f1e09c35d Re-Revert "Merge pull request #567 from MarcWeber/submit/cmake-improvement"
This reverts commit b08e12b37a.
2013-06-27 15:14:32 +02:00
Peter Simons
b08e12b37a Revert "Merge pull request #567 from MarcWeber/submit/cmake-improvement"
This reverts commit abc7591aaf, reversing changes
made to 6b1ebeccf2, because they broke half the
packages in stdenv-updates: http://hydra.nixos.org/eval/927013 has further
details.
2013-06-17 10:19:15 +02:00
Marc Weber
f7ef08e5cd experimental/cmake-improvement
set CMAKE_LIBRARY_PATH, CMAKE_INCLUDE_PATH based on NIX_CFLAGS_COMPILE and
NIX_LDFLAGS so that cmake's find_library like functions find all the libraries
gcc knows about thanks to the gcc wrapper

This is particular useful with myEnvFun which then also sets those CMAKE_* env
variables.`

Because setup.sh has to change this causes many rebuilds - thus it should be
included in a stdenv-update like branch

Also cmake builds in parallel perfectly fine

update cmake to latest minor number, I didn't change the patches,
just reapplied them manually recordin a new patch
2013-05-28 16:22:45 +02:00
Lluís Batlle i Rossell
183b37645b cmake setup-hook: fixing cmakeFlagsArray
The array wasn'te expanded properly, the spaces weren't preserved.
2013-03-12 11:31:58 +01:00
Shea Levy
45f6008817 cmake setup hook: If configurePhase is set, don't override it 2013-02-07 14:03:23 -05:00
Lluís Batlle i Rossell
183d05a0d7 Setting the cmake build type Release in its setup-hook, for all cmake
projects to be built in Release by default.

Some packages were not getting optimisation flags, like rigsofrods.


svn path=/nixpkgs/branches/stdenv-updates/; revision=32574
2012-02-26 11:27:45 +00:00
Eelco Dolstra
1e886749b5 * Don't replace /opt if it's followed by something other than
whitespace or a /, otherwise strings such as /foo/opticaldrive.c
  will be broken.

svn path=/nixpkgs/branches/stdenv-updates/; revision=31793
2012-01-23 13:16:51 +00:00
Eelco Dolstra
28780d27d1 * cmake: don't use replace-literal.
svn path=/nixpkgs/branches/stdenv-updates/; revision=31736
2012-01-20 15:10:28 +00:00
Yury G. Kudryashov
2e92a0cd12 cmake-2.8.3
svn path=/nixpkgs/trunk/; revision=25859
2011-02-09 21:08:53 +00:00
Yury G. Kudryashov
48c13f4096 Update cmake
Use system libraries, make curses optional, add optional qt4 gui etc.

svn path=/nixpkgs/trunk/; revision=23810
2010-09-15 18:37:21 +00:00
Lluís Batlle i Rossell
4a6cfd435e Removing a part of the cmake setup-hook that broke at least the findqt4 cmake module.
That way, we don't need the patch anymore to fix what that part broke.

Also kde stops needing the findqt4 patch (for its own copy of the findqt4 cmake module).

I tested a nixos-rebuild with kde4, and it builds as far as hydra built with this configuration.

svn path=/nixpkgs/trunk/; revision=20921
2010-04-01 18:19:44 +00:00
Lluís Batlle i Rossell
e0ff817c40 Big kde-related update.
I updated cmake to use CMAKE_PREFIX_PATH instead of CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH.
There were some expressions in kde that required CMAKE_PREFIX_PATH, and now they are not anymore
a special case.
I updated most kde-4.4 files to point to kde-4.4.0 sources instead of 4.3.4 .

svn path=/nixpkgs/trunk/; revision=19965
2010-02-12 21:58:27 +00:00
Lluís Batlle i Rossell
dae3eb2383 Merging from trunk.
I resolved two conflicts:
- cmake (trunk fixes + stdenv-updates cross-compiling)
- all-packages (trunk gcc-wrapper2 + stdenv-updates gcc44)


svn path=/nixpkgs/branches/stdenv-updates/; revision=18912
2009-12-12 18:39:09 +00:00
Lluís Batlle i Rossell
f3c23487a2 Adding a new version of the gcc-wrapper, named gcc-wrapper2, in order not to rebuild
stdenv.

In this gcc-wrapper2 I made the ld-wrapper.sh to handle the linking with shared
objects through direct pass as ld command arguments of the absolute path to shared
objects, instead of using the -L/-l combinations.

cmake 'FindXXX.cmake' modules make a strong usage of the dynamic linking directly
passing the absolute path to the shared object to the linker, and as our wrapper did
not add any -rpath for those, writting the nix expressions for some cmake packages
resulted in a lot of tricks, compared to using this gcc-wrapper2.

This gcc-wrapper2/ld-wrapper.sh should become the gcc-wrapper/ld-wrapper in a
stdenv update.

I also updated some cmake expressions to use this gcc-wrapper2, and reduced its
tricks.

I also updated the cmake setup-hook for it to make cmake not touch any rpath decided
at build time, when running the 'make install' of makefiles created by cmake.

svn path=/nixpkgs/trunk/; revision=18885
2009-12-10 22:19:52 +00:00
Lluís Batlle i Rossell
585ba8c27f Big fixes in the cross build:
- Before this changes, cflags and ldflags for the native and the cross compiler
  got mixed. Not all the gcc-wrapper/gcc-cross-wrapper variables are
  independant now, but enough, I think.
- Fixed the generic stdenv expression, which did a big mess on buildInputs and
  buildNativeInputs. Now it distinguishes when there is a stdenvCross or not.
  Maybe we should have a single stdenv and forget about the stdenvCross
  adapter - this could end in a stdenv a bit complex, but simpler than the
  generic stdenv + adapter.
- Added basic support in pkgconfig for cross-builds: a single PKG_CONFIG_PATH
  now works for both the cross and the native compilers, but I think this
  should work well for most cases I can think of.
- I tried to fix the guile expression to cross-biuld; guile is built, but not
  its manual, so the derivation still fails. Guile requires patching to
  cross-build, as far as I understnad.
- Made the glibcCross build to be done through the usage of a
  gcc-cross-wrapper over the gcc-cross-stage-static, instead of using it
  directly.
- Trying to make physfs (a neverball dependency) cross build.
- Updated the gcc expression to support building a cross compiler without getting
  derivation variables mixed with those of the stdenvCross.

svn path=/nixpkgs/branches/stdenv-updates/; revision=18534
2009-11-22 19:51:45 +00:00
Eelco Dolstra
f762b50991 * Another sync with the trunk.
svn path=/nixpkgs/branches/stdenv-updates/; revision=15269
2009-04-23 11:59:43 +00:00
Eelco Dolstra
6b9ccbaf78 * setup.sh: turn on nullglob globally.
* setup.sh: removed some obsolete features, specifically some that
  were only used by the old build farm.
* addToSearchPath: removed some parameters that weren't used
  anywhere.

svn path=/nixpkgs/branches/stdenv-updates/; revision=15136
2009-04-18 22:22:51 +00:00
Peter Simons
2796d3a185 Updated fixCmakeFiles to handle file paths that contain whitespace.
svn path=/nixpkgs/trunk/; revision=15113
2009-04-17 13:48:11 +00:00
Eelco Dolstra
62fa1a418f * cmake setup hook: override the whole configurePhase rather than
setting a postUnpack hook.

svn path=/nixpkgs/trunk/; revision=14074
2009-02-13 14:43:01 +00:00
Eelco Dolstra
e12b421add * Merged most of the stdenv-updates branch. Some stuff didn't
merge cleanly right away (kde-4, kernel stuff) so it should be
  merged later.  But the stdenv stuff is all there.

svn path=/nixpkgs/branches/stdenv-updates-merge/; revision=10793
2008-02-20 23:02:41 +00:00