source: trunk/test_more/CMakeLists.txt @ 2794

Last change on this file since 2794 was 2756, checked in by bradbell, 7 years ago

Make testing of numeric limits more robust by
using external functions, instead of arrays, for storing temporary values.

extern_value.cpp: external functions for getting and setting values.

  • Property svn:keywords set to Id
File size: 4.1 KB
Line 
1# $Id: CMakeLists.txt 2756 2013-02-27 18:49:28Z bradbell $
2# -----------------------------------------------------------------------------
3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
4#
5# CppAD is distributed under multiple licenses. This distribution is under
6# the terms of the
7#                     Eclipse Public License Version 1.0.
8#
9# A copy of this license is included in the COPYING file of this distribution.
10# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
11# -----------------------------------------------------------------------------
12# Build the test_more directory tests
13# Inherit environment from ../CMakeList.txt
14
15# Specifies build type for this directory. Possible values are
16# empty, Debug, Release, RelWithDebInfo and MinSizeRel
17SET(CMAKE_BUILD_TYPE DEBUG)
18
19# This directory does not contain any multi-threading tests, so
20# test using CPPAD_MAX_NUM_THREADS equal to one (its smallest value)
21ADD_DEFINITIONS("-DCPPAD_MAX_NUM_THREADS=1")
22
23# sources that use adolc
24IF ( adolc_prefix )
25        # Extra source files if we are including adolc
26        SET(adolc_sources base_adolc.cpp)
27        # Adds -D define flags to the compilation of source files.
28        ADD_DEFINITIONS("-DCPPAD_ADOLC_TEST")
29        # add adolc to list of libraries
30        SET(test_more_adolc adolc)
31ELSE ( adolc_prefix )
32        SET(adolc_sources "")
33        SET(test_more_adolc "")
34ENDIF ( adolc_prefix )
35
36# sources that use ipopt
37IF ( ipopt_prefix )
38        # Extra source files if we are including ipopt
39        SET(ipopt_sources ipopt_solve.cpp)
40        # Adds -D define flags to the compilation of source files.
41        ADD_DEFINITIONS("-DCPPAD_IPOPT_TEST")
42        # add ipopt (and libraries it depends on) to list of libraries
43        SET(test_more_ipopt ${ipopt_LIBRARIES} )
44ELSE ( ipopt_prefix )
45        SET(ipopt_sources "")
46        SET(test_more_ipopt "")
47ENDIF ( ipopt_prefix )
48
49# sources that use eigen
50IF ( eigen_prefix )
51        # compile eigen library separately so can use different compiler flags
52        ADD_LIBRARY(test_more_eigen EXCLUDE_FROM_ALL cppad_eigen.cpp)
53        # Adds -D define flags to the compilation of source files.
54        ADD_DEFINITIONS("-DCPPAD_EIGEN_TEST")
55        # Add other compiler flags
56        add_cppad_cxx_flags(test_more_eigen)
57        #
58        # Add eigen to list of libraries
59        SET(test_more_eigen test_more_eigen)
60ELSE ( eigen_prefix )
61        SET(eigen_sources "")
62        SET(test_more_eigen "")
63ENDIF ( eigen_prefix )
64
65# Copy a file to another location and modify its contents.
66# configure_file(InputFile OutputFile [COPYONLY] [ESCAPE_QUOTES] [@ONLY])
67CONFIGURE_FILE(
68        ${CMAKE_CURRENT_SOURCE_DIR}/test_one.sh.in             
69        ${CMAKE_CURRENT_SOURCE_DIR}/test_one.sh
70)
71
72# add_executable(<name> [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL]
73#                 source1 source2 ... sourceN
74# )
75ADD_EXECUTABLE(test_more EXCLUDE_FROM_ALL test_more.cpp
76        ${adolc_sources}
77        ${ipopt_sources}
78        ${eigen_sources}
79        abs.cpp
80        acos.cpp
81        asin.cpp
82        assign.cpp
83        add.cpp
84        add_eq.cpp
85        add_zero.cpp
86        atan.cpp
87        atan2.cpp
88        base_alloc.cpp
89        check_simple_vector.cpp
90        compare.cpp
91        compare_change.cpp
92        cond_exp.cpp
93        cond_exp_ad.cpp
94        copy.cpp
95        cos.cpp
96        cosh.cpp
97        dbl_epsilon.cpp
98        div.cpp
99        div_eq.cpp
100        div_zero_one.cpp
101        erf.cpp
102        exp.cpp
103        extern_value.cpp
104        for_hess.cpp
105        for_sparse_jac.cpp
106        forward.cpp
107        from_base.cpp
108        fun_check.cpp
109        ipopt_solve.cpp
110        jacobian.cpp
111        limits.cpp
112        log.cpp
113        log10.cpp
114        mul.cpp
115        mul_eq.cpp
116        mul_level.cpp
117        mul_zero_one.cpp
118        ndebug.cpp
119        near_equal_ext.cpp
120        neg.cpp
121        ode_err_control.cpp
122        optimize.cpp
123        parameter.cpp
124        poly.cpp
125        pow.cpp
126        pow_int.cpp
127        print_for.cpp
128        romberg_one.cpp
129        rosen_34.cpp
130        runge_45.cpp
131        reverse.cpp
132        rev_sparse_hes.cpp
133        rev_sparse_jac.cpp
134        rev_two.cpp
135        simple_vector.cpp
136        sin.cpp
137        sin_cos.cpp
138        sinh.cpp
139        sparse_hessian.cpp
140        sparse_jacobian.cpp
141        sparse_vec_ad.cpp
142        sqrt.cpp
143        std_math.cpp
144        sub.cpp
145        sub_eq.cpp
146        sub_zero.cpp
147        tan.cpp
148        test_vector.cpp
149        track_new_del.cpp
150        value.cpp
151        vec_ad.cpp
152        vec_ad_par.cpp
153        vec_unary.cpp
154)
155
156# Compiler flags for cppad source
157add_cppad_cxx_flags(test_more)
158
159# List of libraries to be linked into the specified target
160TARGET_LINK_LIBRARIES(test_more
161        ${test_more_adolc}
162        ${test_more_ipopt}
163        ${test_more_eigen}
164)
165
166# Add the check_test_more target
167ADD_CUSTOM_TARGET(
168        check_test_more test_more DEPENDS test_more ${test_more_eigen}
169)
Note: See TracBrowser for help on using the repository browser.