
SET(HEADERS "")
SET(SOURCES "")

IF (TPL_ENABLE_MPI)
ASSERT_DEFINED(${PROJECT_NAME}_ENABLE_Zoltan)
IF (NOT ${PROJECT_NAME}_ENABLE_Zoltan)
  ADD_DEFINITIONS(-DNO_ZOLTAN_SUPPORT)
ENDIF()

IF (${PROJECT_NAME}_ENABLE_ParMETIS)
ELSE()
  ADD_DEFINITIONS(-DNO_PARMETIS_SUPPORT)
ENDIF()
ENDIF()

SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR})
APPEND_GLOB(HEADERS ${DIR}/*.h)
APPEND_GLOB(SOURCES ${DIR}/*.C)

IF (NOT TPL_ENABLE_MPI)
  LIST(REMOVE_ITEM SOURCES ${DIR}/Iocgns_ParallelDatabaseIO.C ${DIR}/Iocgns_DecompositionData.C)
  LIST(REMOVE_ITEM HEADERS ${DIR}/Iocgns_ParallelDatabaseIO.h ${DIR}/Iocgns_DecompositionData.h)
ENDIF()

INCLUDE_DIRECTORIES(
  "${CMAKE_CURRENT_SOURCE_DIR}/../"
  "${CMAKE_CURRENT_BINARY_DIR}/../"
)

TRIBITS_ADD_LIBRARY(
	Iocgns
	HEADERS	${HEADERS}
	SOURCES ${SOURCES}
	DEPLIBS Ioss
)

IF (BUILD_TESTING)
  ENABLE_TESTING()
ENDIF()
