Suggested patch for building on Mac

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
nikkoara
Posts: 18
Joined: Wed, 2014-02-19, 14:31

Suggested patch for building on Mac

#1 Post by nikkoara » Tue, 2015-08-04, 16:08

libnsl is not present on Mac and most (all?) of its API is in libc. The following only links libnsl for platforms other than APPLE:

Code: Select all

$ git diff
diff --git a/CMake/FindWrap.cmake b/CMake/FindWrap.cmake
index 1567724..9dc3430 100644
--- a/CMake/FindWrap.cmake
+++ b/CMake/FindWrap.cmake
@@ -21,7 +21,10 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(WRAP REQUIRED_VARS WRAP_LIBRARY WRAP_INCLUDE_D
 
 # Copy the result to output variables
 IF(WRAP_FOUND)
-  SET(WRAP_LIBRARIES ${WRAP_LIBRARY} nsl)
+  SET(WRAP_LIBRARIES ${WRAP_LIBRARY})
+  IF(NOT APPLE)
+    LIST(APPEND WRAP_LIBRARIES nsl)
+  ENDIF(NOT APPLE)
   SET(WRAP_INCLUDE_DIRS ${WRAP_INCLUDE_DIR})
 ELSE(WRAP_FOUND)
   SET(WRAP_LIBS)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest