]> Creatis software - gdcm.git/commitdiff
BUG: Fix gdcm build on SunOS, where gethostname could not be resolved
authormalaterre <malaterre>
Tue, 11 Jan 2005 14:38:48 +0000 (14:38 +0000)
committermalaterre <malaterre>
Tue, 11 Jan 2005 14:38:48 +0000 (14:38 +0000)
src/CMakeLists.txt

index 4a9e2d1972ff0eac6d6fa3a179349405fa6ea669..1ac3c5af559e139212ff5ba1f95469561bf19e51 100644 (file)
@@ -74,6 +74,12 @@ IF(APPLE)
   TARGET_LINK_LIBRARIES(gdcm "-framework IOKit" "-framework CoreFoundation")
 ENDIF(APPLE)
 
+# Need nsl to resolve gethostbyname on SunOS-5.8 CC
+IF(CMAKE_SYSTEM MATCHES "SunOS.*")
+  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
+    TARGET_LINK_LIBRARIES(gdcm nsl)
+  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
+ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")
 
 #The following is not working because when a header file is not found it tries 
 #to find one in the binary dir