[trunk] Add option to call dsymutil on built binaries (fixes issue 409)

This commit is contained in:
Antonin Descampe 2014-10-15 10:24:49 +00:00
parent f8796711e8
commit 984351f86f
3 changed files with 18 additions and 0 deletions

View File

@ -148,6 +148,7 @@ endif()
if (APPLE)
list(APPEND OPENJPEG_LIBRARY_PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${OPENJPEG_INSTALL_LIB_DIR}")
option(OPJ_USE_DSYMUTIL "Call dsymutil on binaries after build." OFF)
endif()
#-----------------------------------------------------------------------------

View File

@ -50,6 +50,13 @@ foreach(exe opj_decompress opj_compress opj_dump)
EXPORT OpenJPEGTargets
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
)
if(OPJ_USE_DSYMUTIL)
GET_TARGET_PROPERTY(EXE_LOCATION ${exe} LOCATION)
add_custom_command(TARGET ${exe} POST_BUILD
COMMAND "dsymutil" "${EXE_LOCATION}"
COMMENT "dsymutil ${EXE_LOCATION}"
DEPENDS ${exe})
endif()
endforeach()
if(BUILD_DOC)

View File

@ -98,3 +98,13 @@ if(OPENJPEG_CPPCHECK)
COMMAND ${CPPCHECK_EXECUTABLE} -DWIN32 ${f})
endforeach()
endif()
if(OPJ_USE_DSYMUTIL)
if(BUILD_SHARED_LIBS)
GET_TARGET_PROPERTY(OPENJPEG_LIBRARY_LOCATION ${OPENJPEG_LIBRARY_NAME} LOCATION)
add_custom_command(TARGET ${OPENJPEG_LIBRARY_NAME} POST_BUILD
COMMAND "dsymutil" "${OPENJPEG_LIBRARY_LOCATION}"
COMMENT "dsymutil ${OPENJPEG_LIBRARY_LOCATION}"
DEPENDS ${OPENJPEG_LIBRARY_NAME})
endif()
endif()