Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
4a7eb0cd
Commit
4a7eb0cd
authored
Mar 17, 2014
by
Brad King
Browse files
Merge branch 'CONFIG-LOCATION-CMP0026' into release
parents
43b39b1c
c903b531
Changes
21
Hide whitespace changes
Inline
Side-by-side
Help/policy/CMP0026.rst
View file @
4a7eb0cd
...
...
@@ -3,7 +3,8 @@ CMP0026
Disallow use of the LOCATION target property.
CMake 2.8.12 and lower allowed reading the LOCATION target property to
CMake 2.8.12 and lower allowed reading the LOCATION target
property (and configuration-specific variants) to
determine the eventual location of build targets. This relies on the
assumption that all necessary information is available at
configure-time to determine the final location and filename of the
...
...
@@ -17,8 +18,8 @@ $<TARGET_FILE> generator expression together with the file(GENERATE)
subcommand to generate a file containing the target location.
The OLD behavior for this policy is to allow reading the LOCATION
propert
y
from build-targets. The NEW behavior for this policy is to
not to allow reading the LOCATION propert
y
from build-targets.
propert
ies
from build-targets. The NEW behavior for this policy is to
not to allow reading the LOCATION propert
ies
from build-targets.
This policy was introduced in CMake version 3.0. CMake version
|release| warns when the policy is not set and uses OLD behavior. Use
...
...
Source/cmTarget.cxx
View file @
4a7eb0cd
...
...
@@ -2730,6 +2730,21 @@ const char *cmTarget::GetProperty(const char* prop,
this
->
GetLocation
(
configName
.
c_str
()),
cmProperty
::
TARGET
);
}
// Support "<CONFIG>_LOCATION".
if
(
cmHasLiteralSuffix
(
prop
,
"_LOCATION"
))
{
std
::
string
configName
(
prop
,
strlen
(
prop
)
-
9
);
if
(
configName
!=
"IMPORTED"
)
{
if
(
!
this
->
HandleLocationPropertyPolicy
())
{
return
0
;
}
this
->
Properties
.
SetProperty
(
prop
,
this
->
GetLocation
(
configName
.
c_str
()),
cmProperty
::
TARGET
);
}
}
}
if
(
strcmp
(
prop
,
"INCLUDE_DIRECTORIES"
)
==
0
)
{
...
...
Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-result.txt
0 → 100644
View file @
4a7eb0cd
1
Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt
0 → 100644
View file @
4a7eb0cd
CMake Error at CMP0026-CONFIG-LOCATION-NEW.cmake:7 \(get_target_property\):
Policy CMP0026 is not set: Disallow use of the LOCATION target property.
Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The LOCATION property may not be read from target "somelib". Use the
target name directly with add_custom_command, or use the generator
expression \$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW.cmake
0 → 100644
View file @
4a7eb0cd
enable_language
(
CXX
)
cmake_policy
(
SET CMP0026 NEW
)
add_library
(
somelib empty.cpp
)
get_target_property
(
_loc somelib Debug_LOCATION
)
Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-result.txt
0 → 100644
View file @
4a7eb0cd
0
Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt
0 → 100644
View file @
4a7eb0cd
^$
Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD.cmake
0 → 100644
View file @
4a7eb0cd
enable_language
(
CXX
)
cmake_policy
(
SET CMP0026 OLD
)
add_library
(
somelib empty.cpp
)
get_target_property
(
_loc somelib Debug_LOCATION
)
Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-result.txt
0 → 100644
View file @
4a7eb0cd
0
Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt
0 → 100644
View file @
4a7eb0cd
CMake Warning \(dev\) at CMP0026-CONFIG-LOCATION-WARN.cmake:5 \(get_target_property\):
Policy CMP0026 is not set: Disallow use of the LOCATION target property.
Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The LOCATION property should not be read from target "somelib". Use the
target name directly with add_custom_command, or use the generator
expression \$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN.cmake
0 → 100644
View file @
4a7eb0cd
enable_language
(
CXX
)
add_library
(
somelib empty.cpp
)
get_target_property
(
_loc somelib Debug_LOCATION
)
Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-result.txt
0 → 100644
View file @
4a7eb0cd
1
Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt
0 → 100644
View file @
4a7eb0cd
CMake Error at CMP0026-LOCATION-CONFIG-NEW.cmake:7 \(get_target_property\):
Policy CMP0026 is not set: Disallow use of the LOCATION target property.
Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The LOCATION property may not be read from target "somelib". Use the
target name directly with add_custom_command, or use the generator
expression \$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW.cmake
0 → 100644
View file @
4a7eb0cd
enable_language
(
CXX
)
cmake_policy
(
SET CMP0026 NEW
)
add_library
(
somelib empty.cpp
)
get_target_property
(
_loc somelib LOCATION_Debug
)
Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-result.txt
0 → 100644
View file @
4a7eb0cd
0
Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt
0 → 100644
View file @
4a7eb0cd
^$
Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD.cmake
0 → 100644
View file @
4a7eb0cd
enable_language
(
CXX
)
cmake_policy
(
SET CMP0026 OLD
)
add_library
(
somelib empty.cpp
)
get_target_property
(
_loc somelib LOCATION_Debug
)
Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-result.txt
0 → 100644
View file @
4a7eb0cd
0
Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt
0 → 100644
View file @
4a7eb0cd
CMake Warning \(dev\) at CMP0026-LOCATION-CONFIG-WARN.cmake:5 \(get_target_property\):
Policy CMP0026 is not set: Disallow use of the LOCATION target property.
Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The LOCATION property should not be read from target "somelib". Use the
target name directly with add_custom_command, or use the generator
expression \$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN.cmake
0 → 100644
View file @
4a7eb0cd
enable_language
(
CXX
)
add_library
(
somelib empty.cpp
)
get_target_property
(
_loc somelib LOCATION_Debug
)
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment