-#The following is not working because when a header file is not found it tries
-#to find one in the binary dir
-#INSTALL_FILES(/include .h ${libgdcm_la_SOURCES})
-INSTALL_FILES(/include "\\.h$")
+# Need nsl to resolve gethostbyname on SunOS-5.8
+# and socket also
+IF(CMAKE_SYSTEM MATCHES "SunOS.*")
+ TARGET_LINK_LIBRARIES(gdcm socket nsl)
+ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")
+
+IF(NOT GDCM_INSTALL_NO_DEVELOPMENT)
+ # Install header file used to construct the lib
+ #INSTALL_FILES(
+ # ${GDCM_INSTALL_INCLUDE_DIR} .h ${GDCM_SOURCES})
+ INSTALL_FILES(${GDCM_INSTALL_INCLUDE_DIR} "\\.h$")
+ENDIF(NOT GDCM_INSTALL_NO_DEVELOPMENT)
+
+IF(NOT GDCM_INSTALL_NO_LIBRARIES)
+ #Install the target itself
+ INSTALL_TARGETS(
+ ${GDCM_INSTALL_LIB_DIR}
+ RUNTIME_DIRECTORY ${GDCM_INSTALL_BIN_DIR}
+ ${GDCM_LIBRARIES})
+ENDIF(NOT GDCM_INSTALL_NO_LIBRARIES)