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}")
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")
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()