]> source.dussan.org Git - tigervnc.git/commitdiff
Avoid getting LOCATION property
authorPierre Ossman <ossman@cendio.se>
Fri, 6 Oct 2017 12:29:54 +0000 (14:29 +0200)
committerPierre Ossman <ossman@cendio.se>
Fri, 6 Oct 2017 12:56:22 +0000 (14:56 +0200)
It's not supported in newer CMake, so try to deduce the library
filename from the target name.

cmake/Modules/CMakeMacroLibtoolFile.cmake

index c882c4ad90295ebb90ec6579408938c8f80a0dff..1a3ab7cc2c97f0502b114eb062dab7b38b6cf035 100644 (file)
@@ -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()