[trunk] Add option to call dsymutil on built binaries (fixes issue 409)
authorAntonin Descampe <antonin@gmail.com>
Wed, 15 Oct 2014 10:24:49 +0000 (10:24 +0000)
committerAntonin Descampe <antonin@gmail.com>
Wed, 15 Oct 2014 10:24:49 +0000 (10:24 +0000)
CMakeLists.txt
src/bin/jp2/CMakeLists.txt
src/lib/openjp2/CMakeLists.txt

index 5f83362b7da6b44fe9e87be75c17b6955506a48c..7859b6dcd45bc9a57015a1f4969725374fe39d79 100644 (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()
 
 #-----------------------------------------------------------------------------
index 1c2ef39cebf99259f025663fd6d39f4df013d2ae..a353a8f8fb6eeef841cb9e8492d5bdf4957b10b8 100644 (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)
index fcf60ecf01b77bd1f6aafc0f7aa654252ba2b4fe..ca59c113148de3bd1c9fe5ef69051c344daaa660 100644 (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()