find_package(PostgreSQL REQUIRED)

set(PostgreSQL_SRCS
  vtkPostgreSQLDatabase.cxx
  vtkPostgreSQLQuery.cxx
  vtkPostgreSQLToTableReader.cxx
  vtkTableToPostgreSQLWriter.cxx
  vtkIOPostgreSQL_AutoInit.cxx
  )

set_source_files_properties(vtkIOPostgreSQL_AutoInit WRAP_EXCLUDE)

include_directories(${PostgreSQL_INCLUDE_DIRS})

vtk_module_library(vtkIOPostgreSQL ${PostgreSQL_SRCS})

target_link_libraries(vtkIOPostgreSQL ${PostgreSQL_LIBRARY})

find_package(PostgreSQL REQUIRED)
mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_LIBRARY)

set(PostgreSQL_SRCS
  vtkPostgreSQLDatabase.cxx
  vtkPostgreSQLQuery.cxx
  vtkPostgreSQLToTableReader.cxx
  vtkTableToPostgreSQLWriter.cxx
  vtkIOPostgreSQL_AutoInit.cxx
  )

set_source_files_properties(vtkIOPostgreSQL_AutoInit WRAP_EXCLUDE)

include_directories(${PostgreSQL_INCLUDE_DIRS})

vtk_module_library(vtkIOPostgreSQL ${PostgreSQL_SRCS})

target_link_libraries(vtkIOPostgreSQL ${PostgreSQL_LIBRARY})

Mark PostgreSQL_(LIBRARY|INCLUDE_DIR) cache entries advanced
Mark PostgreSQL_(LIBRARY|INCLUDE_DIR) cache entries advanced

We already mark most CMake find-module cache entries as advanced.
This keeps the non-advanced cache cleaner.

Change-Id: If4d4c35bda057bf50beebcb034ec5e4941854e04
