#---------------------------------------------------------------
#    Copyright 2006, 2007 Sandia Corporation.
#    Under the terms of Contract DE-AC04-94AL85000, there is a
#    non-exclusive license for use of this work by or on behalf
#    of the U.S. Government.  Export of this program may require
#    a license from the United States Government.
#---------------------------------------------------------------

#
# The signature for Boost.build rules is described here:
#
# http://www.boost.org/build/doc/html/bbv2/overview/targets.html
#
#function-name main-target-name
#    : sources
#    : requirements
#    : default-build
#    : usage-requirements
#    ;
#
#    * "main-target-name" is the name used to request the target
#            on command line and to use it from other main targets.
#            Main target name may contain alphanumeric characters and symbols '-' and '_';
#    * "sources" is the list of source files and other main targets that must be combined.
#    * "requirements" is the list of properties that must always be present
#            when this main target is built.
#    * "default-build" is the list of properties that will be used unless
#            some other value of the same feature is already specified.
#    * "usage-requirements" is the list of properties that will be propagated
#            to all main targets that use this one, i.e. to all dependedents.
#
#
# SECTION 1: Project definition
#

import set ;
import path ;

project votd
  : requirements
    $(sierra-warnings)
     <define>SIERRA_PARALLEL_MPI
     <include>$(stk_unit_test_utils-root)/..
  : usage-requirements
     <define>SIERRA_PARALLEL_MPI
     <include>$(stk_unit_test_utils-root)/..
  : build-dir $(stk_unit_test_utils-builddir)
  ;

#
# SECTION 2: Development install
#
explicit install-serial-targets ;
alias install-serial-targets ;

explicit install-targets ;
alias install-targets ;


#
# SECTION 3: End-user install
#
explicit install-user-env ;
alias install-user-env : install-user-jamfile
                          install-user-src install-user-include install-user-lib ;

# This rule copies build-system related files for this product to the install-root.
explicit install-user-jamfile ;
install install-user-jamfile
  : [ glob $(stk_unit_test_utils-root)/Jamfile ]
  : <location>$(install-root)/stk/stk_unit_test_utils
    <install-source-root>$(stk_unit_test_utils-root)
  ;


explicit install-user-src ;
install install-user-src ;

explicit install-user-include ;
install install-user-include
  : [ glob
      $(stk_unit_test_utils-root): *.hpp *.h
    ]
  : <location>$(install-root)/stk/stk_unit_test_utils/include
  ;

explicit install-user-lib ;
install install-user-lib
  : stk_unit_test_utils
    stk_unit_main
    comparisonUtils
  : <location>$(install-root)/stk/stk_unit_test_utils/lib
  ;

explicit install-exe-targets ;
alias install-exe-targets : ;

#
# SECTION 4: Build configuration
#
lib stk_unit_test_utils
  :
    [ ifdevbuild
      [ glob $(stk_unit_test_utils-root)/*.cpp ]
      /sierra/stk_io//stk_io
      /tpl/gtest//gtest
    ]
  : 
    [ ifuserbuild
      <file>$(stk_unit_test_utils-root)/lib/libstk_unit_test_utils.a
    ]
  :
  :
    <include>$(stk_unit_test_utils-root)/..
  ;

lib stk_unit_main
  :
    [ ifdevbuild
      [ glob $(stk_unit_test_utils-root)/unit_main_lib/*.cpp ]
      stk_unit_test_utils
    ]
  : 
    [ ifuserbuild
      <file>$(stk_unit_test_utils-root)/lib/libstk_unit_main.a
    ]
  :
  :
  ;

lib comparisonUtils
  :
    [ ifdevbuild
      $(stk_unit_test_utils-root)/comparison/stringAndNumberComparisons.cpp
    ]   
  :
    [ ifuserbuild
      <file>$(stk_unit_test_utils-root)/lib/libcomparisonUtils.a
    ]   
  ;

