From: malaterre Date: Tue, 11 Jan 2005 14:38:48 +0000 (+0000) Subject: BUG: Fix gdcm build on SunOS, where gethostname could not be resolved X-Git-Tag: Version1.0.bp~396 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=33efd98097d5ceaafeba83366c4183aeead0cf5b;p=gdcm.git BUG: Fix gdcm build on SunOS, where gethostname could not be resolved --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4a9e2d19..1ac3c5af 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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