1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

Merge topic 'depend-on-target-real-name'

08699cec68 add_custom_command: Fix dependency on macOS framework target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4273
This commit is contained in:
Brad King
2020-01-27 15:03:56 +00:00
committed by Kitware Robot
3 changed files with 14 additions and 1 deletions

View File

@@ -1969,7 +1969,8 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
case cmStateEnums::SHARED_LIBRARY:
case cmStateEnums::MODULE_LIBRARY:
case cmStateEnums::UNKNOWN_LIBRARY:
dep = target->GetLocation(config);
dep = target->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact,
/*realname=*/true);
return true;
case cmStateEnums::OBJECT_LIBRARY:
// An object library has no single file on which to depend.

View File

@@ -566,3 +566,11 @@ add_custom_command(
)
add_custom_target(depends_on_in_rel_source_path ALL DEPENDS "depends_on_in_rel_source_path.txt")
add_library(mac_fw SHARED mac_fw.c)
set_target_properties(mac_fw PROPERTIES
FRAMEWORK 1
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib
)
add_custom_command(OUTPUT mac_fw.txt COMMAND ${CMAKE_COMMAND} -E touch mac_fw.txt DEPENDS mac_fw)
add_custom_target(drive_mac_fw ALL DEPENDS mac_fw.txt)

View File

@@ -0,0 +1,4 @@
int mac_fw(void)
{
return 0;
}