Commit Graph

3331 Commits

Author SHA1 Message Date
Brad King 646cf91932 CheckCCompilerFlag: Generalize "but not for C" case (#12633)
The "warning: " part is not necessary.  The case can happen on any GNU
compiler, not just an Apple version.
2011-12-22 09:40:32 -05:00
David Cole f7be6d616f Merge topic 'GNU-to-MS'
c213eb9 Windows-GNU: Remove extra quotes in GNUtoMS rule variable
2011-12-16 10:15:44 -05:00
David Cole 8f8ee53729 Merge topic 'test-compiler-output-var'
5f6985a Avoid clobbering variable 'OUTPUT' in compiler tests (#12628)
2011-12-16 10:15:20 -05:00
David Cole 65db5b4a99 Merge topic 'osx-dependent-libraries'
5d99343 Do not link private dependent shared libraries on OS X > 10.4
2011-12-16 10:15:07 -05:00
David Cole e44cdb04f1 Merge topic 'hp-shared-libs'
5720e1f HP: Drive shared library linking with compiler front end
2011-12-16 10:14:56 -05:00
David Cole c6c82f9e3e Merge topic 'fix-12480-correct-windres-compiler-when-cross-compiling'
6ddb1e5 Modules: Use "windres" as rc compiler base name for cross-compiles (#12480)
2011-12-16 10:14:42 -05:00
David Cole ac9453c371 Merge topic 'fix-lapack-issues'
b3c42cb FindLAPACK: List thread libs to avoid link errors (#12625)
f603cf2 FindLAPACK: Correct CMAKE_FIND_LIBRARY_SUFFIXES spelling (#12624)
2011-12-16 10:14:17 -05:00
David Cole c68a780dec Merge topic 'qt4-deploy-module'
4e9274e Unset configurations variable when no build type.
2011-12-16 10:13:59 -05:00
David Cole e945df2a7e Merge topic 'CPackRPM-0012608-UserSpecificFileControl'
121c295 CPackRPM fix #0012608 and unoticed related bug
2011-12-16 10:13:33 -05:00
Brad King 5f6985ac86 Avoid clobbering variable 'OUTPUT' in compiler tests (#12628)
Use an obscure name and clean up afterwards.
2011-12-15 08:31:17 -05:00
Brad King 5d9934312d Do not link private dependent shared libraries on OS X > 10.4
The default OS X 10.4 linker incorrectly searches for dependencies of
linked shared libraries only under the -isysroot location.  It fails to
find dependencies of linked shared libraries in cases such as the
ExportImport test.  It produces errors like:

 /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: warning can't open dynamic library:
 libtestLib3Imp.dylib
 referenced from: /.../ExportImport/Root/lib/libtestLib3lib.1.2.dylib
 (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
 /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols: _testLib3Imp
 referenced from libtestLib3lib expected to be defined in
 libtestLib3Imp.dylib

or with CMAKE_SKIP_RPATH off to enable install_name in the Export side:

 /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: warning can't open dynamic library:
 /Developer/SDKs/MacOSX10.4u.sdk/.../ExportImport/Export/impl/libtestLib3Imp.dylib
 referenced from: /.../ExportImport/Export/libtestLib3lib.1.2.dylib
 (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
 /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:_testLib3Imp
 referenced from libtestLib3lib expected to be defined in
 /.../ExportImport/Export/impl/libtestLib3Imp.dylib

Note how "/Developer/SDKs/MacOSX10.4u.sdk" is prepended to the dependent
library path.

Commit 2cff26fa (Support linking to shared libs with dependent libs,
2008-01-31) and commit 82fcaebe (Pass dependent library search path to
linker on some platforms, 2008-02-01) worked around the problem by
defining platform variable CMAKE_LINK_DEPENDENT_LIBRARY_FILES.  It tells
CMake to link to dependent libraries explicitly by their path thus
telling the linker where to find them.

Unfortunately the workaround had the side effect of linking dependent
libraries and defeats most benefits of LINK_INTERFACE_LIBRARIES.
Fortunately OS X 10.5 and above do not need to find transitive
dependencies at all so we can avoid the workaround on Modern OS X.
2011-12-15 08:14:30 -05:00
Brad King 5720e1f634 HP: Drive shared library linking with compiler front end
Previously we linked C, Fortran, and ASM shared libraries compiled with
the HP compiler using a direct invocation of the linker (ld).  This
behavior was left historically from support for an ancient HP C compiler
that did not know how to create shared libraries.  Fortran shared
libraries need to be linked with the compiler to get the language
runtime library dependencies as is already done for C++.

Update the HP-UX-HP* platform information to use the compiler front end
when linking shared libraries.  This works on modern HP tools and
produces correct behavior.  If there is a need to support older tools
again we can add a special case for them.
2011-12-14 09:32:27 -05:00
David Cole 6ddb1e5b9a Modules: Use "windres" as rc compiler base name for cross-compiles (#12480)
...if it matches "windres", as opposed to being exactly equal to "windres"

Cross-compiling windres compilers are named something like
"i686-w64-mingw32-windres" (for example)
2011-12-13 19:57:00 -05:00
Tim Gallagher b3c42cb012 FindLAPACK: List thread libs to avoid link errors (#12625) 2011-12-13 16:26:33 -05:00
Tim Gallagher f603cf2d36 FindLAPACK: Correct CMAKE_FIND_LIBRARY_SUFFIXES spelling (#12624) 2011-12-13 16:23:54 -05:00
Mike McQuaid 4e9274e954 Unset configurations variable when no build type. 2011-12-13 09:39:53 -07:00
Eric NOULARD 121c29553f CPackRPM fix #0012608 and unoticed related bug
The User may now specific a list of file that shouldn't be
automatically handled by CPack but specified by the user.
Like %config(noreplace) or specific %attr.
The concerned files/dir lines will be removed from the set
automatically handled by CPack.
2011-12-12 23:11:02 +01:00
Brad King 4cb73c43ac FortranCInterface: Work around mingw32-make trouble with parens
The mingw32-make tool does not handle parenthesis in the path to a
source file consistently.  When CMake is installed in a typical location
like "c:\Program Files (x86)\CMake 2.8\" the mingw32-make tool fails on
the FortranCInterface detection project sometimes with errors like

 >mingw32-make -f CMakeFiles\myfort.dir\build.make CMakeFiles/myfort.dir/my_module.f90.obj
 mingw32-make: *** No rule to make target `x86)/CMake 2.8/share/cmake-2.8/Modules/FortranCInterface/my_module.f90)',
 needed by `CMakeFiles/myfort.dir/my_module.f90.obj'.  Stop.

due to parens in the path to the FortranCInterface source directory.
However, the behavior varies with the file name of build.make:

 >copy CMakeFiles\myfort.dir\build.make CMakeFiles\myfort.dir\build2.make
 >mingw32-make -f CMakeFiles\myfort.dir\build2.make CMakeFiles/myfort.dir/my_module.f90.obj
 [  3%] Building Fortran object CMakeFiles/myfort.dir/my_module.f90.obj

Tested with

 >mingw32-make -v
 GNU Make 3.82
 Built for i386-pc-mingw32

Work around the problem by copying the whole FortranCInterface source
directory in to the project build tree.
2011-12-09 09:40:14 -05:00
Brad King c213eb9cbf Windows-GNU: Remove extra quotes in GNUtoMS rule variable
CMake replaces the <TARGET...> tokens with properly quoted values so we
do not need an extra set of quotes around them.
2011-12-08 13:28:37 -05:00
David Cole d050d6b58b Merge topic 'AutomocIncludedDotMocFileHandling'
2d11951 Merge branch 'master' into AutomocIncludedDotMocFileHandling
1eca18f automoc: add documentation for CMAKE_AUTOMOC_STRICT_MODE
bc278ce automoc: fix line length
62e223e automoc: add variable CMAKE_AUTOMOC_STRICT_MODE, to enable strict parsing
40c5167 automoc: accept even more .moc files in non-strict mode
c207f5d automoc: also accept other files when .moc is included in non-strict mode
9c0df72 automoc: add a StrictParseCppFile(), which is only qmake-compatible
174bf35 automoc: move the code for finding headers into separate function
8507eae automoc: fix handling of included _p.moc files
7ada172 automoc: some more linebreaks for the warnings for better readability
3b93e26 automoc: add extra check whether the header contains Q_PRIVATE_SLOT
4745715 Add a test case for the use of Q_PRIVATE_SLOT.
bde4edb automoc: add special handling for including basename_p.moc, with test
74ab0f6 automoc: move some code from the big parsing loop into separate functions
bc7560e automoc: add test for including a moc_abc_p.cpp file
30fd8e6 automoc: add test for including the moc file from another header
...
2011-12-07 16:47:35 -05:00
David Cole 0ea95b99ce Merge topic 'topics/FindCUDA/Misc-fixes'
aa36082 Miscellaneous fixes.
2011-12-07 16:45:35 -05:00
David Cole c26e28754c Merge topic 'topics/FindCUDA/Multi-dir-clash'
80e279d Make CUDA working directory unique for each target.
2011-12-07 16:45:00 -05:00
David Cole 2d1195123e Merge branch 'master' into AutomocIncludedDotMocFileHandling
Conflicts:
	Source/cmTarget.cxx
2011-12-07 16:29:13 -05:00
David Cole 9f18f64c7c Merge topic 'topics/FindCUDA/Quote-fixes'
c3c7a0c Fixes for handling quotes in args and other places (Fix Bug 11726 and 12099).
2011-12-06 15:08:12 -05:00
David Cole de9dc82779 Merge topic 'topics/FindCUDA/FixCUDAInUNCPath'
83d4eea Add work around for CUDA in UNC paths.
2011-12-06 15:08:03 -05:00
David Cole 35017df53c Merge topic 'topics/FindCUDA/linux-double-build'
aa59544 Reset dependency file list when a dependency disappeared.
2011-12-06 15:07:48 -05:00
David Cole 386cf3c593 Merge topic 'GNU-to-MS'
ae62a1c Test CMAKE_GNUtoMS option in ExportImport on MinGW and MSys
afb00fe Add CMAKE_GNUtoMS option to convert GNU .dll.a to MS .lib
61e8629 Factor makefile generator link rule lookup into helper function
a603250 Load platform files that need to know the ABI when possible
ecd8414 Fortran: Detect pointer size in gfortran on MinGW
2011-12-06 15:07:39 -05:00
David Cole b8c0dd48b0 Merge topic 'CUDAv3.2PathChanges'
8930938 Added support for CUDA_PATH which is present in the CUDA toolkit 3.2 onward.
2011-12-06 15:07:27 -05:00
David Cole cc35c8fad3 Merge topic 'findlapack-0012477-new'
f44f053 FindLAPACK: Fix linking to static LAPACK on Unix (#12477)
2011-12-06 15:06:52 -05:00
David Cole 4c84aa7346 Merge topic 'TinyCC-compiler'
0efe602 TinyCC: Add default compilation flags (#12605)
ec636e2 TinyCC: Add compiler info for shared libs on Linux (#12605)
1f49d72 Recognize the Tiny C Compiler (#12605)
2011-12-06 15:06:34 -05:00
James Bigler aa36082a2b Miscellaneous fixes. 2011-12-05 19:04:48 -07:00
James Bigler 80e279d37c Make CUDA working directory unique for each target.
This allows you to have more than source file with the same name but different
directories.  The intermediate and configuration files are now in this same directory.
2011-12-05 19:00:00 -07:00
James Bigler c3c7a0cfb8 Fixes for handling quotes in args and other places (Fix Bug 11726 and 12099). 2011-12-05 17:16:05 -07:00
James Bigler 83d4eeadac Add work around for CUDA in UNC paths.
Nvcc can emit '/path' instead of '//path' which can cause a lot of grief later.  We test
to see if the file exists, if it doesn't then we see if the file exists with '/'
prepended.  Files that don't exist won't be added to the list.
2011-12-05 16:54:06 -07:00
James Bigler aa59544078 Reset dependency file list when a dependency disappeared.
Fix a long outstanding bug when a file in the dependency list wasn't found.  This bug
wouldn't reset the dependencies, so the makefile would still want the missing file when
building.  The work around was to configure twice, but this is no longer necessary.
2011-12-05 16:29:28 -07:00
Brad King afb00fef19 Add CMAKE_GNUtoMS option to convert GNU .dll.a to MS .lib
Teach the Windows-GNU.cmake platform file to look for Visual Studio
tools matching the target ABI.  Add an extra step to the link command
for shared libraries and executables that export symbols and on which a
new GNUtoMS property is set (initialized by the CMAKE_GNUtoMS option).
Tell the GNU linker to output a module definition (.def) file listing
exported symbols in addition to the GNU-format import library (.dll.a).
Pass the .def file to the MS "lib" tool to construct a MS-format DLL
import library (.lib).

Teach the install(TARGETS) command to install the MS import library next
to the GNU one.  Teach the install(EXPORT) and export() command to set
the IMPORTED_IMPLIB property pointing at the import library to use the
import library matching the tools in the importing project.
2011-12-05 18:13:49 -05:00
James Bigler 8930938351 Added support for CUDA_PATH which is present in the CUDA toolkit 3.2 onward.
This required changing how the paths were used.  I now use the PATH_SUFFIXES parameter
instead of putting the whole path in the command.
2011-12-05 16:04:00 -07:00
Brad King a603250a13 Load platform files that need to know the ABI when possible
Load platform files named in CMAKE_<lang>_ABI_FILES for each language
once the ABI sizeof(void*) is known.  During the first configuration
this is after the test for working compiler and ABI detection checks.
During later configurations the ABI information is immediately available
because it has been saved in CMake<lang>Compiler.cmake.
2011-12-05 16:35:42 -05:00
Brad King ecd8414757 Fortran: Detect pointer size in gfortran on MinGW
Use __SIZEOF_POINTER__ which the GNU Fortran compiler defines at least
on 64-bit MinGW.  Assume default size 4 on MinGW if gfortran does not
define the size.
2011-12-05 16:32:29 -05:00
Alexey Ozeritsky f44f053a52 FindLAPACK: Fix linking to static LAPACK on Unix (#12477) 2011-12-05 11:41:52 -05:00
Mathieu Malaterre 0efe602c59 TinyCC: Add default compilation flags (#12605) 2011-12-05 08:59:50 -05:00
Pierre-Francois Laquerre 9b07c19f92 Fix path quoting in Qt4 macros
Adding VERBATIM to the ADD_CUSTOM_COMMAND calls in the qt4 macros
ensures that paths are properly quoted when passed to the shell.
This fixes issues when building projects that contained paths with
special characters (according to /bin/sh), such as parentheses or
spaces.
2011-12-03 17:51:24 -07:00
Alex Neundorf 62e223e8fa automoc: add variable CMAKE_AUTOMOC_STRICT_MODE, to enable strict parsing
Alex
2011-12-02 22:08:06 +01:00
Brad King ec636e299f TinyCC: Add compiler info for shared libs on Linux (#12605)
Use the "-shared" option to link shared libraries.  The compiler does
not support "-Wl," or "-rpath" but does know how to pass "-soname"
through to the linker.
2011-12-02 10:23:48 -05:00
Brad King 1f49d725ab Recognize the Tiny C Compiler (#12605)
See compiler home page here:

  http://tinycc.org/
  http://bellard.org/tcc/

Use the id "TinyCC" as it appears in their online documentation.
2011-12-02 10:08:34 -05:00
David Cole 9401da8084 Merge topic 'FindZLIB-use-ZLIB_ROOT'
985dee4 FindZLIB: Search under ZLIB_ROOT if it is set
2011-12-01 14:03:36 -05:00
David Cole 333fd1131c Merge topic 'useqt4-fix-declarative'
3cd08ce Qt4: Fix dependencies of QtDeclartive.
2011-12-01 14:03:03 -05:00
David Cole 9c288d6c2b Merge topic 'automoc_qt5'
a828623 moc is now part of the Qt5Core module
b8c8cab Merge remote-tracking branch 'origin/master' into automoc_qt5
2011-12-01 14:02:21 -05:00
Brad King 985dee4f54 FindZLIB: Search under ZLIB_ROOT if it is set
Perform multiple separate searches in order.  If ZLIB_ROOT is set search
it exclusively so it takes precedence over CMAKE_PREFIX_PATH.  This
allows a user to provide -DZLIB_ROOT=/path/to/zlib/prefix on the CMake
command line to tell it exactly where to find zlib.  Otherwise fall back
to a normal search.

Inspired-by: Andreas Schneider <asn@cryptomilk.org>
2011-11-30 13:18:07 -05:00
Clinton Stimpson 3cd08ce048 Qt4: Fix dependencies of QtDeclartive. 2011-11-29 09:02:40 -07:00