source: trunk/test_more/CMakeLists.txt @ 3008

Last change on this file since 3008 was 2862, checked in by bradbell, 7 years ago

Remove return flag from checkpoint function calls.

check_makefile.sh: handle case where configure.hpp not yet created.
CMakeLists.txt: remove duplicate copy of ipopt_solve.cpp.

  • Property svn:keywords set to Id
File size: 4.1 KB
Line 
1# $Id: CMakeLists.txt 2862 2013-05-29 05:58:38Z 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        checkpoint.cpp
91        compare.cpp
92        compare_change.cpp
93        cond_exp.cpp
94        cond_exp_ad.cpp
95        copy.cpp
96        cos.cpp
97        cosh.cpp
98        dbl_epsilon.cpp
99        div.cpp
100        div_eq.cpp
101        div_zero_one.cpp
102        erf.cpp
103        exp.cpp
104        extern_value.cpp
105        for_hess.cpp
106        for_sparse_jac.cpp
107        forward.cpp
108        forward_mul.cpp
109        from_base.cpp
110        fun_check.cpp
111        jacobian.cpp
112        limits.cpp
113        log.cpp
114        log10.cpp
115        mul.cpp
116        mul_eq.cpp
117        mul_level.cpp
118        mul_zero_one.cpp
119        ndebug.cpp
120        near_equal_ext.cpp
121        neg.cpp
122        ode_err_control.cpp
123        optimize.cpp
124        parameter.cpp
125        poly.cpp
126        pow.cpp
127        pow_int.cpp
128        print_for.cpp
129        romberg_one.cpp
130        rosen_34.cpp
131        runge_45.cpp
132        reverse.cpp
133        rev_sparse_hes.cpp
134        rev_sparse_jac.cpp
135        rev_two.cpp
136        simple_vector.cpp
137        sin.cpp
138        sin_cos.cpp
139        sinh.cpp
140        sparse_hessian.cpp
141        sparse_jacobian.cpp
142        sparse_vec_ad.cpp
143        sqrt.cpp
144        std_math.cpp
145        sub.cpp
146        sub_eq.cpp
147        sub_zero.cpp
148        tan.cpp
149        test_vector.cpp
150        track_new_del.cpp
151        value.cpp
152        vec_ad.cpp
153        vec_ad_par.cpp
154        vec_unary.cpp
155)
156
157# Compiler flags for cppad source
158add_cppad_cxx_flags(test_more)
159
160# List of libraries to be linked into the specified target
161TARGET_LINK_LIBRARIES(test_more
162        ${test_more_adolc}
163        ${test_more_ipopt}
164        ${test_more_eigen}
165)
166
167# Add the check_test_more target
168ADD_CUSTOM_TARGET(
169        check_test_more test_more DEPENDS test_more ${test_more_eigen}
170)
Note: See TracBrowser for help on using the repository browser.