
IF(UNIX)
  IF(RUN_CONFIGURE)
    EXEC_PROGRAM(
    "${ABINITDIR}/configure --prefix=${PROJECT_BINARY_DIR}"  ${ABINITDIR}
    )
    EXEC_PROGRAM(make ${ABINITDIR})
    EXEC_PROGRAM(make ${ABINITDIR} ARGS install)
    FIND_LIBRARY(ABINIT_LIBRARY abinit ${PROJECT_BINARY_DIR}/lib)
 ENDIF(RUN_CONFIGURE)
ENDIF(UNIX)

MARK_AS_ADVANCED(ABINIT_LIBRARY)

#EXEC_PROGRAM(rm ${ABINITDIR} ARGS -f Makefile libabinit.a)
#CONFIGURE_FILE(${ABINITDIR}/Makefile.in ${ABINITDIR}/Makefile)
#EXEC_PROGRAM(make ${ABINITDIR} ARGS -f Makefile)
#EXEC_PROGRAM(cp ${ABINITDIR} ARGS "libabinit.a ${LIBRARY_OUTPUT_PATH}/")
