CMakeLists.txt 34.9 KB
Newer Older
1
#
2
# A more complex test case
3
#
4
cmake_minimum_required(VERSION 2.4)
5
cmake_policy(SET CMP0054 NEW)
6
project (Complex)
7

8 9 10 11 12 13 14
# Test that renaming a built-in works when configured multiple times.
message("message")
function(message)
  _message(${ARGN})
endfunction()
message("message")

15
# Try setting a new policy.  The IF test is for coverage.
16 17
if(POLICY CMP0003)
  cmake_policy(SET CMP0003 NEW)
18

19 20 21
  cmake_policy(GET CMP0003 P3)
  if(NOT "${P3}" STREQUAL "NEW")
    message(FATAL_ERROR "cmake_policy(GET) did not report NEW!")
22 23
  endif()
endif()
24

25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
# It is not recommended to set a policy to OLD, but this test
# covers the OLD behavior of some policies.
foreach(p
    CMP0029
    CMP0032
    CMP0033
    CMP0034
    CMP0043
    CMP0050
    )
  if(POLICY ${p})
    cmake_policy(SET ${p} OLD)
  endif()
endforeach()

40
# Test building without per-rule echo lines in Makefiles.
41
set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
42

43
set(CPACK_SOURCE_IGNORE_FILES "~$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$")
44

Ken Martin's avatar
Ken Martin committed
45 46 47
#
# Define a macro
#
48 49 50
macro(ASSERT value msg)
  if (NOT ${value})
    message ("Assertion failure:" ${msg} )
51 52
  endif ()
endmacro()
53

Ken Martin's avatar
Ken Martin committed
54 55
# invoke the macro
ASSERT(Complex_BINARY_DIR "The PROJECT command is broken")
56

57 58 59
#
# Define a var args macro, it must take two or four args
#
60 61
macro(TEST_ARGC value1 value2)
  add_definitions(${value1} ${value2})
62
  if (${ARGC} EQUAL 4)
63
    add_definitions(${ARGV2} ${ARGV3})
64 65
  endif ()
endmacro()
66

67 68 69
# invoke the macro
TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4)

70
macro(TEST_VAR_ARG fa)
71
  if("${ARGV}" STREQUAL "1;2;3")
72
    message(STATUS "ARGV works")
73
  else()
74
    message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"")
75
  endif()
76
  if("${ARGN}" STREQUAL "2;3")
77
    message(STATUS "ARGN works")
78
  else()
79
    message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"")
80 81
  endif()
endmacro()
82 83 84

TEST_VAR_ARG(1 2 3)

85
# Floating-point comparison test.
86 87
if(2.4 LESS 2.4)
  message(FATAL_ERROR "Failed: 2.4 LESS 2.4")
88
endif()
89 90
if(2.4 GREATER 2.4)
  message(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
91
endif()
92 93
if(NOT 2.4 EQUAL 2.4)
  message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
94
endif()
95

96
if(CMAKE_SYSTEM MATCHES "OSF1-V")
97
  if(NOT CMAKE_COMPILER_IS_GNUCXX)
98
     string(APPEND CMAKE_CXX_FLAGS " -timplicit_local -no_implicit_include ")
99 100
  endif()
endif()
101 102 103 104 105


add_definitions(-DCMAKE_IS_FUN)
add_definitions(-DCMAKE_IS_REALLY_FUN)
set_property(DIRECTORY
106 107 108
  PROPERTY COMPILE_DEFINITIONS_RELEASE
  CMAKE_IS_FUN_IN_RELEASE_MODE
  )
109 110 111 112 113 114 115 116
set_property(DIRECTORY
  PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO
  CMAKE_IS_FUN_IN_RELEASE_MODE
  )
set_property(DIRECTORY
  PROPERTY COMPILE_DEFINITIONS_MINSIZEREL
  CMAKE_IS_FUN_IN_RELEASE_MODE
  )
117

118 119
set(TEST_SEP "a b c")
separate_arguments(TEST_SEP)
120 121


122 123 124
#
# Include vars from a file and from a cache
#
125 126
if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
  include(${Complex_SOURCE_DIR}/VarTests.cmake)
127
endif ()
128 129
include(fileshouldnotbehere OPTIONAL)
load_cache(${Complex_SOURCE_DIR}/Cache
Sebastien Barre's avatar
Sebastien Barre committed
130 131 132 133
           EXCLUDE
             CACHE_TEST_VAR_EXCLUDED
           INCLUDE_INTERNALS
             CACHE_TEST_VAR_INTERNAL)
134

135 136 137
load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2)
if(${fooCACHE_TEST_VAR2} MATCHES bar)
  message("Load cache worked: ${fooCACHE_TEST_VAR2}")
138
else()
139
  message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}")
140
endif()
Bill Hoffman's avatar
Bill Hoffman committed
141 142 143



144
#
145
# Specify include and lib dirs
Sebastien Barre's avatar
Sebastien Barre committed
146
# (BEFORE is for coverage)
147
#
148
include_directories(
149
  Library
150
)
151

152
include_directories(BEFORE
Sebastien Barre's avatar
Sebastien Barre committed
153 154
  ${Complex_BINARY_DIR}
)
155
include_directories(SYSTEM Library/SystemDir)
Sebastien Barre's avatar
Sebastien Barre committed
156

157
include_regular_expression("^(cmTest|file|sharedFile|test).*$" "^cmMissing")
158

159
link_directories(
160
  ${Complex_BINARY_DIR}/Library
161 162
)

163 164 165
#
# check for SET CACHE FORCE
#
166 167
set(FORCE_TEST 1 CACHE STRING "a test")
set(FORCE_TEST 0 CACHE STRING "a test" FORCE)
168

169 170 171
#
# Lib and exe path
#
172 173 174
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin")
175

176
message (Test " " escape " " semi-colon " " \; \;)
177
#
178
# Exec program (TODO: test a result)
179 180
# Increase coverage.
#
181 182 183 184
message("\nIgnore this message")
option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0)
if (NOT NO_EXEC_PROGRAM)
  exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}")
185
else ()
186
  message("Set this option ON")
187
endif ()
188

189 190
mark_as_advanced(NO_EXEC_PROGRAM)
mark_as_advanced(CLEAR NO_EXEC_PROGRAM)
191

192
# Execute a process.  Add coverage for this command.
193
execute_process(
194 195 196
  COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG"
  OUTPUT_VARIABLE TEST_OUT
  )
197
if("${TEST_OUT}" STREQUAL "ABCDEFG\n")
198
else()
199
  message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]")
200
endif()
201 202 203

# This test has some problems on UNIX systems.  Disabling for now.
#
204
# execute_process(
205 206 207 208 209 210
#   COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG"
#   COMMAND /process/does/not/exist
#   OUTPUT_QUIET
#   ERROR_QUIET
#   RESULT_VARIABLE RESULT
#   )
211
# if("${RESULT}" STREQUAL "0")
212
#   message(SEND_ERROR
213
#     "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]")
214
# else()
215
#   message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]")
216
# endif()
217

218 219 220 221 222
#
# Create directory.
# The 'complex' executable will then test if this dir exists,
# sadly it won't be able to remove it.
#
223
make_directory("${Complex_BINARY_DIR}/make_dir")
Sebastien Barre's avatar
Sebastien Barre committed
224 225 226 227 228

#
# Test FIND_LIBARY
# Create a dummy empty lib
#
229
configure_file(
230 231
  ${Complex_SOURCE_DIR}/Library/dummy
  ${Complex_BINARY_DIR}/Library/dummylib.lib
232
  COPYONLY)
233
foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl
234 235
         ${CMAKE_SHARED_LIBRARY_SUFFIX}.2
         ${CMAKE_STATIC_LIBRARY_SUFFIX}.2)
236
  configure_file(
Sebastien Barre's avatar
Sebastien Barre committed
237
    ${Complex_SOURCE_DIR}/Library/dummy
238
    ${Complex_BINARY_DIR}/Library/libdummylib${ext}
239
    COPYONLY)
240
endforeach ()
Sebastien Barre's avatar
Sebastien Barre committed
241

242
find_library(FIND_DUMMY_LIB
Sebastien Barre's avatar
Sebastien Barre committed
243 244
             dummylib
             PATHS
Bill Hoffman's avatar
Bill Hoffman committed
245 246
             ${Complex_BINARY_DIR}/Library DOC "find dummy lib")

247
find_library(FIND_DUMMY_LIB
Bill Hoffman's avatar
Bill Hoffman committed
248 249 250
             NAMES dummylib dummylib2
             PATHS
             ${Complex_BINARY_DIR}/Library DOC "find dummy lib")
Sebastien Barre's avatar
Sebastien Barre committed
251

252 253 254
# This doesn't work for platforms that have a shared library and an import
# library, like Windows with .dll and .lib. Limit is to ".so" now because it's
# known to work there.
255 256
if(CMAKE_SHARED_LIBRARY_SUFFIX STREQUAL ".so")
  find_library(FIND_DUMMY_SHLIB_VERSIONED
257 258 259 260 261
               NAMES libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2
               PATHS ${Complex_BINARY_DIR}/Library
               DOC "find versioned dummy shared lib"
               NO_DEFAULT_PATH)

262 263
  if(NOT FIND_DUMMY_SHLIB_VERSIONED MATCHES "/libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2")
    message(SEND_ERROR "FIND_DUMMY_SHLIB_VERSIONED is not set correctly: "
264
            "${FIND_DUMMY_SHLIB_VERSIONED}")
265 266
  endif()
endif()
267 268

# Static library, should work everywhere
269
find_library(FIND_DUMMY_STLIB_VERSIONED
270 271 272 273 274
             NAMES libdummylib${CMAKE_STATIC_LIBRARY_SUFFIX}.2
             PATHS ${Complex_BINARY_DIR}/Library
             DOC "find versioned dummy static lib"
             NO_DEFAULT_PATH)

275 276
if(NOT FIND_DUMMY_STLIB_VERSIONED MATCHES "/libdummylib${CMAKE_STATIC_LIBRARY_SUFFIX}.2")
  message(SEND_ERROR "FIND_DUMMY_STLIB_VERSIONED is not set correctly: "
277
          "${FIND_DUMMY_STLIB_VERSIONED}")
278
endif()
279

Sebastien Barre's avatar
Sebastien Barre committed
280
#
281
# Test SET_SOURCE_FILES_PROPERTIES
Sebastien Barre's avatar
Sebastien Barre committed
282
#
283
set_source_files_properties(nonexisting_file2
284 285 286
  GENERATED
  ABSTRACT
  WRAP_EXCLUDE
287
  COMPILE_FLAGS "-foo -bar")
Sebastien Barre's avatar
Sebastien Barre committed
288

289 290 291
get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT)
get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE)
get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS)
Sebastien Barre's avatar
Sebastien Barre committed
292

293
set_source_files_properties(nonexisting_file3 PROPERTIES
294 295 296 297
  GENERATED 1
  ABSTRACT 1
  WRAP_EXCLUDE 1
  COMPILE_FLAGS "-foo -bar")
298 299 300
get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT)
get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE)
get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS)
301

302 303 304 305 306
#
# Test registry (win32)
# Create a file, put its path in a registry key, try to find the file in that
# path using that registry key, then remove the file and the key
#
307 308 309 310 311 312
if (WIN32)
  if (NOT UNIX)
    set(dir "${Complex_BINARY_DIR}/registry_dir")
    set(file "registry_test_dummy")
    set(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test")
    configure_file(
313 314
      ${Complex_SOURCE_DIR}/Library/dummy
      "${dir}/${file}"
315
      COPYONLY)
316 317
    exec_program(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"")
    find_path(REGISTRY_TEST_PATH
318 319
      ${file}
      "[${hkey}]" DOC "Registry_Test_Path")
320 321
    exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"")
    exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"")
322 323
  endif ()
endif ()
324

Ken Martin's avatar
Ken Martin committed
325 326 327
#
# Test a set and a remove
#
328 329 330
set(REMOVE_STRING a b c d e f)
set(removeVar1 c e)
remove(REMOVE_STRING ${removeVar1} f)
Ken Martin's avatar
Ken Martin committed
331

332 333 334
#
# Test an IF inside a FOREACH.
#
335 336
foreach(x "a")
  if(${x} MATCHES "a")
337
    # Should always execute.
338
    set(IF_INSIDE_FOREACH_THEN_EXECUTED 1)
339
  else()
340
    # Should never execute.
341
    set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1)
342 343
  endif()
endforeach()
344

345
# test WHILE command
346 347 348
set (while_var 1)
while (while_var LESS 1000)
  set(while_var ${while_var}0)
349
endwhile()
350

351 352
set(SHOULD_BE_ZERO )
set(SHOULD_BE_ONE 1)
Ken Martin's avatar
Ken Martin committed
353

354
# test elseif functionality, the mess below tries to catch problem
Ken Martin's avatar
Ken Martin committed
355 356 357 358 359 360 361
# of clauses being executed early or late etc
set (RESULT 3)
if (RESULT EQUAL 1)
  if (RESULT EQUAL 2)
    set (ELSEIF_RESULT 1)
  elseif (RESULT EQUAL 3)
    set (ELSEIF_RESULT 1)
362
  endif ()
Ken Martin's avatar
Ken Martin committed
363 364 365 366 367 368 369 370
elseif (RESULT EQUAL 2)
  set (ELSEIF_RESULT 1)
elseif (RESULT EQUAL 3)
  if (RESULT EQUAL 2)
    set (ELSEIF_RESULT 1)
  elseif (RESULT EQUAL 3)
    if (NOT ELSEIF_RESULT EQUAL 1)
      set (ELSEIF_RESULT 2)
371 372
    endif ()
  endif ()
Ken Martin's avatar
Ken Martin committed
373 374 375 376 377
elseif (RESULT EQUAL 4)
  if (RESULT EQUAL 2)
    set (ELSEIF_RESULT 1)
  elseif (RESULT EQUAL 3)
    set (ELSEIF_RESULT 1)
378 379
  endif ()
else ()
Ken Martin's avatar
Ken Martin committed
380 381 382 383
  if (RESULT EQUAL 2)
    set (ELSEIF_RESULT 1)
  elseif (RESULT EQUAL 3)
    set (ELSEIF_RESULT 1)
384 385
  endif ()
endif ()
Ken Martin's avatar
Ken Martin committed
386 387 388

if (NOT ELSEIF_RESULT EQUAL 2)
  set (ELSEIF_RESULT 0)
389
endif ()
Ken Martin's avatar
Ken Martin committed
390

391 392 393 394 395 396
# test handling of parenthetical groups in conditionals
if (2 GREATER 1 AND (4 LESS 3 OR 5 LESS 6) AND NOT (7 GREATER 8))
  set(CONDITIONAL_PARENTHESES 1)
endif()


Sebastien Barre's avatar
Sebastien Barre committed
397
#
398
# Configure file
Sebastien Barre's avatar
Sebastien Barre committed
399 400
# (plug vars to #define so that they can be tested)
#
401
configure_file(
Sebastien Barre's avatar
Sebastien Barre committed
402 403 404
  ${Complex_SOURCE_DIR}/cmTestConfigure.h.in
  ${Complex_BINARY_DIR}/cmTestConfigure.h)

405
set(STRING_WITH_QUOTES "\"hello world\"")
406
# test CONFIGURE_FILE with ESCAPE_QUOTES on
407
configure_file(
408 409 410
  ${Complex_SOURCE_DIR}/cmTestConfigureEscape.h.in
  ${Complex_BINARY_DIR}/cmTestConfigureEscape.h ESCAPE_QUOTES)

Brad King's avatar
Brad King committed
411
# Test regular expression commands.
412 413 414
string(REGEX MATCH "b" RESULT "abc")
if(NOT RESULT)
  message(SEND_ERROR "string(REGEX MATCH ... ) test failed.")
415
endif()
416 417 418
string(REGEX MATCHALL "b" RESULT "abcb")
if(NOT RESULT)
  message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.")
419
endif()
420
string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e")
421
if(NOT RESULT STREQUAL "a[b]c[d]e")
422 423
  message(SEND_ERROR
    "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")")
424
endif()
Brad King's avatar
Brad King committed
425

426 427 428 429 430 431 432 433 434 435 436 437 438
#
# This tests needs Ansi C++98
#
set(CMAKE_CXX_STANDARD 98)
#
# GNU extensions are needed for stricmp() on Windows.
#
set(CMAKE_CXX_EXTENSIONS TRUE)

# Those versions of the HP compiler that need a flag to get proper C++98
# template support also need a flag to use the newer C++ library.
if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
    CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
439
  string(APPEND CMAKE_CXX_FLAGS " -AA")
440
endif ()
Ken Martin's avatar
Ken Martin committed
441

442 443 444 445 446 447
# Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
    CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
  set(CMAKE_CXX_STANDARD 11)
endif()

Sebastien Barre's avatar
Sebastien Barre committed
448 449 450
#
# Create the libs and the main exe
#
451 452 453 454 455
add_subdirectory(Library)
add_subdirectory(Executable)
subdir_depends(Executable Library)
export_library_dependencies(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake)
include(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL)