source: trunk/test_more/CMakeLists.txt @ 2722

Last change on this file since 2722 was 2722, checked in by bradbell, 7 years ago
  1. Change echo_exec to echo_eval.

limits.hpp: Improve documentation.
limits.cpp: Simplify example.
epsilon.cpp: Replace by more general limits.cpp.
limits.cpp: Modified version of old example/limits.cpp.

  • Property svn:keywords set to Id
File size: 4.0 KB
Line 
1# $Id: CMakeLists.txt 2722 2013-01-06 16:52:46Z 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        for_hess.cpp
104        for_sparse_jac.cpp
105        forward.cpp
106        from_base.cpp
107        fun_check.cpp
108        ipopt_solve.cpp
109        jacobian.cpp
110        limits.cpp
111        log.cpp
112        log10.cpp
113        mul.cpp
114        mul_eq.cpp
115        mul_level.cpp
116        mul_zero_one.cpp
117        ndebug.cpp
118        near_equal_ext.cpp
119        neg.cpp
120        ode_err_control.cpp
121        optimize.cpp
122        parameter.cpp
123        poly.cpp
124        pow.cpp
125        pow_int.cpp
126        print_for.cpp
127        romberg_one.cpp
128        rosen_34.cpp
129        runge_45.cpp
130        reverse.cpp
131        rev_sparse_hes.cpp
132        rev_sparse_jac.cpp
133        rev_two.cpp
134        simple_vector.cpp
135        sin.cpp
136        sin_cos.cpp
137        sinh.cpp
138        sparse_hessian.cpp
139        sparse_jacobian.cpp
140        sparse_vec_ad.cpp
141        sqrt.cpp
142        std_math.cpp
143        sub.cpp
144        sub_eq.cpp
145        sub_zero.cpp
146        tan.cpp
147        test_vector.cpp
148        track_new_del.cpp
149        value.cpp
150        vec_ad.cpp
151        vec_ad_par.cpp
152        vec_unary.cpp
153)
154
155# Compiler flags for cppad source
156add_cppad_cxx_flags(test_more)
157
158# List of libraries to be linked into the specified target
159TARGET_LINK_LIBRARIES(test_more
160        ${test_more_adolc}
161        ${test_more_ipopt}
162        ${test_more_eigen}
163)
164
165# Add the check_test_more target
166ADD_CUSTOM_TARGET(
167        check_test_more test_more DEPENDS test_more ${test_more_eigen}
168)
Note: See TracBrowser for help on using the repository browser.