Commit Graph

424 Commits

Author SHA1 Message Date
Stephen Kelly 290e92ada8 Move GetIncludeDirectories to cmGeneratorTarget. 2012-09-19 15:32:09 +02:00
Stephen Kelly f9146f6b90 Port cmLocalGenerator::GetTargetFlags to cmGeneratorTarget. 2012-09-19 15:31:39 +02:00
Stephen Kelly 9facfd1336 Move GetCreateRuleVariable to cmGeneratorTarget. 2012-09-19 15:31:32 +02:00
Stephen Kelly 78bfee35d5 Make cmLocalGenerator::AddArchitectureFlags take a cmGeneratorTarget. 2012-09-19 15:31:29 +02:00
Stephen Kelly 4f5384e75c Move GetLinkInformation to cmGeneratorTarget 2012-09-19 15:30:57 +02:00
Stephen Kelly 987e12e2f9 Move GenerateTargetManifest to cmGeneratorTarget. 2012-09-19 15:30:49 +02:00
Stephen Kelly 3dae652b4e Don't duplicate -D defines sent to the compiler.
There is no need to do so. Be consistent with include directories and
ensure uniqueness.

This requires changing the API of the cmLocalGenerator::AppendDefines
method, and changing the generators to match.

The test unfortunately can't test for uniqueness, but it at least verifies
that nothing gets lost.
2012-08-20 22:30:11 +02:00
David Cole e5ebb77405 Merge topic 'no-source-language-crash'
2c2fbaf Do not crash on unknown source language (#13323)
2012-06-21 11:54:52 -04:00
Mariusz Plucinski 2c2fbaf0e5 Do not crash on unknown source language (#13323)
If a source file extension is not recognized as any language then
src.GetLanguage() may return NULL.  Check the result before
dereferencing in cmLocalGenerator::GetObjectFileNameWithoutTarget.
2012-06-20 08:59:54 -04:00
David Cole 565744bd3d Merge topic 'ninja-cldeps'
eb410e8 Ninja: disable cldeps for bcc32, it's too old, and ninja would also not build
5ead31d Ninja: try work around for bcc32 bug
1333b57 Ninja: build server fixes
9081e3a remove warning about unused parameter
f430bea Ninja: maybe this fixes the bcc32 build
f2c1288 Ninja: msvc6 for-scoping
44b9bbc Ninja: build with old msvc versions
57156a5 Ninja: build server fixes
f1abdce Ninja: some bytes of the rc files couldn't be piped correctly
2de963d Ninja: don't remove space between command and parameters
50b6f33 Ninja: build cmcldeps with mingw
c05653e Ninja: try to make GetProcessId visible
ab245ff Ninja: but cl supports /nologo ...
bf58e9a Ninja: no /nologo option in old rc.exe
2fb07fc Ninja: Eclipse and KDevelop fixes for ninja
518c065 Ninja: don't pollute build dir with preprocessed rc files
...
2012-06-19 14:42:41 -04:00
Peter Kuemmel 43200c145d Ninja: work with ninja/master, don't compile rc files with cl
Ninja generates for paths with spaces wrong results for $out.d,
using the new DEP_FILE variable instead.
2012-06-13 00:52:46 +02:00
Stephen Kelly bd34963002 Refactor generation of shared library flags
CMAKE_SHARED_LIBRARY_<lang>_FLAGS has flags on various platforms for a
variety of purposes that are correlated with shared libraries but not
exclusive to them.  Refactor generation of these flags to use new
purpose-specific platform variables

  CMAKE_<lang>_COMPILE_OPTIONS_DLL
  CMAKE_<lang>_COMPILE_OPTIONS_PIC
  CMAKE_<lang>_COMPILE_OPTIONS_PIE

Activate the DLL flags specifically for shared libraries.  Add a new
POSITION_INDEPENDENT_CODE target property to activate PIC/PIE flags, and
default to true for shared libraries to preserve default behavior.
Initialize the new property from CMAKE_POSITION_INDEPENDENT_CODE to
allow easy global configuration in projects.

Although the default behavior is unchanged by this refactoring, the new
approach ignores CMAKE_SHARED_LIBRARY_<lang>_FLAGS completely.  We must
leave it set in case projects reference the value.  Furthermore, if a
project modifies CMAKE_SHARED_LIBRARY_<lang>_FLAGS it expects the new
value to be used.  Add policy CMP0018 to handle compatibility with
projects that modify this platform variable.

Add a PositionIndependentCode test on platforms where we can get
meaningful results.
2012-06-12 15:38:48 -04:00
Peter Collingbourne d807aab28f Ninja: apply CMAKE_<LANG>_FLAGS_<TYPE> to executable targets (#13069)
Based on a patch by Zaheer Chothia!
2012-05-16 22:56:42 +01:00
Modestas Vainius e1409ac59b Support building shared libraries or modules without soname (#13155)
Add a boolean target property NO_SONAME which may be used to disable
soname for the specified shared library or module even if the platform
supports it.  This property should be useful for private shared
libraries or various plugins which live in private directories and have
not been designed to be found or loaded globally.

Replace references to <CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG> and
hard-coded -install_name flags with a conditional <SONAME_FLAG> which is
expanded to the value of the CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG
definition as long as soname supports is enabled for the target in
question.  Keep expanding CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG in
rules in case third party projects still use it.  Such projects would
not yet use NO_SONAME so the adjacent <TARGET_SONAME> will always be
expanded.  Make <TARGET_INSTALLNAME_DIR> NO_SONAME aware as well.  Since
-install_name is soname on OS X, this should not be a problem if this
variable is expanded only if soname is enabled.

The Ninja generator performs rule variable substitution only once
globally per rule to put its own placeholders.  Final substitution is
performed by ninja at build time.  Therefore we cannot conditionally
replace the soname placeholders on a per-target basis.  Rather than
omitting $SONAME from rules.ninja, simply do not write its contents for
targets which have NO_SONAME.  Since 3 variables are affected by
NO_SONAME ($SONAME, $SONAME_FLAG, $INSTALLNAME_DIR), set them only if
soname is enabled.
2012-04-30 11:50:27 -04:00
Brad King c68cc06612 Merge branch 'object-library' into ninja-object-library 2012-03-16 10:18:01 -04:00
Brad King b87d7a60a0 Add OBJECT_LIBRARY target type
This library type can compile sources to object files but does not link
or archive them.  It will be useful to reference from executable and
normal library targets for direct inclusion of object files in them.

Diagnose and reject the following as errors:

* An OBJECT library may not be referenced in target_link_libraries.

* An OBJECT library may contain only compiling sources and supporting
  headers and custom commands.  Other source types that are not normally
  ignored are not allowed.

* An OBJECT library may not have PRE_BUILD, PRE_LINK, or POST_BUILD
  commands.

* An OBJECT library may not be installed, exported, or imported.

Some of these cases may be supported in the future but are not for now.

Teach the VS generator that OBJECT_LIBRARY targets are "linkable" just
like STATIC_LIBRARY targets for the LinkLibraryDependencies behavior.
2012-03-13 14:37:32 -04:00
Brad King 51b67366ed Merge branch 'cleanup-object-file-names' into object-library 2012-03-09 15:15:37 -05:00
David Cole 580171185b Merge topic 'target-include-directories'
d662dff Fix shadowed variable warning on dashboard results
f66e735 Fix compiler warning reported on older Borland dashboard.
d90eed4 Fix compiler error reported on older Borland dashboard.
8233636 Update the documentation regarding INCLUDE_DIRECTORIES.
d899eb7 Call ExpandVariablesInString for each target's INCLUDE_DIRECTORIES
c21db87 Make search paths ordered and unique
22021f0 Remove cmMakefile::GetIncludeDirectories
9106b56 Extract and use the INCLUDE_DIRECTORIES target properties.
840509b Keep the INCLUDE_DIRECTORIES target property up to date.
a4d5f7b Add API to get the ordered includes for a target.
8adaee2 CMake: Eliminate cmMakefile::IncludeDirectories
7620932 Remove include flags memoization.
97a5faa Make it safe to call this method without creating duplicates.
edd5303 Refactor GetIncludeFlags to take includes instead of fetching them
2012-03-08 15:13:15 -05:00
Peter Kuemmel dbe3dce546 Ninja: add .def file support 2012-03-07 16:24:34 -05:00
Brad King 4ae7f3656b Remove unused partial OBJECT_FILES property implementation
Remove partial implementation added by commit ca0230a3 (check in initial
conv library stuff, 2007-02-16) since it was never finished.  It does
not make sense for multi-configuration generators since no specific
build configuration is processed at CMake time.
2012-03-06 13:20:17 -05:00
David Cole 881dc35579 Merge topic 'factor-install-type'
573fa3b Factor cmInstallType out of cmTarget::TargetType
2012-03-02 11:47:42 -05:00
Brad King 573fa3bf13 Factor cmInstallType out of cmTarget::TargetType
The purpose of the TargetType enumeration was overloaded for install
type because install rules were once recorded as targets.  Factor the
install types out into their own enumeration.
2012-02-27 13:19:57 -05:00
Yury G. Kudryashov 4f6fd961da Drop if(...) check because condition is always true
GetLocation returns std::string::c_str() which is never NULL
2012-02-27 11:59:15 -05:00
David Cole bada88e8e4 Merge branch 'target-include-directories' into ninja-generator 2012-02-22 16:21:48 -05:00
Stephen Kelly 9106b564ae Extract and use the INCLUDE_DIRECTORIES target properties.
Eliminate callers of cmMakefile::GetIncludeDirectories.

All callers of GetIncludeDirectories should go through the local generator
object.

Only the local generator calls cmTarget::GetIncludeDirectories directly.
2012-02-22 06:31:50 -05:00
David Cole 8adaee2b0b CMake: Eliminate cmMakefile::IncludeDirectories
Instead, re-implement it in terms of the directory property INCLUDE_DIRECTORIES.
2012-02-22 06:31:49 -05:00
Stephen Kelly 7620932d82 Remove include flags memoization. 2012-02-22 06:31:49 -05:00
Stephen Kelly 97a5faa858 Make it safe to call this method without creating duplicates. 2012-02-22 06:31:49 -05:00
Stephen Kelly edd5303949 Refactor GetIncludeFlags to take includes instead of fetching them 2012-02-22 06:31:49 -05:00
Peter Collingbourne 4468edf12b Add executable with exports flag support to cmLocalGenerator::GetTargetFlags 2012-02-02 23:36:42 +00:00
Brad King 6b104e107e Remove trailing whitespace from cmLocalGenerator 2011-11-29 08:58:45 -05:00
Peter Collingbourne fec4b63714 Fix configuration-dependent flag lookup in cmLocalGenerator::GetTargetFlags
Specifically, perform configuration-dependent lookup of
STATIC_LIBRARY_FLAGS for static libraries, and use the correct prefix
for configuration-dependent lookup of LINK_FLAGS (i.e. "LINK_FLAGS_",
as opposed to the value of the LINK_FLAGS property).
2011-10-02 18:30:43 +01:00
Peter Collingbourne 5b114c9bee Introduce a cmLocalGenerator::ConvertToIncludeReference function
This provides a mechanism for the local generator to override how
header search paths are generated.
2011-10-02 18:30:43 +01:00
Nicolas Despres 3db2973bd2 Refactor TargetTypeNames.
Make it a static method instead of an array. It is safer for the
type checking and if we add a new target type we will be warned to add
a case to the switch.
2011-10-02 18:30:42 +01:00
Brad King 5c0c635a09 Fortran: Add support for free- and fixed-form flags
Define a "Fortran_FORMAT" target and source file property.  Initialize
the target property from a "CMAKE_Fortran_FORMAT" variable.  Interpret
values "FIXED" and "FREE" to indicate the source file format.  Append
corresponding flags to the compiler command line.
2011-08-31 10:24:43 -04:00
Brad King 148b528f9d Merge topic 'custom-command-slashes'
1286050 Normalize slashes of add_custom_(command|target) DEPENDS (#11973)
2011-03-31 13:23:32 -04:00
Brad King 128605054a Normalize slashes of add_custom_(command|target) DEPENDS (#11973)
All commands accepting file paths should normalize the slashes so that
the string-represented names can be compared reliably.  The commands
add_library and add_executable have done this for years.  We taught
add_custom_command to normalize its OUTPUT names in commit a75a0a14
(Normalize add_custom_command OUTPUT names, 2010-12-15).  We handled a
special case of the DEPENDS option in commit 7befc007 (Handle trailing
slashes on add_custom_command DEPENDS, 2011-01-26).

Teach both add_custom_command and add_custom_target to normalize slashes
of DEPENDS files up front.  This approach subsumes the above-mentioned
special case so remove the one line added for it but keep its test.
Extend the CustomCommand test to check that slash count mismatches
between custom command OUTPUT and DEPENDS can still be linked correctly.
2011-03-30 09:52:07 -04:00
Brad King 1c3233a850 Merge topic 'include-flags-response-file'
86cb17b Pass include directories with response files to GNU on Windows
9a0b9bc Optionally pass include directories with response files
6e8a67f Generate target-wide flags before individual build rules
d099546 Factor old-style -D flags out from -I flag generation
2011-03-22 14:45:44 -04:00
Brad King 9a0b9bc8b7 Optionally pass include directories with response files
Create platform option CMAKE_<lang>_USE_RESPONSE_FILE_FOR_INCLUDES to
enable use of response files for passing the list of include directories
to compiler command lines.
2011-03-17 17:56:13 -04:00
Brad King d099546450 Factor old-style -D flags out from -I flag generation
Move the GetDefineFlags call from cmLocalGenerator::GetIncludeFlags to
all call sites so that the method exclusively constructs a string of
include search path flags.
2011-03-15 13:09:06 -04:00
Brad King 7befc00783 Handle trailing slashes on add_custom_command DEPENDS 2011-01-26 18:01:33 -05:00
Brad King 1a29ccaf9a Remove cmLocalGenerator::GetRealLocation
The cmCustomCommandGenerator::GetCommand method completely replaces the
purpose of this method.  Re-implement GetRealLocation inline at the only
remaining call site and remove it.
2010-12-08 17:29:53 -05:00
Brad King ced1d5eccd Skip file-level dependencies on custom targets (#11332)
A custom command may name a target created by add_custom_target in its
DEPENDS field.  Treat this case as a target-level dependency only since
a custom target provides no standard file on which to add a file-level
dependency.
2010-12-08 17:14:17 -05:00
Brad King e30a775f68 Improve signature of cmLocalGenerator::GetRealDependency
Allow file-level custom command dependencies to be skipped.
2010-12-08 17:14:14 -05:00
Brad King b06fb16684 No CMAKE_CONFIGURATION_TYPES in single-config generators (#10202)
Factor out reading of CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE
into cmMakefile::GetConfigurations.  Read the former only in
multi-config generators.
2010-09-08 14:54:49 -04:00
Brad King cb9ea2647f Remove cmSystemTools::EscapeSpaces method
The last remaining call to this method exists only for compatibility.
Remove the method and put its implementation inline in place of the last
call.
2010-08-18 10:26:05 -04:00
Kai Wasserbäch 9203e9187e Fix spelling errors reported by Lintian.
During a Lintian run on the binary packages of CMake in Debian I was
notified of many spelling mistakes.
2010-07-13 09:41:37 -04:00
Brad King d9b2da139d Merge branch 'mingw-response-files' 2010-06-15 13:58:58 -04:00
Alex Neundorf 3901e0408c -improve crosscompiling from Linux to iphone (#10526)
Patch by Karol Krizka

Alex
2010-05-01 20:38:28 +02:00
Brad King 87f0853941 Use forward slashes for objects in response files
Response files are parsed by tools, not by shells.  We teach
cmLocalGenerator::Convert() a new "RESPONSE" output format and use it
for objects listed in response files.  It does not do special slash or
MSYS root translation like the "SHELL" format does.  This is necessary
for GNU tools on Windows to understand response file content.

See issue #10401.
2010-03-11 09:40:24 -05:00
David Cole 9a35d67bce Fix line length style issue. 2010-02-01 21:43:51 -05:00
David Cole 6ee87b2e5c Fix issue #10155 - default value of CMAKE_OSX_DEPLOYMENT_TARGET should always be the empty string. When the value of CMAKE_OSX_DEPLOYMENT_TARGET is the empty string, the -mmacosx-version-min flag should not show up on the compiler command line. The logic for selecting default value of CMAKE_OSX_SYSROOT is orthogonal to and independent of the value of the deployment target. The default value for CMAKE_OSX_SYSROOT is the SDK that corresponds to the current version of Mac OSX on which cmake is running. 2010-01-29 11:56:35 -05:00
Brad King 4f43c1f276 Singly-quote target names for Watcom linker
The Watcom tools do their own command-line parsing and do not accept
double-quotes.  Instead we single-quote the target output name when
invoking wlink and other Watcom tools.  This fixes support for spaces in
the target output directory path when it is not under the build tree.
2009-11-30 11:16:24 -05:00
Brad King 2dc39b8c32 Define per-target OSX_ARCHITECTURES property
The CMAKE_OSX_ARCHITECTURES variable works only as a global setting.
This commit defines target properties

  OSX_ARCHITECTURES
  OSX_ARCHITECTURES_<CONFIG>

to specify OS X architectures on a per-target and per-configuration
basis.  See issue #8725.
2009-10-21 13:00:49 -04:00
Brad King 0653286dc6 Split Borland compiler information files
This commit re-writes Borland compiler build rules.  We split the rules
into modern <os>-<id>-<lang> information modules but share a common
macro between languages to avoid duplication.

We also address a bug in the previous rules that would build some target
types against the static Borland runtime and others against the shared
Borland runtime in one build tree.  Now we always use the shared runtime
as is the default in the rules for MS tools.
2009-10-08 11:56:07 -04:00
Brad King 1e48243591 Introduce "build feature" lookup framework
This creates cmTarget::GetFeature and cmMakefile::GetFeature methods to
query "build feature" properties.  These methods handle local-to-global
scope and per-configuration property lookup.  Specific build features
will be defined later.
2009-10-02 13:52:01 -04:00
Brad King f40406ed6b Fix default install prefix on Haiku
Since Haiku does not have /usr (and therefore /usr/local), this commit
changes the default install prefix to the equivalent directory of
/boot/common.

See issue #9607.
2009-09-30 08:31:53 -04:00
Brad King 96afb12087 Convert CMake to OSI-approved BSD License
This converts the CMake license to a pure 3-clause OSI-approved BSD
License.  We drop the previous license clause requiring modified
versions to be plainly marked.  We also update the CMake copyright to
cover the full development time range.
2009-09-28 11:43:28 -04:00
David Cole f199385605 Fix CMake Internal Error from cmTarget::GetOutputInfo - triggered by calling GetLocation on a utility target - caused by custom command output file with same name as custom target. The fix is to avoid calling GetLocation unless the target is of a type that is expected to have a location... 2009-09-25 13:23:19 -04:00
Brad King 3fe5f8d960 Optionally force conversion to relative path
In cmLocalGenerator::ConvertToRelativePath we normally convert to
relative path only if the local and remote paths both lie inside the
source tree or both lie inside the build tree.  This commit adds an
optional 'force' argument to allow conversion even when this rule is
violated.
2009-09-22 16:16:56 -04:00
Brad King 180c60a86f Fix check for -isysroot on OS X
Previously we checked for this flag by parsing the version number of GCC
out of 'gcc --version', but this is not reliable because the format can
vary greatly.  Now we run 'gcc -v --help' and look for '-isysroot' in
the list of options.

We also now store the result on a per-language basis in the per-compiler
info file "CMake<LANG>Compiler.cmake".  This is necessary to make it
accessible from try-compile projects so that they generate correctly.
2009-09-19 10:14:31 -04:00
Bill Hoffman e7d75864d1 Only do the OSX arch stuff on OSX. 2009-09-18 15:16:33 -04:00
Bill Hoffman 58818d5168 Add detection of gcc versions that do not support isysroot option and do not use it for them. 2009-09-18 14:22:20 -04:00
Bill Hoffman 6362d4c743 Fix case where no archs are found on older macs. 2009-09-17 16:09:52 -04:00
Bill Hoffman ea282284d5 Fix for bug #9466. Change the implementation of OSX arch lists. If no ARCHs are specified by the user then no flags are set. We no longer use CMAKE_OSX_ARCHITECTURES_DEFAULT. 2009-09-17 11:53:02 -04:00
Brad King e308621382 Create CMP0014 to require CMakeLists.txt files
Until now CMake accidentally accepted add_subdirectory() and subdirs()
calls referring to directories that do not contain a CMakeLists.txt
file.  We introduce CMake Policy CMP0014 to make this case an error.
2009-09-03 08:27:12 -04:00
Brad King 3fda5c6463 Factor cmLocalGenerator::Configure input file read
This method tells the cmMakefile to read the input CMakeLists.txt file.
We factor out the call into a ReadInputFile method so it can be extended
without polluting the Configure method.
2009-09-03 08:27:00 -04:00
Brad King 1db5c90644 Factor cmLocalGenerator::Configure object max path
Much of the code in this method was dedicated to computing ObjectMaxPath
after configuring the directory.  We move this last step into its own
ComputeObjectMaxPath method for better organization.
2009-09-03 08:26:46 -04:00
Brad King a6890a1673 Manage current local generator with automatic var
The cmLocalGenerator::Configure method sets its cmLocalGenerator
instance as the global generator's current local generator during
configuration.  This commit refactors management of the current local
generator to use an automatic variable.  This will allow early returns
from the method.
2009-09-03 08:26:31 -04:00
Ken Martin 410b8ebae1 ENH: minor cleanup of test 2009-08-04 15:41:57 -04:00
Bill Hoffman 300514fd25 ENH: make sure GUIDs for filters are cached 2009-07-17 10:05:54 -04:00
Bill Hoffman 3d1c12b802 ENH: remove INCLUDE_EXTERNAL_MSPROJECT name hack, and use target properties instead, fix VXExternalInclude test for VS10 2009-07-14 14:16:46 -04:00
Brad King a608467180 ENH: Simpler cmTarget::GetLinkerLanguage signature
This method previously required the global generator to be passed, but
that was left from before cmTarget had its Makefile member.  Now the
global generator can be retrieved automatically, so we can drop the
method argument.
2009-07-07 07:44:12 -04:00
Brad King 708d1cf1ee ENH: Support more preprocessor values in VS6
Previously we rejected all preprocessor definition values containing
spaces for the VS6 IDE generator.  In fact VS6 does support spaces but
not in combination with '"', '$', or ';', and only if we use the sytnax
'-DNAME="value with spaces"' instead of '-D"NAME=value with spaces"'.
Now we support all definition values that do not have one of these
invalid pairs.  See issue #8779.
2009-04-24 11:18:06 -04:00
David Cole f6828c391d BUG: Fix invalid array access discovered during investigation of issue #7832. 2009-04-07 15:13:07 -04:00
Brad King b59d0a4d13 BUG: Allow more shell ops in custom commands
This extends the set of common shell operators to include "||", "&&",
"1>", and "2>".  See issue #6868.
2009-03-17 15:11:33 -04:00
Brad King 66d69f864a ENH: Refactor generation of CTestTestfile content
This moves code which generates ADD_TEST and SET_TESTS_PROPERTIES calls
into CTestTestfile.cmake files out of cmLocalGenerator and into a
cmTestGenerator class.  This will allow more advanced generation without
cluttering cmLocalGenerator.  The cmTestGenerator class derives from
cmScriptGenerator to get support for per-configuration script
generation (not yet enabled).
2009-03-16 10:40:46 -04:00
Brad King 98c51ff6dc ENH: Overhaul CMake version numbering
This moves the version numbers into an isolated configured header so
that not all of CMake needs to rebuild when the version changes.

Previously we had spaces, dashes and/or the word 'patch' randomly chosen
before the patch number.  Now we always report version numbers in the
traditional format "<major>.<minor>.<patch>[-rc<rc>]".

We still use odd minor numbers for development versions.  Now we also
use the CCYYMMDD date as the patch number of development versions, thus
allowing tests for exact CMake versions.
2009-03-05 15:17:07 -05:00
Brad King 8c3290b4a3 BUG: Use new include dir suppresson for all gens
This fixes CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES to be used for all
generators instead of just those that construct their own compiler
command lines directly.  See issue #8598.
2009-02-26 09:16:16 -05:00
Brad King 3498a8c668 ENH: Simplify reverse cmLocalGenerator::Convert
It does not make sense to call the reverse Convert signature (for remote
paths corresponding to CMake-managed directories) with NONE or FULL
since they have no path.  Patch from Modestas Vainius.  See issue #7779.
2009-02-26 08:49:10 -05:00
Brad King cb788e8f6d ENH: Re-enable system include dir suppression
This creates variable CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES to
specify implicit include directories on a per-language basis.  This
replaces the previous platform-wide variable.  It is necessary to
avoid explicit specification of -I/usr/include on some compilers
(such as HP aCC) because:

  1.) It may break ordering among system include directories defined
      internally by the compiler, thus getting wrong system headers.
  2.) It tells the compiler to treat the system include directory
      as a user include directory, enabling warnings in the headers.

See issue #8598.
2009-02-25 11:44:46 -05:00
Brad King 39f8b91125 BUG: Remove implicit include dir suppression
We used to suppress generation of -I/usr/include (and on OSX also
-I/usr/local/include).  This behavior seems to cause more trouble than
it's worth, so I'm removing it until someone encounters the original
problem it fixed.  See issue #8598.
2009-02-24 15:37:09 -05:00
Brad King 15c52e9891 ENH: Add rule substitutions useful for launchers
This defines make rule substitutions <LANGUAGE>, <TARGET_NAME>,
<TARGET_TYPE>, and <OUTPUT>.  They will be useful for RULE_LAUNCH_*
property values.
2009-02-10 08:52:07 -05:00
Brad King b604b98c56 ENH: Define RULE_LAUNCH_* properties
This defines global, directory, and target properties
RULE_LAUNCH_COMPILE, RULE_LAUNCH_LINK, and RULE_LAUNCH_CUSTOM.  Their
values specify 'launcher' command lines which are prefixed to compile,
link, and custom build rules by Makefile generators.
2009-02-10 08:51:15 -05:00
Brad King a27e9ca4a2 BUG: Fix old-style install to prefix top
The old install_files, install_programs, and install_targets commands
used to permit installation to the top of the prefix by specifying
destination '/'.  This was broken in 2.6.0 to 2.6.2 by changes to
enforce valid destinations that did not account for this case.  This
change fixes the case by converting the install destination to '.' which
is the new-style way to specify the top of the installation prefix.
2009-02-04 10:34:10 -05:00
David Cole 1dee719cdc BUG: Fix issue #6195. Add CMAKE_OSX_DEPLOYMENT_TARGET cache variable to specify the target deployment runtime OS version of the built executables on Mac OSX. Thanks to Mike Jackson for the patch. 2009-01-27 10:30:55 -05:00
Brad King 205fce61b6 ENH: Warn if build dir is too long for filesystem
When an object file directory is too deep to place an object file
without exceeding CMAKE_OBJECT_PATH_MAX, this issues a warning.
Previously we silently ignored the problem.  See issue #7860.
2008-12-16 09:15:18 -05:00
Brad King 3cf9265fa7 ENH: Refactor passing of max length object dir
When computing the maximum length full path to the build directory under
which object files will be placed, pass the actual path instead of just
its length.  This will be useful for error message generation.
2008-12-16 09:14:40 -05:00
Brad King ad44a41a18 ENH: Fix optional use of relative paths.
These changes refactor cmLocalGenerator methods Convert and
ConvertToOutputForExisting to support references inside the build tree
using relative paths.  After this commit, all tests pass with Makefile
generators when relative paths are enabled by default.  See issue #7779.
2008-10-09 15:30:07 -04:00
Brad King 8bffd5af36 ENH: Simplify framework -F flag generation
This removes an unnecessary use of ConvertToOutputForExisting which is
needed only on Windows to consider short-pathing.
2008-10-09 15:07:35 -04:00
Brad King f89dae7a94 ENH: Create Info.plist files in OS X Frameworks
A Mac OS X Framework should provide a Resources/Info.plist file
containing meta-data about the framework.  This change generates a
default Info.plist for frameworks and provides an interface for users to
customize it.
2008-09-02 12:06:32 -04:00
Brad King 990c6b0b90 ENH: Allow custom limit on object file path length
Some native build tools, particularly those for cross compiling, may
have a limit on the length of the full path to an object file name that
is lower than the platform otherwise supports.  This change allows the
limit to be set by the project toolchain file through the variable
CMAKE_OBJECT_PATH_MAX.
2008-08-21 09:54:36 -04:00
Brad King 061d20be38 ENH: Add UNKNOWN type for IMPORTED libraries
When creating an IMPORTED target for a library that has been found on
disk, it may not be known whether the library is STATIC or SHARED.
However, the library may still be linked using the file found from disk.
Use of an IMPORTED target is still important to allow per-configuration
files to be specified for the library.

This change creates an UNKNOWN type for IMPORTED library targets.  The
IMPORTED_LOCATION property (and its per-config equivalents) specifies
the location of the library.  CMake makes no assumptions about the
library that cannot be inferred from the file on disk.  This will help
projects and find-modules import targets found on disk or specified by
the user.
2008-08-18 11:39:22 -04:00
Brad King 0bf093fd17 STYLE: Convert unused target type cases to default
In switch statements that deal with only a few target types, use a
'default' case for the remaining target types instead of listing them
explicitly.  This will make it easier to add more types in the future.
2008-08-18 11:26:51 -04:00
Brad King 7e11c5e928 BUG: Custom command depends may match sources
Custom command dependencies that are not full paths or targets may also
match source files.  When one does, the full information about the
source file's location and name may be used.  This fixes the case when a
custom commands depends by relative path on a source file generated by
another custom command specifying its output by relative path.
2008-08-05 13:27:06 -04:00
Brad King d35b5a2fb1 BUG: Do not convert RPATH entries to full path.
When generating RPATH entries on the link line using a repeated linker
flag (-R ... -R ... style) do not convert individual entries to a full
path.  We need to preserve what the user requested.
2008-08-05 09:55:08 -04:00
Brad King e44a9c9299 BUG: Fix escaping in link scripts
When generating escape sequences for the native build tool do not put in
Makefile escapes for paths generated into link scripts.  This fixes
putting "$ORIGIN" into the RPATH, and probably some other subtle
problems.
2008-08-05 09:55:02 -04:00
Bill Hoffman d6f02cd911 BUG: fix for bug 7421, fortran did not get arch flags on the mac 2008-07-30 10:44:57 -04:00
Bill Hoffman 1d1d874cf1 COMP: fix compiler warning and follow style 2008-07-22 13:32:43 -04:00
Brad King c1b8ad4e1d ENH: Allow users to specify a custom Info.plist template
- Create MACOSX_BUNDLE_INFO_PLIST target property to specify template.
  - Look for MacOSXBundleInfo.plist.in in CMAKE_MODULE_PATH by default.
  - See issue #6983.
2008-05-17 12:53:56 -04:00