Commit 9aecda56 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'genex-output_name'

60ec2922 Genex: Rename $<TARGET_*_OUTPUT_NAME:...> in $<TARGET_*_FILE_BASE_NAME:...>
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !3228
parents 3205561b 60ec2922
......@@ -387,14 +387,25 @@ Target-Dependent Queries
``$<TARGET_NAME_IF_EXISTS:tgt>``
Expands to the ``tgt`` if the given target exists, an empty string
otherwise.
``$<TARGET_OUTPUT_NAME:tgt>``
``$<TARGET_FILE:tgt>``
Full path to main file (.exe, .so.1.2, .a) where ``tgt`` is the name of a
target.
``$<TARGET_FILE_BASE_NAME:tgt>``
Base name of main file where ``tgt`` is the name of a target.
The base name corresponds to the target file name (see
``$<TARGET_FILE_NAME:tgt>``) without prefix and suffix. For example, if
target file name is ``libbase.so``, the base name is ``base``.
See also the :prop_tgt:`OUTPUT_NAME`, :prop_tgt:`ARCHIVE_OUTPUT_NAME`,
:prop_tgt:`LIBRARY_OUTPUT_NAME` and :prop_tgt:`RUNTIME_OUTPUT_NAME`
target properties and their configuration specific variants
:prop_tgt:`OUTPUT_NAME_<CONFIG>`, :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>`,
:prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>` and
:prop_tgt:`RUNTIME_OUTPUT_NAME_<CONFIG>`.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
``$<TARGET_FILE:tgt>``
Full path to main file (.exe, .so.1.2, .a) where ``tgt`` is the name of a
target.
``$<TARGET_FILE_PREFIX:tgt>``
Prefix of main file where ``tgt`` is the name of a target.
......@@ -409,13 +420,23 @@ Target-Dependent Queries
Name of main file (.exe, .so.1.2, .a).
``$<TARGET_FILE_DIR:tgt>``
Directory of main file (.exe, .so.1.2, .a).
``$<TARGET_LINKER_OUTPUT_NAME:tgt>``
``$<TARGET_LINKER_FILE:tgt>``
File used to link (.a, .lib, .so) where ``tgt`` is the name of a target.
``$<TARGET_LINKER_FILE_BASE_NAME:tgt>``
Base name of file used to link where ``tgt`` is the name of a target.
The base name corresponds to the target linker file name (see
``$<TARGET_LINKER_FILE_NAME:tgt>``) without prefix and suffix. For example,
if target file name is ``libbase.a``, the base name is ``base``.
See also the :prop_tgt:`OUTPUT_NAME`, :prop_tgt:`ARCHIVE_OUTPUT_NAME`,
and :prop_tgt:`LIBRARY_OUTPUT_NAME` target properties and their configuration
specific variants :prop_tgt:`OUTPUT_NAME_<CONFIG>`,
:prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>` and
:prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>`.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
``$<TARGET_LINKER_FILE:tgt>``
File used to link (.a, .lib, .so) where ``tgt`` is the name of a target.
``$<TARGET_LINKER_FILE_PREFIX:tgt>``
Prefix of file used to link where ``tgt`` is the name of a target.
......@@ -436,22 +457,26 @@ Target-Dependent Queries
Name of file with soname (.so.3).
``$<TARGET_SONAME_FILE_DIR:tgt>``
Directory of with soname (.so.3).
``$<TARGET_PDB_OUTPUT_NAME:tgt>``
``$<TARGET_PDB_FILE:tgt>``
Full path to the linker generated program database file (.pdb)
where ``tgt`` is the name of a target.
See also the :prop_tgt:`PDB_NAME` and :prop_tgt:`PDB_OUTPUT_DIRECTORY`
target properties and their configuration specific variants
:prop_tgt:`PDB_NAME_<CONFIG>` and :prop_tgt:`PDB_OUTPUT_DIRECTORY_<CONFIG>`.
``$<TARGET_PDB_FILE_BASE_NAME:tgt>``
Base name of the linker generated program database file (.pdb)
where ``tgt`` is the name of a target.
The base name corresponds to the target PDB file name (see
``$<TARGET_PDB_FILE_NAME:tgt>``) without prefix and suffix. For example,
if target file name is ``base.pdb``, the base name is ``base``.
See also the :prop_tgt:`PDB_NAME` target property and its configuration
specific variant :prop_tgt:`PDB_NAME_<CONFIG>`.
Note that ``tgt`` is not added as a dependency of the target this
expression is evaluated on.
``$<TARGET_PDB_FILE:tgt>``
Full path to the linker generated program database file (.pdb)
where ``tgt`` is the name of a target.
See also the :prop_tgt:`PDB_NAME` and :prop_tgt:`PDB_OUTPUT_DIRECTORY`
target properties and their configuration specific variants
:prop_tgt:`PDB_NAME_<CONFIG>` and :prop_tgt:`PDB_OUTPUT_DIRECTORY_<CONFIG>`.
``$<TARGET_PDB_FILE_NAME:tgt>``
Name of the linker generated program database file (.pdb).
``$<TARGET_PDB_FILE_DIR:tgt>``
......
genex-TARGET_OUTPUT_NAME
------------------------
genex-TARGET_FILE_BASE_NAME
---------------------------
* New ``$<TARGET_OUTPUT_NAME:...>``, ``$<TARGET_LINKER_OUTPUT_NAME:...>`` and
``$<TARGET_PDB_OUTPUT_NAME:...>``
* New ``$<TARGET_FILE_BASE_NAME:...>``, ``$<TARGET_LINKER_FILE_BASE_NAME:...>``
and ``$<TARGET_PDB_FILE_BASE_NAME:...>``
:manual:`generator expressions <cmake-generator-expressions(7)>` have been
added to retrieve the base name of various artifacts.
......@@ -2210,8 +2210,8 @@ struct TargetOutputNameArtifactResultGetter<ArtifactLinkerTag>
// The file used to link to the target (.so, .lib, .a).
if (!target->IsLinkable()) {
::reportError(context, content->GetOriginalExpression(),
"TARGET_LINKER_OUTPUT_NAME is allowed only for libraries "
"and executables with ENABLE_EXPORTS.");
"TARGET_LINKER_FILE_BASE_NAME is allowed only for "
"libraries and executables with ENABLE_EXPORTS.");
return std::string();
}
cmStateEnums::ArtifactType artifact =
......@@ -2232,7 +2232,7 @@ struct TargetOutputNameArtifactResultGetter<ArtifactPdbTag>
if (target->IsImported()) {
::reportError(
context, content->GetOriginalExpression(),
"TARGET_PDB_OUTPUT_NAME not allowed for IMPORTED targets.");
"TARGET_PDB_FILE_BASE_NAME not allowed for IMPORTED targets.");
return std::string();
}
......@@ -2243,7 +2243,7 @@ struct TargetOutputNameArtifactResultGetter<ArtifactPdbTag>
if (!context->LG->GetMakefile()->IsOn(pdbSupportVar)) {
::reportError(
context, content->GetOriginalExpression(),
"TARGET_PDB_OUTPUT_NAME is not supported by the target linker.");
"TARGET_PDB_FILE_BASE_NAME is not supported by the target linker.");
return std::string();
}
......@@ -2253,7 +2253,7 @@ struct TargetOutputNameArtifactResultGetter<ArtifactPdbTag>
targetType != cmStateEnums::MODULE_LIBRARY &&
targetType != cmStateEnums::EXECUTABLE) {
::reportError(context, content->GetOriginalExpression(),
"TARGET_PDB_OUTPUT_NAME is allowed only for "
"TARGET_PDB_FILE_BASE_NAME is allowed only for "
"targets with linker created artifacts.");
return std::string();
}
......@@ -2263,9 +2263,9 @@ struct TargetOutputNameArtifactResultGetter<ArtifactPdbTag>
};
template <typename ArtifactT>
struct TargetOutputNameArtifact : public TargetArtifactBase
struct TargetFileBaseNameArtifact : public TargetArtifactBase
{
TargetOutputNameArtifact() {} // NOLINT(modernize-use-equals-default)
TargetFileBaseNameArtifact() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
......@@ -2290,12 +2290,12 @@ struct TargetOutputNameArtifact : public TargetArtifactBase
}
};
static const TargetOutputNameArtifact<ArtifactNameTag> targetOutputNameNode;
static const TargetOutputNameArtifact<ArtifactLinkerTag>
targetLinkerOutputNameNode;
static const TargetOutputNameArtifact<ArtifactPdbTag> targetPdbOutputNameNode;
static const TargetFileBaseNameArtifact<ArtifactNameTag>
targetFileBaseNameNode;
static const TargetFileBaseNameArtifact<ArtifactLinkerTag>
targetLinkerFileBaseNameNode;
static const TargetFileBaseNameArtifact<ArtifactPdbTag>
targetPdbFileBaseNameNode;
class ArtifactFilePrefixTag;
class ArtifactLinkerFilePrefixTag;
......@@ -2474,6 +2474,9 @@ const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode(
{ "TARGET_LINKER_FILE", &targetLinkerNodeGroup.File },
{ "TARGET_SONAME_FILE", &targetSoNameNodeGroup.File },
{ "TARGET_PDB_FILE", &targetPdbNodeGroup.File },
{ "TARGET_FILE_BASE_NAME", &targetFileBaseNameNode },
{ "TARGET_LINKER_FILE_BASE_NAME", &targetLinkerFileBaseNameNode },
{ "TARGET_PDB_FILE_BASE_NAME", &targetPdbFileBaseNameNode },
{ "TARGET_FILE_PREFIX", &targetFilePrefixNode },
{ "TARGET_LINKER_FILE_PREFIX", &targetLinkerFilePrefixNode },
{ "TARGET_FILE_SUFFIX", &targetFileSuffixNode },
......@@ -2488,9 +2491,6 @@ const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode(
{ "TARGET_PDB_FILE_DIR", &targetPdbNodeGroup.FileDir },
{ "TARGET_BUNDLE_DIR", &targetBundleDirNode },
{ "TARGET_BUNDLE_CONTENT_DIR", &targetBundleContentDirNode },
{ "TARGET_OUTPUT_NAME", &targetOutputNameNode },
{ "TARGET_LINKER_OUTPUT_NAME", &targetLinkerOutputNameNode },
{ "TARGET_PDB_OUTPUT_NAME", &targetPdbOutputNameNode },
{ "STREQUAL", &strEqualNode },
{ "EQUAL", &equalNode },
{ "IN_LIST", &inListNode },
......
CMake Error at ImportedTarget-TARGET_PDB_OUTPUT_NAME.cmake:2 \(add_custom_target\):
CMake Error at ImportedTarget-TARGET_PDB_FILE_BASE_NAME.cmake:2 \(add_custom_target\):
Error evaluating generator expression:
\$<TARGET_PDB_OUTPUT_NAME:empty>
\$<TARGET_PDB_FILE_BASE_NAME:empty>
TARGET_PDB_OUTPUT_NAME not allowed for IMPORTED targets.
TARGET_PDB_FILE_BASE_NAME not allowed for IMPORTED targets.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
add_library(empty UNKNOWN IMPORTED)
add_custom_target(custom COMMAND echo $<TARGET_PDB_OUTPUT_NAME:empty>)
add_custom_target(custom COMMAND echo $<TARGET_PDB_FILE_BASE_NAME:empty>)
CMake Error at NonValidCompiler-TARGET_PDB_OUTPUT_NAME.cmake:6 \(file\):
CMake Error at NonValidCompiler-TARGET_PDB_FILE_BASE_NAME.cmake:6 \(file\):
Error evaluating generator expression:
\$<TARGET_PDB_OUTPUT_NAME:empty>
\$<TARGET_PDB_FILE_BASE_NAME:empty>
TARGET_PDB_OUTPUT_NAME is not supported by the target linker.
TARGET_PDB_FILE_BASE_NAME is not supported by the target linker.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
......@@ -5,5 +5,5 @@ add_library(empty STATIC empty.c)
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt"
CONTENT "[$<TARGET_PDB_OUTPUT_NAME:empty>]"
CONTENT "[$<TARGET_PDB_FILE_BASE_NAME:empty>]"
)
CMake Error at NonValidTarget-TARGET_PDB_OUTPUT_NAME.cmake:6 \(file\):
CMake Error at NonValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake:6 \(file\):
Error evaluating generator expression:
\$<TARGET_PDB_OUTPUT_NAME:empty>
\$<TARGET_PDB_FILE_BASE_NAME:empty>
TARGET_PDB_OUTPUT_NAME is allowed only for targets with linker created
TARGET_PDB_FILE_BASE_NAME is allowed only for targets with linker created
artifacts.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
......@@ -5,5 +5,5 @@ add_library(empty STATIC empty.c)
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt"
CONTENT "[$<TARGET_PDB_OUTPUT_NAME:empty>]"
CONTENT "[$<TARGET_PDB_FILE_BASE_NAME:empty>]"
)
......@@ -3,4 +3,4 @@ add_executable(empty1 empty.c)
set_property(TARGET empty1 PROPERTY OUTPUT_NAME $<TARGET_FILE_NAME:empty1>)
add_executable(empty2 empty.c)
set_property(TARGET empty2 PROPERTY OUTPUT_NAME $<TARGET_OUTPUT_NAME:empty2>)
set_property(TARGET empty2 PROPERTY OUTPUT_NAME $<TARGET_FILE_BASE_NAME:empty2>)
......@@ -41,10 +41,10 @@ run_cmake(TARGET_FILE_SUFFIX)
run_cmake(TARGET_FILE_SUFFIX-imported-target)
run_cmake(TARGET_FILE_SUFFIX-non-valid-target)
run_cmake(TARGET_LINKER_FILE_SUFFIX-non-valid-target)
run_cmake(TARGET_OUTPUT_NAME)
run_cmake(TARGET_OUTPUT_NAME-imported-target)
run_cmake(TARGET_OUTPUT_NAME-non-valid-target)
run_cmake(TARGET_LINKER_OUTPUT_NAME-non-valid-target)
run_cmake(TARGET_FILE_BASE_NAME)
run_cmake(TARGET_FILE_BASE_NAME-imported-target)
run_cmake(TARGET_FILE_BASE_NAME-non-valid-target)
run_cmake(TARGET_LINKER_FILE_BASE_NAME-non-valid-target)
run_cmake(TARGET_PROPERTY-LOCATION)
run_cmake(TARGET_PROPERTY-SOURCES)
run_cmake(LINK_ONLY-not-linking)
......@@ -78,15 +78,15 @@ run_cmake(FILTER-Include)
run_cmake(ImportedTarget-TARGET_BUNDLE_DIR)
run_cmake(ImportedTarget-TARGET_BUNDLE_CONTENT_DIR)
run_cmake(ImportedTarget-TARGET_PDB_FILE)
run_cmake(ImportedTarget-TARGET_PDB_OUTPUT_NAME)
run_cmake(ImportedTarget-TARGET_PDB_FILE_BASE_NAME)
if(LINKER_SUPPORTS_PDB)
run_cmake(NonValidTarget-TARGET_PDB_FILE)
run_cmake(ValidTarget-TARGET_PDB_FILE)
run_cmake(NonValidTarget-TARGET_PDB_OUTPUT_NAME)
run_cmake(ValidTarget-TARGET_PDB_OUTPUT_NAME)
run_cmake(NonValidTarget-TARGET_PDB_FILE_BASE_NAME)
run_cmake(ValidTarget-TARGET_PDB_FILE_BASE_NAME)
else()
run_cmake(NonValidCompiler-TARGET_PDB_FILE)
run_cmake(NonValidCompiler-TARGET_PDB_OUTPUT_NAME)
run_cmake(NonValidCompiler-TARGET_PDB_FILE_BASE_NAME)
endif()
set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0085:STRING=OLD)
......
include ("${RunCMake_TEST_BINARY_DIR}/TARGET_FILE_BASE_NAME-generated.cmake")
include ("${RunCMake_TEST_BINARY_DIR}/TARGET_FILE_BASE_NAME-generated.cmake")
......@@ -17,11 +17,11 @@ add_library (static1 STATIC IMPORTED)
string (APPEND GENERATE_CONTENT [[
check_value ("TARGET_OUTPUT_NAME executable default" "$<TARGET_OUTPUT_NAME:exec1>" "exec1")
check_value ("TARGET_OUTPUT_NAME shared default" "$<TARGET_OUTPUT_NAME:shared1>" "shared1")
check_value ("TARGET_LINKER_OUTPUT_NAME shared linker default" "$<TARGET_LINKER_OUTPUT_NAME:shared1>" "shared1")
check_value ("TARGET_OUTPUT_NAME static default" "$<TARGET_OUTPUT_NAME:static1>" "static1")
check_value ("TARGET_LINKER_OUTPUT_NAME static linker default" "$<TARGET_LINKER_OUTPUT_NAME:static1>" "static1")
check_value ("TARGET_FILE_BASE_NAME executable default" "$<TARGET_FILE_BASE_NAME:exec1>" "exec1")
check_value ("TARGET_FILE_BASE_NAME shared default" "$<TARGET_FILE_BASE_NAME:shared1>" "shared1")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker default" "$<TARGET_LINKER_FILE_BASE_NAME:shared1>" "shared1")
check_value ("TARGET_FILE_BASE_NAME static default" "$<TARGET_FILE_BASE_NAME:static1>" "static1")
check_value ("TARGET_LINKER_FILE_BASE_NAME static linker default" "$<TARGET_LINKER_FILE_BASE_NAME:static1>" "static1")
]])
......@@ -34,11 +34,11 @@ set_property (TARGET static2 PROPERTY OUTPUT_NAME static2_custom)
string (APPEND GENERATE_CONTENT [[
check_value ("TARGET_OUTPUT_NAME executable custom" "$<TARGET_OUTPUT_NAME:exec2>" "exec2_custom")
check_value ("TARGET_OUTPUT_NAME shared custom" "$<TARGET_OUTPUT_NAME:shared2>" "shared2_custom")
check_value ("TARGET_LINKER_OUTPUT_NAME shared linker custom" "$<TARGET_LINKER_OUTPUT_NAME:shared2>" "shared2_custom")
check_value ("TARGET_OUTPUT_NAME static custom" "$<TARGET_OUTPUT_NAME:static2>" "static2_custom")
check_value ("TARGET_LINKER_OUTPUT_NAME static linker custom" "$<TARGET_LINKER_OUTPUT_NAME:static2>" "static2_custom")
check_value ("TARGET_FILE_BASE_NAME executable custom" "$<TARGET_FILE_BASE_NAME:exec2>" "exec2_custom")
check_value ("TARGET_FILE_BASE_NAME shared custom" "$<TARGET_FILE_BASE_NAME:shared2>" "shared2_custom")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker custom" "$<TARGET_LINKER_FILE_BASE_NAME:shared2>" "shared2_custom")
check_value ("TARGET_FILE_BASE_NAME static custom" "$<TARGET_FILE_BASE_NAME:static2>" "static2_custom")
check_value ("TARGET_LINKER_FILE_BASE_NAME static linker custom" "$<TARGET_LINKER_FILE_BASE_NAME:static2>" "static2_custom")
]])
......@@ -60,11 +60,11 @@ set_property (TARGET static3 PROPERTY PDB_NAME static3_pdb)
string (APPEND GENERATE_CONTENT [[
check_value ("TARGET_OUTPUT_NAME executable all properties" "$<TARGET_OUTPUT_NAME:exec3>" "exec3_runtime")
check_value ("TARGET_OUTPUT_NAME shared all properties" "$<TARGET_OUTPUT_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared3_runtime,shared3_library>")
check_value ("TARGET_LINKER_OUTPUT_NAME shared linker all properties" "$<TARGET_LINKER_OUTPUT_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared3_archive,shared3_library>")
check_value ("TARGET_OUTPUT_NAME static all properties" "$<TARGET_OUTPUT_NAME:static3>" "static3_archive")
check_value ("TARGET_LINKER_OUTPUT_NAME static linker all properties" "$<TARGET_LINKER_OUTPUT_NAME:static3>" "static3_archive")
check_value ("TARGET_FILE_BASE_NAME executable all properties" "$<TARGET_FILE_BASE_NAME:exec3>" "exec3_runtime")
check_value ("TARGET_FILE_BASE_NAME shared all properties" "$<TARGET_FILE_BASE_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared3_runtime,shared3_library>")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker all properties" "$<TARGET_LINKER_FILE_BASE_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared3_archive,shared3_library>")
check_value ("TARGET_FILE_BASE_NAME static all properties" "$<TARGET_FILE_BASE_NAME:static3>" "static3_archive")
check_value ("TARGET_LINKER_FILE_BASE_NAME static linker all properties" "$<TARGET_LINKER_FILE_BASE_NAME:static3>" "static3_archive")
]])
......@@ -75,5 +75,5 @@ if(_isMultiConfig)
set(GENERATE_CONDITION CONDITION $<CONFIG:${FIRST_CONFIG}>)
endif()
file (GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/TARGET_OUTPUT_NAME-generated.cmake"
file (GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/TARGET_FILE_BASE_NAME-generated.cmake"
CONTENT "${GENERATE_CONTENT}" ${GENERATE_CONDITION})
CMake Error at TARGET_OUTPUT_NAME-non-valid-target.cmake:[0-9]+ \(file\):
CMake Error at TARGET_FILE_BASE_NAME-non-valid-target.cmake:[0-9]+ \(file\):
Error evaluating generator expression:
\$<TARGET_OUTPUT_NAME:empty>
\$<TARGET_FILE_BASE_NAME:empty>
Target "empty" is not an executable or library\.
......@@ -3,5 +3,5 @@ add_custom_target(empty)
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt"
CONTENT "[$<TARGET_OUTPUT_NAME:empty>]"
CONTENT "[$<TARGET_FILE_BASE_NAME:empty>]"
)
......@@ -17,16 +17,16 @@ add_library (static1 STATIC empty.c)
string (APPEND GENERATE_CONTENT [[
check_value ("TARGET_OUTPUT_NAME executable default" "$<TARGET_OUTPUT_NAME:exec1>" "exec1")
check_value ("TARGET_OUTPUT_NAME shared default" "$<TARGET_OUTPUT_NAME:shared1>" "shared1")
check_value ("TARGET_LINKER_OUTPUT_NAME shared linker default" "$<TARGET_LINKER_OUTPUT_NAME:shared1>" "shared1")
check_value ("TARGET_OUTPUT_NAME static default" "$<TARGET_OUTPUT_NAME:static1>" "static1")
check_value ("TARGET_LINKER_OUTPUT_NAME static linker default" "$<TARGET_LINKER_OUTPUT_NAME:static1>" "static1")
check_value ("TARGET_FILE_BASE_NAME executable default" "$<TARGET_FILE_BASE_NAME:exec1>" "exec1")
check_value ("TARGET_FILE_BASE_NAME shared default" "$<TARGET_FILE_BASE_NAME:shared1>" "shared1")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker default" "$<TARGET_LINKER_FILE_BASE_NAME:shared1>" "shared1")
check_value ("TARGET_FILE_BASE_NAME static default" "$<TARGET_FILE_BASE_NAME:static1>" "static1")
check_value ("TARGET_LINKER_FILE_BASE_NAME static linker default" "$<TARGET_LINKER_FILE_BASE_NAME:static1>" "static1")
]])
if (CMAKE_C_LINKER_SUPPORTS_PDB)
string(APPEND GENERATE_CONTENT [[
check_value ("TARGET_PDB_OUTPUT_NAME executable PDB default" "$<TARGET_PDB_OUTPUT_NAME:exec1>" "exec1")
check_value ("TARGET_PDB_OUTPUT_NAME shared PDB default" "$<TARGET_PDB_OUTPUT_NAME:shared1>" "shared1")
check_value ("TARGET_PDB_FILE_BASE_NAME executable PDB default" "$<TARGET_PDB_FILE_BASE_NAME:exec1>" "exec1")
check_value ("TARGET_PDB_FILE_BASE_NAME shared PDB default" "$<TARGET_PDB_FILE_BASE_NAME:shared1>" "shared1")
]])
endif()
......@@ -40,16 +40,16 @@ set_property (TARGET static2 PROPERTY OUTPUT_NAME static2_custom)
string (APPEND GENERATE_CONTENT [[
check_value ("TARGET_OUTPUT_NAME executable custom" "$<TARGET_OUTPUT_NAME:exec2>" "exec2_custom")
check_value ("TARGET_OUTPUT_NAME shared custom" "$<TARGET_OUTPUT_NAME:shared2>" "shared2_custom")
check_value ("TARGET_LINKER_OUTPUT_NAME shared linker custom" "$<TARGET_LINKER_OUTPUT_NAME:shared2>" "shared2_custom")
check_value ("TARGET_OUTPUT_NAME static custom" "$<TARGET_OUTPUT_NAME:static2>" "static2_custom")
check_value ("TARGET_LINKER_OUTPUT_NAME static linker custom" "$<TARGET_LINKER_OUTPUT_NAME:static2>" "static2_custom")
check_value ("TARGET_FILE_BASE_NAME executable custom" "$<TARGET_FILE_BASE_NAME:exec2>" "exec2_custom")
check_value ("TARGET_FILE_BASE_NAME shared custom" "$<TARGET_FILE_BASE_NAME:shared2>" "shared2_custom")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker custom" "$<TARGET_LINKER_FILE_BASE_NAME:shared2>" "shared2_custom")
check_value ("TARGET_FILE_BASE_NAME static custom" "$<TARGET_FILE_BASE_NAME:static2>" "static2_custom")
check_value ("TARGET_LINKER_FILE_BASE_NAME static linker custom" "$<TARGET_LINKER_FILE_BASE_NAME:static2>" "static2_custom")
]])
if (CMAKE_C_LINKER_SUPPORTS_PDB)
string (APPEND GENERATE_CONTENT [[
check_value ("TARGET_PDB_OUTPUT_NAME executable PDB custom" "$<TARGET_PDB_OUTPUT_NAME:exec2>" "exec2_custom")
check_value ("TARGET_PDB_OUTPUT_NAME shared PDB custom" "$<TARGET_PDB_OUTPUT_NAME:shared2>" "shared2_custom")
check_value ("TARGET_PDB_FILE_BASE_NAME executable PDB custom" "$<TARGET_PDB_FILE_BASE_NAME:exec2>" "exec2_custom")
check_value ("TARGET_PDB_FILE_BASE_NAME shared PDB custom" "$<TARGET_PDB_FILE_BASE_NAME:shared2>" "shared2_custom")
]])
endif()
......@@ -71,16 +71,16 @@ set_property (TARGET static3 PROPERTY PDB_NAME static3_pdb)
string (APPEND GENERATE_CONTENT [[
check_value ("TARGET_OUTPUT_NAME executable all properties" "$<TARGET_OUTPUT_NAME:exec3>" "exec3_runtime")
check_value ("TARGET_OUTPUT_NAME shared all properties" "$<TARGET_OUTPUT_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared3_runtime,shared3_library>")
check_value ("TARGET_LINKER_OUTPUT_NAME shared linker all properties" "$<TARGET_LINKER_OUTPUT_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared3_archive,shared3_library>")
check_value ("TARGET_OUTPUT_NAME static all properties" "$<TARGET_OUTPUT_NAME:static3>" "static3_archive")
check_value ("TARGET_LINKER_OUTPUT_NAME static linker all properties" "$<TARGET_LINKER_OUTPUT_NAME:static3>" "static3_archive")
check_value ("TARGET_FILE_BASE_NAME executable all properties" "$<TARGET_FILE_BASE_NAME:exec3>" "exec3_runtime")
check_value ("TARGET_FILE_BASE_NAME shared all properties" "$<TARGET_FILE_BASE_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared3_runtime,shared3_library>")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker all properties" "$<TARGET_LINKER_FILE_BASE_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared3_archive,shared3_library>")
check_value ("TARGET_FILE_BASE_NAME static all properties" "$<TARGET_FILE_BASE_NAME:static3>" "static3_archive")
check_value ("TARGET_LINKER_FILE_BASE_NAME static linker all properties" "$<TARGET_LINKER_FILE_BASE_NAME:static3>" "static3_archive")
]])
if (CMAKE_C_LINKER_SUPPORTS_PDB)
string (APPEND GENERATE_CONTENT [[
check_value ("TARGET_PDB_OUTPUT_NAME executable PDB all properties" "$<TARGET_PDB_OUTPUT_NAME:exec3>" "exec3_pdb")
check_value ("TARGET_PDB_OUTPUT_NAME shared PDB all properties" "$<TARGET_PDB_OUTPUT_NAME:shared3>" "shared3_pdb")
check_value ("TARGET_PDB_FILE_BASE_NAME executable PDB all properties" "$<TARGET_PDB_FILE_BASE_NAME:exec3>" "exec3_pdb")
check_value ("TARGET_PDB_FILE_BASE_NAME shared PDB all properties" "$<TARGET_PDB_FILE_BASE_NAME:shared3>" "shared3_pdb")
]])
endif()
......@@ -92,5 +92,5 @@ if(_isMultiConfig)
set(GENERATE_CONDITION CONDITION $<CONFIG:${FIRST_CONFIG}>)
endif()
file (GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/TARGET_OUTPUT_NAME-generated.cmake"
file (GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/TARGET_FILE_BASE_NAME-generated.cmake"
CONTENT "${GENERATE_CONTENT}" ${GENERATE_CONDITION})
CMake Error at TARGET_LINKER_OUTPUT_NAME-non-valid-target.cmake:[0-9]+ \(file\):
CMake Error at TARGET_LINKER_FILE_BASE_NAME-non-valid-target.cmake:[0-9]+ \(file\):
Error evaluating generator expression:
\$<TARGET_LINKER_OUTPUT_NAME:empty>
\$<TARGET_LINKER_FILE_BASE_NAME:empty>
Target "empty" is not an executable or library\.
......@@ -3,5 +3,5 @@ add_custom_target(empty)
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt"
CONTENT "[$<TARGET_LINKER_OUTPUT_NAME:empty>]"
CONTENT "[$<TARGET_LINKER_FILE_BASE_NAME:empty>]"
)
include ("${RunCMake_TEST_BINARY_DIR}/TARGET_OUTPUT_NAME-generated.cmake")
include ("${RunCMake_TEST_BINARY_DIR}/TARGET_OUTPUT_NAME-generated.cmake")
file(STRINGS ${RunCMake_TEST_BINARY_DIR}/test.txt TEST_TXT ENCODING UTF-8)
list(GET TEST_TXT 0 PDB_OUTPUT_NAME)
list(GET TEST_TXT 0 PDB_FILE_BASE_NAME)
if(NOT PDB_OUTPUT_NAME MATCHES "empty")
set(RunCMake_TEST_FAILED "unexpected PDB_OUTPUT_NAME [${PDB_OUTPUT_NAME}]")
if(NOT PDB_FILE_BASE_NAME MATCHES "empty")
set(RunCMake_TEST_FAILED "unexpected PDB_FILE_BASE_NAME [${PDB_FILE_BASE_NAME}]")
endif()
......@@ -11,6 +11,6 @@ endif()
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt"
CONTENT "$<TARGET_PDB_OUTPUT_NAME:empty>"
CONTENT "$<TARGET_PDB_FILE_BASE_NAME:empty>"
${GENERATE_CONDITION}
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment