source: trunk/CMakeLists.txt

Last change on this file was 4024, checked in by bradbell, 20 months ago

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: 46be2e2dbcaba47d8a38e8d9110efc48c7245754
end hash code: 50c63912234ddd32949460e8843399ac7f6df9b5

commit 50c63912234ddd32949460e8843399ac7f6df9b5
Author: Brad Bell <bradbell@…>
Date: Sun Sep 23 09:41:09 2018 -0700

master: add base2ad capability to checkpoint forward and reverse.

commit 423b330668e0e3f6d5eb97259ddcc5e2aac7189e
Author: Brad Bell <bradbell@…>
Date: Sun Sep 23 06:52:10 2018 -0700

master: Advance to cppad-20180923

commit 259744c0819c30bb648b0eb8ac362cdcb86f6a98
Author: Brad Bell <bradbell@…>
Date: Sun Sep 23 06:51:59 2018 -0700

master: atomic: improve see also, mention memory in atomic_base.

commit e7fe98386156854f28cc041ffc370aaa3c360ad3
Author: Brad Bell <bradbell@…>
Date: Sat Sep 22 12:24:38 2018 -0700

master: checkpoint: improve memory allocation documentation.

commit 1540c7cdac18ee3ff2b10f7ec3989c991be8dc6c
Author: Brad Bell <bradbell@…>
Date: Sat Sep 22 10:27:12 2018 -0700

master: checkpoint.hpp: remove some doxygen formattig commands.

commit e271a776a1725caf354346abc077a2e04345707f
Author: Brad Bell <bradbell@…>
Date: Sat Sep 22 09:27:39 2018 -0700

master: checkpoint: remove special case for tmb (no longer necessary).

commit 4e319c0b93d77723b36f8c77dc868dbbfb5161c5
Author: Brad Bell <bradbell@…>
Date: Sat Sep 22 09:11:18 2018 -0700

master: multi_thread/checkpoint.cpp test now passes.

commit b72d4c47b980fd92b2180aa0ead3fbb358835ef9
Author: Brad Bell <bradbell@…>
Date: Sat Sep 22 08:39:15 2018 -0700

master: working on geting multi_thread/checkpoint.cpp to pass its tests.


thread_test.cpp: print result for each number of threads.

commit 93adf79454964553c06e3a6d70e5a529d63e41c2
Author: Brad Bell <bradbell@…>
Date: Sat Sep 22 07:16:37 2018 -0700

master: Advance to cppad-20180922

commit 4bcd023ed4af9d4f52ebed766a8022af59f5574b
Author: Brad Bell <bradbell@…>
Date: Sat Sep 22 07:16:28 2018 -0700

master: checkpoint: attempt to get example/multi_thread/checkpoint.cpp to work.

commit b911efa5a513a3a414f001d05570b05f7e75732d
Author: Brad Bell <bradbell@…>
Date: Fri Sep 21 09:20:27 2018 -0700

master: multi_thread: add checkpoint example (Under Construction).
This example has been added because there is a suspected bug using checkpoint
with multiple threads.

commit 0dfb5649037c3a5c0ccef376c0b0449bde9d737f
Author: Brad Bell <bradbell@…>
Date: Fri Sep 21 05:35:13 2018 -0700

master: Advance to cppad-20180921

commit 536b06f59630a8d16f3ec85b1c01675d49855bd1
Author: Brad Bell <bradbell@…>
Date: Fri Sep 21 05:35:03 2018 -0700

master: make checkpoint/ctor.hpp a separate file.

commit d4c2647a46b926da8cf55126ffa09e036bb6ebef
Author: Brad Bell <bradbell@…>
Date: Thu Sep 20 16:23:15 2018 -0700

master: make checkpoint/reverse.hpp a separate file.

commit 459b8769a165c779e2b553b88136a15166738919
Author: Brad Bell <bradbell@…>
Date: Thu Sep 20 16:16:44 2018 -0700

master: make checkpoint/forward.hpp a separate file.

commit 55c6f34a9ef82a837e11a74c9da49ead54807031
Author: Brad Bell <bradbell@…>
Date: Thu Sep 20 13:20:24 2018 -0700

master: make checkpoint/rev_sparse_hes.hpp a separate file.

commit d15f401dec253340bb2df404c93b0a0ce6c0fd42
Author: Brad Bell <bradbell@…>
Date: Thu Sep 20 13:16:13 2018 -0700

master: checkpoint.hpp: make checkpoint/rev_sparse_jac.hpp a separate file.

commit 1b7561be8e9378784523931591ad0c69b47ef1c2
Author: Brad Bell <bradbell@…>
Date: Thu Sep 20 13:10:12 2018 -0700

master: checkpoint.hpp: make checkpoint/for_sparse_jac.hpp a separate file.

commit 8a44207afae9c2b4b527a988f6abc5354fc9bd03
Author: Brad Bell <bradbell@…>
Date: Thu Sep 20 11:49:34 2018 -0700

master: atomic_base.hpp: add atomic_base2ad.cpp example (deleted by mistake)

commit 60fdd10df33ffd30ca1b729fb3f0aceed47b2b7b
Author: Brad Bell <bradbell@…>
Date: Thu Sep 20 11:02:03 2018 -0700

master: checkpoint.hpp: make set_hes_sparse_bool.hpp a separate file.

commit 63d57df665178dd1eb93386f614228e9fc8adca3
Author: Brad Bell <bradbell@…>
Date: Thu Sep 20 10:59:56 2018 -0700

master: checkpoint.hpp: make set_hes_sparse_set.hpp a separate file.

commit 50f19625a3f6b7828a317fe819411873de88a6ae
Author: Brad Bell <bradbell@…>
Date: Thu Sep 20 10:56:54 2018 -0700

master: checkpoint.hpp: make set_jac_sparse_bool.hpp a separate file.

commit b5b029dbc88bd078b9999e92d3a58639fa77536f
Author: Brad Bell <bradbell@…>
Date: Thu Sep 20 10:23:53 2018 -0700

master: Advance to cppad-20180920

commit 2498480606fa639de5faa4c8796b4012a6828d14
Author: Brad Bell <bradbell@…>
Date: Thu Sep 20 10:19:55 2018 -0700

master: checkpoint.hpp: make set_jac_sparse_set.hpp a separate file.

commit d26d949132df354a62356988668b16123e0a0c49
Author: Brad Bell <bradbell@…>
Date: Wed Sep 19 22:05:00 2018 -0700

master: fix atomics in sparsity pattern calculations by ADFun< AD<Base>, Base > objects

commit 5c4eb81045564b2677773221f245678820d14436
Author: Brad Bell <bradbell@…>
Date: Wed Sep 19 14:57:51 2018 -0700

master: base2ad.cpp: edit comments in example.

commit ee6139b8b698e7d0751c699b2f283c7cb1b15d31
Merge: a19cdd86 48d85185
Author: Brad Bell <bradbell@…>
Date: Wed Sep 19 14:55:18 2018 -0700

Merge remote-tracking branch 'origin/master'

commit a19cdd86794a7dc3632a7d1869cc6089b724e472
Author: Brad Bell <bradbell@…>
Date: Wed Sep 19 13:21:29 2018 -0700

master: Advance to cppad-20180919

commit 3c09e3c2199cfe8999333960658dd965d6f07075
Author: Brad Bell <bradbell@…>
Date: Wed Sep 19 13:21:18 2018 -0700

master:
batch_edit.sh: add sorting to plan.
subgraph_reverse.hpp: add missing not_used_rec_base.
whats_new_18.omh: user's view of merge of base2ad.

commit a99fe1dfae5c231c5bdb7334c3d34f4e10c2d6be
Author: Brad Bell <bradbell@…>
Date: Wed Sep 19 11:18:48 2018 -0700

base2ad: extend base2ad atomics to work with reverse mode.

commit 335003af3576234710b793f389111c7e9a09a271
Author: Brad Bell <bradbell@…>
Date: Wed Sep 19 09:08:41 2018 -0700

base2ad: first commit where atomic function forward works with base2ad.

commit 48d85185a34398d35cd4152eaec2423783fb8af9
Author: Brad Bell <bradbell@…>
Date: Wed Sep 19 07:09:17 2018 -0700

master: batch_edit.sh: add to plan.

commit 4d54341db7fdf36e204d065f900582516019e1d5
Author: Brad Bell <bradbell@…>
Date: Wed Sep 19 07:07:39 2018 -0700

base2ad: cahnge result for base2ad to be ADFun< AD<Base>, Base>.

commit 22cb2a4a8566d30802d68a21f19f174675519cd5
Author: Brad Bell <bradbell@…>
Date: Tue Sep 18 10:34:06 2018 -0700

base2ad: Add RecBase? template parameter to ADFun type.


example_list.omh: add missing reference to base2ad.cpp.

commit f96708115f3c09730ce2e30082dfb0255627b476
Author: Brad Bell <bradbell@…>
Date: Mon Sep 17 13:45:26 2018 -0700

master: group user API and non user API functions.

commit 0008c201290460f47361ec8627efcb550f4f9a8b
Merge: d98dbd14 575a5c3f
Author: Brad Bell <bradbell@…>
Date: Mon Sep 17 09:50:57 2018 -0700

Merge branch 'master' into base2ad

commit 575a5c3fd26642da987bb99a374b7967dd634791
Author: Brad Bell <bradbell@…>
Date: Mon Sep 17 08:32:58 2018 -0700

master: user's view of spliting atomic functions into separate files.

commit 1559a985cb77dffbdf59d956264a8d22dd7e1940
Author: Brad Bell <bradbell@…>
Date: Mon Sep 17 07:56:07 2018 -0700

master: Advance to cppad-20180917

commit 74a019e6ff5bf7c60bb66729c2b57439ee611057
Author: Brad Bell <bradbell@…>
Date: Mon Sep 17 07:55:50 2018 -0700

master: split user API part of atomic_base.hpp into separate files.

commit d98dbd14da4993708418f8e001a554bab2e5efd3
Merge: e906f02e 47cc2b4c
Author: Brad Bell <bradbell@…>
Date: Sun Sep 16 17:49:39 2018 -0700

Merge branch 'master' into base2ad

commit 47cc2b4cd8777573b2b42b92a5bdf7962fa05b7c
Author: Brad Bell <bradbell@…>
Date: Sun Sep 16 17:48:49 2018 -0700

master: remove con_ad_type (corresponds to tape_id does not match).

commit e906f02ea898ffda314749ecfb2bcf4152a1da01
Author: Brad Bell <bradbell@…>
Date: Sun Sep 16 07:56:12 2018 -0700

base2ad: change ode_taylor -> taylor_ode.

commit 706cda6e746c150c196352526945e3a46f050c48
Author: Brad Bell <bradbell@…>
Date: Sun Sep 16 07:53:43 2018 -0700

base2ad: make mul_level_adolc_ode.cpp more like base2ad.cpp.

commit c438d447499d2d76b6676155f3c93b86a965dc06
Author: Brad Bell <bradbell@…>
Date: Sun Sep 16 07:33:00 2018 -0700

base2ad: mul_level_ode.cpp: use typedefs and make more like base2ad.cpp.

commit 3f0b37e04057b9a790654c123ec887d805456a39
Merge: 7d7f695e cc02600d
Author: Brad Bell <bradbell@…>
Date: Sun Sep 16 06:46:17 2018 -0700

Merge branch 'master' into base2ad

commit cc02600d325bfd72348a194c45a87ee982ed1320
Author: Brad Bell <bradbell@…>
Date: Sun Sep 16 06:40:43 2018 -0700

master: improve ode_taylor.cpp and move it to taylor_ode.cpp.

commit 97bfaac023564cf34a265c80ddc6b2e4f9dac2c5
Author: Brad Bell <bradbell@…>
Date: Sun Sep 16 06:31:10 2018 -0700

master: change ode_taylor.cpp to use same notation as taylor_ode.omh.

commit 7d7f695e3cb41efb7958632fe5cfd6699cdb2acb
Author: Brad Bell <bradbell@…>
Date: Sun Sep 16 06:00:35 2018 -0700

base2ad: put base2ad in separate file and document it.

commit ac3fdbc24d4836537aa2f845a9ec26b188388991
Author: Brad Bell <bradbell@…>
Date: Sun Sep 16 05:58:45 2018 -0700

base2ad: first working version of base2ad.

commit 78014e8ef632e9fc804ebea74422acf4c64f0c69
Author: Brad Bell <bradbell@…>
Date: Sun Sep 16 04:34:57 2018 -0700

master: Advance to cppad-20180916

commit 0cd2a999f9566655fda723482d2fd060b6867e8e
Author: Brad Bell <bradbell@…>
Date: Sun Sep 16 04:34:47 2018 -0700

master: example general.cpp: include base_require during testing.

commit fdc230eba87cf19312cddd92d5dd66fe2434aa60
Author: Brad Bell <bradbell@…>
Date: Sat Sep 15 15:34:33 2018 -0700

master: move AD theory for Taylor's ODE method to separate section.

commit c02959c71c4ba48ceb54d3caa644c4d4d3e3e320
Author: Brad Bell <bradbell@…>
Date: Sat Sep 15 14:28:45 2018 -0700

master: batch_edit.sh: add to plan.

commit 3e72aad050219ad4993fccc3e2cc94f0abd7c496
Author: Brad Bell <bradbell@…>
Date: Sat Sep 15 08:51:41 2018 -0700

master: fun_construct.hpp: use sparse_pack and sparse_list assignment operators.

commit eb5906dfd75e5fa557ac307dadd0b860c33733ed
Author: Brad Bell <bradbell@…>
Date: Sat Sep 15 07:31:57 2018 -0700

master: improve move semantic version of ADFun assignment operator.

commit b183932db18501467b5ea2e238ccfa737d76020a
Author: Brad Bell <bradbell@…>
Date: Sat Sep 15 06:54:02 2018 -0700

master: add move semantic version of function assignment.

commit 38f8a5a553d2dbbbe7ed8158077548cc80dfe643
Author: Brad Bell <bradbell@…>
Date: Sat Sep 15 06:05:47 2018 -0700

master: ADFun assignment operator: remove resizes that are no longer necessary.

commit 2d4a7245e06a6dc5e3e83ad3e09726340201821e
Author: Brad Bell <bradbell@…>
Date: Sat Sep 15 05:33:18 2018 -0700

master: remove Erase from recorder and player (no longer used).

commit 75736474de93a6064329a9f578ae4f8383b0fa78
Author: Brad Bell <bradbell@…>
Date: Sat Sep 15 05:21:18 2018 -0700

master: ad_fun.hpp: convert dep_parameter_ from vector -> pod_vector.

commit 5ed186c4ecef2958913325694100e5384f03d8ec
Author: Brad Bell <bradbell@…>
Date: Sat Sep 15 05:12:25 2018 -0700

master: Advance to cppad-20180915

commit b99ba06f766d64233b1c0ae66e590d3a189467a6
Author: Brad Bell <bradbell@…>
Date: Sat Sep 15 05:12:14 2018 -0700

master: ad_fun.hpp: change dep_taddr_ and ind_taddr_ from vector -> pod_vector.

commit 7872c7f69a6618176ae76dd2bf64a0fa71a65d14
Author: Brad Bell <bradbell@…>
Date: Fri Sep 14 08:32:22 2018 -0700

master: ad_fun.hpp: add more comments about location of doxygen documentation.

commit 73c0d52cb060ca7bbdc0d2fe6a956f0936fdeed2
Author: Brad Bell <bradbell@…>
Date: Fri Sep 14 07:40:24 2018 -0700

master: Advance to cppad-20180914

commit d24872e359b53a1863bd43af4f3a61ec77c149bf
Author: Brad Bell <bradbell@…>
Date: Fri Sep 14 07:40:14 2018 -0700

master: ad_fun.hpp: use full path when referencing files where doxygen is.

commit bf73b3fc3fa88abab2fc1913515b5525c62d5290
Author: Brad Bell <bradbell@…>
Date: Thu Sep 13 07:54:50 2018 -0700

master: Advance to cppad-20180913

commit 5fb67b72e237e00e021e4e40f08dc4ba6d53c224
Author: Brad Bell <bradbell@…>
Date: Thu Sep 13 07:54:29 2018 -0700

master: wish_list.omh: add AD<Base> Functions from Base Functions item.

commit 690ed2af5feb2d4a36267acf3669d0d02aef6158
Author: Brad Bell <bradbell@…>
Date: Mon Aug 27 12:19:14 2018 -0700

master: move eigen_vector from global namspace to CppAD namespace.

commit 3ac03943e02e60832b1f8a3311a96cf45b810c21
Author: Brad Bell <bradbell@…>
Date: Mon Aug 27 06:29:29 2018 -0700

master: Advance to cppad-20180827

commit a74a90ca37c3c290bbe4c71fb6fffccc5f8b44e3
Author: Brad Bell <bradbell@…>
Date: Mon Aug 27 06:29:17 2018 -0700

master: dynamic parameters: improve discussion and example.

  • Property svn:keywords set to Id
File size: 13.9 KB
Line 
1# -----------------------------------------------------------------------------
2# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 Bradley M. Bell
3#
4# CppAD is distributed under multiple licenses. This distribution is under
5# the terms of the
6#                     Eclipse Public License Version 1.0.
7#
8# A copy of this license is included in the COPYING file of this distribution.
9# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
10# -----------------------------------------------------------------------------
11# =============================================================================
12# Some constants
13# =============================================================================
14# Suppress warnging that WIN32 not defined on cygwin
15SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # remove when version below >= 2.8.4
16#
17# Set the minimum required version of cmake for this project.
18# see http://www.cmake.org/pipermail/cmake/2013-January/053213.html
19CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4)
20#
21# https://gitlab.kitware.com/cmake/cmake/issues/17292
22if(POLICY CMP0054)
23  cmake_policy(SET CMP0054 NEW)
24endif()
25#
26# cppad_version is used by version.sh to get the version number.
27SET(cppad_version "20180923")
28SET(cppad_url          "http://www.coin-or.org/CppAD" )
29SET(cppad_description  "Differentiation of C++ Algorithms" )
30#
31# Set name of this project and create the variables
32# cppad_BINARY_DIR and cppad_SOURCE_DIR.
33# project(projectname [CXX] [C] [Java])
34PROJECT(cppad)
35#
36# Add this directory to the list of C++ preprocessor include directories
37# for the entire project.
38# include_directories([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...)
39INCLUDE_DIRECTORIES( ${cppad_SOURCE_DIR} )
40#
41# =============================================================================
42# Some system cmake language extensions
43# =============================================================================
44# CHECK_CXX_SOURCE_COMPILES(source variable)
45# Checks whether the code given in source will compile, link and run and
46# return zero status. You can set
47# CMAKE_REQUIRED_LIBRARIES, CMAKE_REQUIRED_FLAGS and CMAKE_REQUIRED_INCLUDES
48# accordingly if additional libraries or compiler flags are required.
49INCLUDE(CheckCXXSourceRuns)
50
51# ============================================================================
52# Some local cmake language
53# ============================================================================
54# join strings together
55INCLUDE(cmake/join.cmake)
56#
57# dos_path_to_unix(dos_path unix_path)
58INCLUDE(cmake/dos_path_to_unix.cmake)
59#
60# add_to_list(variable_list constant_value)
61INCLUDE(cmake/add_to_list.cmake)
62#
63# command_line_arg(variable default type description)
64INCLUDE(cmake/command_line_arg.cmake)
65#
66# optional_package(package description)
67INCLUDE(cmake/optional_package.cmake)
68#
69# check_source_runs(source variable)
70INCLUDE(cmake/check_source_runs.cmake)
71#
72# assert(variable)
73INCLUDE(cmake/assert.cmake)
74#
75# print_variable(variable)
76INCLUDE(cmake/print_variable.cmake)
77#
78# set_compile_flags( program_name debug_which source_list)
79INCLUDE(cmake/set_compile_flags.cmake)
80# =============================================================================
81# command line arguments
82# =============================================================================
83# cmake_install_datadir
84command_line_arg(cmake_install_datadir share STRING
85        "directory, below prefix, where cmake installs cppad data files"
86)
87# -----------------------------------------------------------------------------
88# cmake_install_docdir
89command_line_arg(cmake_install_docdir NOTFOUND STRING
90        "directory, below prefix, where cmake installs cppad documentation files"
91)
92# -----------------------------------------------------------------------------
93# cmake_install_includedirs
94command_line_arg(cmake_install_includedirs include STRING
95        "directories, below prefix, where cmake installs include files"
96)
97# -----------------------------------------------------------------------------
98# cmake_install_libdirs
99command_line_arg(cmake_install_libdirs lib STRING
100        "directories, below prefix, where cmake installs library files"
101)
102# -----------------------------------------------------------------------------
103# cppad_prefix
104command_line_arg(cppad_prefix /usr PATH
105        "cppad install prefix"
106)
107SET(CMAKE_INSTALL_PREFIX "${cppad_prefix}"
108        CACHE PATH "value copied from cppad_prefix" FORCE
109)
110IF( cmake_install_prefix )
111        MESSAGE(FATAL_ERROR
112                "cmake_install_prefix has been changed to cppad_prefix"
113        )
114ENDIF( cmake_install_prefix )
115# -----------------------------------------------------------------------------
116# cppad_postfix
117command_line_arg(cppad_postfix NOTFOUND STRING
118        "cppad install postfix"
119)
120IF( cmake_install_postfix )
121        MESSAGE(FATAL_ERROR
122                "cmake_install_postfix has been changed to cppad_postfix"
123        )
124ENDIF( cmake_install_postfix )
125# -----------------------------------------------------------------------------
126# cppad_cxx_flags
127command_line_arg(cppad_cxx_flags "" STRING
128        "compile flags used with cppad (besides debug, release, and profile flags)"
129)
130# -----------------------------------------------------------------------------
131# cppad_profile_flag
132command_line_arg(cppad_profile_flag NOTFOUND STRING
133        "compile flag used to compile and link a profile version of a program"
134)
135# -----------------------------------------------------------------------------
136# External package prefixes with warnings
137SET(system_include FALSE)
138#
139# adolc_prefix
140optional_package(adolc ${system_include} "adolc install prefix")
141#
142# colpack_prefix
143optional_package(colpack ${system_include} "colpack install prefix")
144#
145# ipopt_prefix
146optional_package(ipopt ${system_include} "ipopt install prefix")
147# -----------------------------------------------------------------------------
148# External package prefixes without warnings
149SET(system_include TRUE)
150#
151# sacado_prefix
152optional_package(sacado ${system_include} "sacado install prefix")
153#
154# eigen_prefix
155optional_package(eigen ${system_include} "eigen install prefix")
156#
157# fadbad_prefix
158optional_package(fadbad ${system_include} "fadbad install prefix")
159# -----------------------------------------------------------------------------
160# cppad_testvector
161command_line_arg(cppad_testvector cppad STRING
162        "Namespace of vector used for testing, one of: boost, cppad, eigen, std"
163)
164#
165# cppad_max_num_threads
166command_line_arg(cppad_max_num_threads 48 STRING
167        "maximum number of threads that CppAD can use use"
168)
169# cppad_sparse_list
170IF( cppad_sparse_list )
171        MESSAGE(FATAL_ERROR
172                "cppad_sparse_list = ${cppad_sparse_list}"
173                ": this command line argument has been removed"
174        )
175ENDIF( cppad_sparse_list )
176#
177# cppad_tape_id_type
178command_line_arg(cppad_tape_id_type "unsigned int" STRING
179        "type used to identify different tapes, size must be <= sizeof(size_t)"
180)
181#
182# cppad_tape_addr_type
183command_line_arg(cppad_tape_addr_type "unsigned int" STRING
184"type used to identify variables on one tape, size must be <= sizeof(size_t)"
185)
186#
187# cppad_debug_which
188command_line_arg(cppad_debug_which "debug_all" STRING
189        "debug_even, debug_odd, debug_all, or debug_none"
190)
191# cppad_deprecated
192IF( cppad_deprecated )
193        MESSAGE(FATAL_ERROR "cppad_deprecated has been removed" )
194ENDIF( cppad_deprecated )
195# =============================================================================
196# colpack_libs, cppad_lib
197#
198IF( cppad_has_colpack )
199        SET( colpack_libs "ColPack" )
200        SET( cppad_lib    "cppad_lib" )
201ELSE( cppad_has_colpack )
202        SET( colpack_libs "" )
203        SET( cppad_lib    "" )
204ENDIF( cppad_has_colpack )
205# =============================================================================
206# automated system configuration
207# =============================================================================
208# CMAKE_CXX_FLAGS
209# remove Visual Studio C++ warning level if specified in cppad_cxx_flags
210IF ( cppad_cxx_flags MATCHES "/W[0-9]" )
211        STRING( REGEX REPLACE "/W[0-9]" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} )
212ENDIF ( cppad_cxx_flags MATCHES "/W[0-9]" )
213print_variable(CMAKE_CXX_FLAGS)
214# -----------------------------------------------------------------------------
215# cppad_abs_includedir, cppad_abs_libdir, cppad_abs_datadir, cppad_abs_docdir
216#
217# for dir_types = includedirs, libdirs, datadir, docdir
218FOREACH(dir_types includedirs libdirs datadir docdir)
219        # set dir_type = dir_types with  "dirs" -> "dir"
220        STRING(REGEX REPLACE "dirs" "dir" dir_type ${dir_types})
221        #
222        # set dir_name to first directory in cmake_install_${dir_types}
223        SET(dir_name NOTFOUND)
224        FOREACH(dir ${cmake_install_${dir_types}})
225                IF( NOT dir_name )
226                        SET(dir_name ${dir})
227                ENDIF( NOT dir_name )
228        ENDFOREACH(dir ${cmake_install_${dir_types}})
229        #
230        # set cppad_abs_${dir_type}
231        SET(cppad_abs_${dir_type} "${cppad_prefix}/${dir_name}" )
232        #
233        # check if we need to add a postfix to it
234        IF( cppad_postfix )
235                SET(cppad_abs_${dir_type} ${cppad_abs_${dir_type}}/${cppad_postfix} )
236        ENDIF( cppad_postfix )
237ENDFOREACH(dir_types includedirs libdirs datadir docdir)
238# -----------------------------------------------------------------------------
239# OPENMP_FOUND, OpenMP_CXX_FLAGS
240FIND_PACKAGE(OpenMP)
241# -----------------------------------------------------------------------------
242# boost_prefix
243FIND_PACKAGE(Boost)
244SET(cppad_has_boost 0)
245IF ( Boost_FOUND )
246        SET(cppad_has_boost 1)
247        #
248        # Extract the Boost prefix from Boost_INCLUDE_DIRS
249        #
250        # convert to using unix directory separator
251        dos_path_to_unix("${Boost_INCLUDE_DIRS}" boost_include_dirs)
252        #
253        # convert to just one directory
254        STRING(REGEX REPLACE
255                "([^ ]+).*" "\\1"
256                boost_include_dir "${boost_include_dirs}"
257        )
258        #
259        # extract part before last backslash
260        STRING(REGEX REPLACE
261                "([^ ]*)/[^/ ]*" "\\1"
262                boost_prefix "${boost_include_dir}"
263        )
264        print_variable(boost_prefix)
265        #
266        # add boost include directories
267        FOREACH(dir ${cmake_install_includedirs})
268                IF( IS_DIRECTORY ${boost_prefix}/${dir} )
269                        INCLUDE_DIRECTORIES( ${boost_prefix}/${dir} )
270                        MESSAGE(STATUS "Found ${boost_prefix}/${dir}")
271                ENDIF( IS_DIRECTORY ${boost_prefix}/${dir} )
272        ENDFOREACH( dir )
273        #
274        # add boost link directories
275        FOREACH(dir ${cmake_install_libdirs})
276                IF( IS_DIRECTORY ${boost_prefix}/${dir} )
277                        LINK_DIRECTORIES( ${boost_prefix}/${dir} )
278                        MESSAGE(STATUS "Found ${boost_prefix}/${dir}")
279                ENDIF( IS_DIRECTORY ${boost_prefix}/${dir} )
280        ENDFOREACH( dir )
281ENDIF ( Boost_FOUND )
282# -----------------------------------------------------------------------------
283# ipopt_LIBRARIES and ipopt_LIBRARY_DIRS
284IF( cppad_has_ipopt )
285        FIND_PACKAGE(PkgConfig)
286        IF( NOT PKG_CONFIG_FOUND )
287                MESSAGE(FATAL_ERROR "Using ipopt_prefix but cannot find pkg-config")
288        ENDIF( NOT PKG_CONFIG_FOUND )
289        #
290        # Set the system environment variable PKG_CONFIG_PATH
291        FOREACH(dir ${cmake_install_libdirs})
292                IF(EXISTS "${ipopt_prefix}/${dir}/pkgconfig/ipopt.pc")
293                        SET( ENV{PKG_CONFIG_PATH} ${ipopt_prefix}/${dir}/pkgconfig )
294                ENDIF(EXISTS "${ipopt_prefix}/${dir}/pkgconfig/ipopt.pc")
295        ENDFOREACH(dir)
296        #
297        # pkg_check_modules(<PREFIX> [REQUIRED] <MODULE> [<MODULE>]*)
298        # ipopt_LIBRARIES      ... only the libraries (w/o the '-l')
299        # ipopt_LIBRARY_DIRS   ... the paths of the libraries (w/o the '-L')
300        pkg_check_modules(ipopt ipopt)
301        IF( NOT ipopt_FOUND )
302                MESSAGE(FATAL_ERROR
303"For all directories dir in cmake_install_libdirs, cannot find the file
304        ipopt_prefix/dir/pkgconfig/ipopt.pc
305where
306        ipopt_prefix = ${ipopt_prefix}
307        cmake_install_libdirs = ${cmake_install_libdirs}
308"
309                )
310        ENDIF( NOT ipopt_FOUND )
311ENDIF( cppad_has_ipopt )
312# =============================================================================
313# Currently building tests as normal executables
314# =============================================================================
315# The CMakeLists.txt file in the specified source directory is processed
316# before the current input file continues beyond this command.
317# add_subdirectory(source_dir [binary_dir] [EXCLUDE_FROM_ALL])
318#
319# Initialize list of tests as empty
320SET(check_depends "")
321#
322# directories with no check depends entries
323ADD_SUBDIRECTORY(cppad)
324ADD_SUBDIRECTORY(pkgconfig)
325IF( cppad_has_colpack )
326        ADD_SUBDIRECTORY(cppad_lib)
327ENDIF( cppad_has_colpack )
328#
329IF( NOT ( "${check_depends}" STREQUAL "" ) )
330        MESSAGE(FATAL_ERROR "Error in CMakeLists.txt scripts")
331ENDIF( NOT ( "${check_depends}" STREQUAL "" ) )
332#
333# directories with check depends entries
334ADD_SUBDIRECTORY(example)
335ADD_SUBDIRECTORY(introduction)
336ADD_SUBDIRECTORY(test_more)
337ADD_SUBDIRECTORY(speed)
338IF( cppad_has_ipopt )
339        ADD_SUBDIRECTORY(cppad_ipopt)
340ENDIF( cppad_has_ipopt )
341#
342ADD_CUSTOM_TARGET(check DEPENDS ${check_depends})
343MESSAGE(STATUS "make check: avialable")
344# ============================================================================
345# Copy a file to another location and modify its contents.
346# configure_file(InputFile OutputFile [COPYONLY] [ESCAPE_QUOTES] [@ONLY])
347CONFIGURE_FILE(
348        ${CMAKE_CURRENT_SOURCE_DIR}/bin/test_one.sh.in
349        ${CMAKE_CURRENT_SOURCE_DIR}/bin/test_one.sh
350)
351# =============================================================================
352# install procedure
353# =============================================================================
354# install(DIRECTORY dirs... DESTINATION <dir>
355#       [FILE_PERMISSIONS permissions...]
356#       [DIRECTORY_PERMISSIONS permissions...]
357#       [USE_SOURCE_PERMISSIONS] [OPTIONAL]
358#       [CONFIGURATIONS [Debug|Release|...]]
359#       [COMPONENT <component>] [FILES_MATCHING]
360#       [[PATTERN <pattern> | REGEX <regex>]
361#       [EXCLUDE] [PERMISSIONS permissions...]] [...]
362# )
363# Note a trailing / in the source directory name drops the source directory
364# name during the copy.
365#
366# During install copy all the cppad include files to
367# ${cppad_abs_includedir}/cppad
368INSTALL(
369        DIRECTORY "${CMAKE_SOURCE_DIR}/cppad/"
370        DESTINATION ${cppad_abs_includedir}/cppad
371        FILES_MATCHING PATTERN "*.hpp"
372)
373#
374# During install copy doc direcrory to cppad_abs_docdir/cppad
375IF ( cmake_install_docdir )
376        INSTALL( DIRECTORY "doc/" DESTINATION ${cppad_abs_docdir}/cppad )
377ENDIF ( cmake_install_docdir )
378#
379IF( ${cppad_deprecated} )
380        STRING( TOLOWER "${cppad_deprecated}" temp )
381        IF( "${temp}" STREQUAL "yes" )
382                MESSAGE(FATAL_ERROR
383                "cppad_deprecated = YES has been removed; see whats_new 2017-02-10."
384                )
385        ENDIF( "${temp}" STREQUAL "yes" )
386        MESSAGE(FATAL_ERROR
387                "cppad_deprecated = ${cppad_deprecated} not a valid choice"
388        )
389ENDIF( ${cppad_deprecated} )
Note: See TracBrowser for help on using the repository browser.