#                                               -*- cmake -*-

# Register current directory files
ot_add_current_dir_to_include_dirs ()

ot_add_source_file ( Compact.cxx )
ot_add_source_file ( ConfidenceInterval.cxx )
ot_add_source_file ( CorrelationAnalysis.cxx )
ot_add_source_file ( CorrelationMatrix.cxx )
ot_add_source_file ( CovarianceMatrix.cxx )
ot_add_source_file ( CovarianceHMatrix.cxx )
ot_add_source_file ( FaureSequence.cxx )
ot_add_source_file ( Full.cxx )
ot_add_source_file ( HaltonSequence.cxx )
ot_add_source_file ( HaselgroveSequence.cxx )
ot_add_source_file ( HistoryStrategy.cxx )
ot_add_source_file ( HistoryStrategyImplementation.cxx )
ot_add_source_file ( Last.cxx )
ot_add_source_file ( LinearModel.cxx )
ot_add_source_file ( LinearModelFactory.cxx )
ot_add_source_file ( LowDiscrepancySequence.cxx )
ot_add_source_file ( LowDiscrepancySequenceImplementation.cxx )
ot_add_source_file ( Null.cxx )
ot_add_source_file ( NumericalSample.cxx )
ot_add_source_file ( NumericalSampleImplementation.cxx )
ot_add_source_file ( ProcessSample.cxx )
ot_add_source_file ( RandomGenerator.cxx )
ot_add_source_file ( RandomGeneratorState.cxx )
ot_add_source_file ( ReverseHaltonSequence.cxx )
ot_add_source_file ( SecondOrderModel.cxx )
ot_add_source_file ( SecondOrderModelImplementation.cxx )
ot_add_source_file ( SensitivityAnalysis.cxx )
ot_add_source_file ( SobolSequence.cxx )
ot_add_source_file ( TestResult.cxx )
ot_add_source_file ( Field.cxx )
ot_add_source_file ( FieldImplementation.cxx )
ot_add_source_file ( TimeSeries.cxx )
ot_add_source_file ( dsfmt.cxx )
ot_add_source_file ( ExponentialCauchy.cxx )
ot_add_source_file ( FilteringWindowsImplementation.cxx )
ot_add_source_file ( FilteringWindows.cxx )
ot_add_source_file ( Hamming.cxx )
ot_add_source_file ( Hanning.cxx )
ot_add_source_file ( CovarianceModelImplementation.cxx )
ot_add_source_file ( SpectralModelImplementation.cxx )
ot_add_source_file ( SpectralModel.cxx )
ot_add_source_file ( CovarianceModel.cxx )
ot_add_source_file ( StationaryCovarianceModel.cxx )
ot_add_source_file ( SpectralModelFactoryImplementation.cxx )
ot_add_source_file ( SpectralModelFactory.cxx )
ot_add_source_file ( UserDefinedSpectralModel.cxx)
ot_add_source_file ( WelchFactory.cxx)
ot_add_source_file ( ExponentialModel.cxx )
ot_add_source_file ( ExponentiallyDampedCosineModel.cxx )
ot_add_source_file ( SphericalModel.cxx )
ot_add_source_file ( CauchyModel.cxx )
ot_add_source_file ( SquaredExponential.cxx )
ot_add_source_file ( GeneralizedExponential.cxx )
ot_add_source_file ( AbsoluteExponential.cxx )
ot_add_source_file ( MaternModel.cxx )
ot_add_source_file ( ProductCovarianceModel.cxx )
ot_add_source_file ( CovarianceModelFactoryImplementation.cxx )
ot_add_source_file ( CovarianceModelFactory.cxx )
ot_add_source_file ( UserDefinedCovarianceModel.cxx )
ot_add_source_file ( NonStationaryCovarianceModelFactory.cxx )
ot_add_source_file ( UserDefinedStationaryCovarianceModel.cxx )
ot_add_source_file ( StationaryCovarianceModelFactory.cxx )
ot_add_source_file ( kendall.c )

ot_install_header_file ( HistoryStrategyImplementation.hxx )
ot_install_header_file ( SobolSequence.hxx )
ot_install_header_file ( CovarianceMatrix.hxx )
ot_install_header_file ( CovarianceHMatrix.hxx )
ot_install_header_file ( LinearModelFactory.hxx )
ot_install_header_file ( TestResult.hxx )
ot_install_header_file ( FaureSequence.hxx )
ot_install_header_file ( HaltonSequence.hxx )
ot_install_header_file ( HaselgroveSequence.hxx )
ot_install_header_file ( ReverseHaltonSequence.hxx )
ot_install_header_file ( CorrelationMatrix.hxx )
ot_install_header_file ( Last.hxx )
ot_install_header_file ( ConfidenceInterval.hxx )
ot_install_header_file ( RandomGenerator.hxx )
ot_install_header_file ( RandomGeneratorState.hxx )
ot_install_header_file ( csv_parser_state.hxx )
ot_install_header_file ( LinearModel.hxx )
ot_install_header_file ( HistoryStrategy.hxx )
ot_install_header_file ( CorrelationAnalysis.hxx )
ot_install_header_file ( LowDiscrepancySequence.hxx )
ot_install_header_file ( Full.hxx )
ot_install_header_file ( NumericalSampleImplementation.hxx )
ot_install_header_file ( NumericalSample.hxx )
ot_install_header_file ( ProcessSample.hxx )
ot_install_header_file ( SensitivityAnalysis.hxx )
ot_install_header_file ( OTStat.hxx )
ot_install_header_file ( Compact.hxx )
ot_install_header_file ( LowDiscrepancySequenceImplementation.hxx )
ot_install_header_file ( Null.hxx )
ot_install_header_file ( Field.hxx )
ot_install_header_file ( FieldImplementation.hxx )
ot_install_header_file ( TimeSeries.hxx )
ot_install_header_file ( SecondOrderModelImplementation.hxx )
ot_install_header_file ( SecondOrderModel.hxx )
ot_install_header_file ( ExponentialCauchy.hxx )
ot_install_header_file ( FilteringWindowsImplementation.hxx )
ot_install_header_file ( FilteringWindows.hxx )
ot_install_header_file ( Hamming.hxx )
ot_install_header_file ( Hanning.hxx )
ot_install_header_file ( CovarianceModelImplementation.hxx )
ot_install_header_file ( SpectralModelImplementation.hxx )
ot_install_header_file ( SpectralModel.hxx )
ot_install_header_file ( CovarianceModel.hxx )
ot_install_header_file ( StationaryCovarianceModel.hxx )
ot_install_header_file ( SpectralModelFactoryImplementation.hxx )
ot_install_header_file ( SpectralModelFactory.hxx )
ot_install_header_file ( UserDefinedSpectralModel.hxx )
ot_install_header_file ( WelchFactory.hxx )
ot_install_header_file ( ExponentialModel.hxx )
ot_install_header_file ( ExponentiallyDampedCosineModel.hxx )
ot_install_header_file ( SphericalModel.hxx )
ot_install_header_file ( CauchyModel.hxx )
ot_install_header_file ( CovarianceModelFactoryImplementation.hxx )
ot_install_header_file ( CovarianceModelFactory.hxx )
ot_install_header_file ( UserDefinedCovarianceModel.hxx )
ot_install_header_file ( NonStationaryCovarianceModelFactory.hxx )
ot_install_header_file ( UserDefinedStationaryCovarianceModel.hxx )
ot_install_header_file ( StationaryCovarianceModelFactory.hxx )
ot_install_header_file ( SquaredExponential.hxx )
ot_install_header_file ( GeneralizedExponential.hxx )
ot_install_header_file ( AbsoluteExponential.hxx )
ot_install_header_file ( MaternModel.hxx )
ot_install_header_file ( ProductCovarianceModel.hxx )

# Build on the fly source files
if ( BISON_FOUND AND FLEX_FOUND )
  ot_add_build_dir_to_include_dirs ( ${CMAKE_CURRENT_BINARY_DIR} )
  add_custom_command( OUTPUT  ${CMAKE_CURRENT_BINARY_DIR}/csv_parser.cc ${CMAKE_CURRENT_BINARY_DIR}/csv_parser.hh
                      MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/csv_parser.yy
                      COMMAND ${BISON_EXECUTABLE}
                      ARGS    -o ${CMAKE_CURRENT_BINARY_DIR}/csv_parser.cc
                                 ${CMAKE_CURRENT_SOURCE_DIR}/csv_parser.yy
                      COMMENT "CSV parser generation"
                    )
  ot_add_built_source_file ( ${CMAKE_CURRENT_BINARY_DIR}/csv_parser.cc )
  add_custom_target ( generate_csv_parser DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/csv_parser.cc )

  add_custom_command( OUTPUT  ${CMAKE_CURRENT_BINARY_DIR}/csv_lexer.cc ${CMAKE_CURRENT_BINARY_DIR}/csv_lexer.h
                      MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/csv_lexer.ll
                      COMMAND ${FLEX_EXECUTABLE}
                      ARGS    -o ${CMAKE_CURRENT_BINARY_DIR}/csv_lexer.cc
                              --header-file=${CMAKE_CURRENT_BINARY_DIR}/csv_lexer.h
                              ${CMAKE_CURRENT_SOURCE_DIR}/csv_lexer.ll
                      COMMENT "CSV lexer generation"
                    )
  ot_add_built_source_file ( ${CMAKE_CURRENT_BINARY_DIR}/csv_lexer.cc )
  add_custom_target ( generate_csv_lexer DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/csv_lexer.cc )
endif ()
