From c27f5da1b789aa8aaf952d74e0562db50691b23a Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 6 Oct 2017 14:29:54 +0200 Subject: Avoid getting LOCATION property It's not supported in newer CMake, so try to deduce the library filename from the target name. --- cmake/Modules/CMakeMacroLibtoolFile.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/CMakeMacroLibtoolFile.cmake b/cmake/Modules/CMakeMacroLibtoolFile.cmake index c882c4ad..1a3ab7cc 100644 --- a/cmake/Modules/CMakeMacroLibtoolFile.cmake +++ b/cmake/Modules/CMakeMacroLibtoolFile.cmake @@ -1,5 +1,4 @@ macro(libtool_create_control_file _target) - get_target_property(_target_location ${_target} LOCATION) get_target_property(_target_type ${_target} TYPE) message("-- Creating static libtool control file for target ${_target}") @@ -113,7 +112,7 @@ macro(libtool_create_control_file _target) endforeach() # Write the libtool control file for the static library - get_filename_component(_lname ${_target_location} NAME_WE) + set(_lname ${CMAKE_STATIC_LIBRARY_PREFIX}${_target}) set(_laname ${CMAKE_CURRENT_BINARY_DIR}/${_lname}.la) file(WRITE ${_laname} "# ${_lname}.la - a libtool library file\n# Generated by ltmain.sh (GNU libtool) 2.2.6b\n") @@ -142,6 +141,6 @@ macro(libtool_create_control_file _target) add_custom_command(TARGET ${_target} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/.libs") add_custom_command(TARGET ${_target} POST_BUILD COMMAND - "${CMAKE_COMMAND}" -E create_symlink ${_target_location} "${CMAKE_CURRENT_BINARY_DIR}/.libs/${_lname}${CMAKE_STATIC_LIBRARY_SUFFIX}") + "${CMAKE_COMMAND}" -E create_symlink ../${_lname}${CMAKE_STATIC_LIBRARY_SUFFIX} "${CMAKE_CURRENT_BINARY_DIR}/.libs/${_lname}${CMAKE_STATIC_LIBRARY_SUFFIX}") endmacro() -- cgit v1.2.3