source: branches/cache/cmake/add_cppad_cxx_flags.cmake @ 3324

Last change on this file since 3324 was 3324, checked in by bradbell, 6 years ago

merge trunk changes into cache

  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1# $Id: add_cppad_cxx_flags.cmake 3324 2014-09-12 12:14:53Z 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# -----------------------------------------------------------------------------
13# add_cppad_cxx_flags(target_name)
14#
15# target_name: (in)
16# For package equal to "eigen", "fadbad", "scaado", if target_name ends in
17# _package, the compiler flags for this target are set to
18#       cppad_cxx_flags_package
19# Otherwise, the compiler flags for this target are set to
20#       cppad_cxx_flags.
21#
22# Side Effects:
23# The variables package and flags are used for scratch space and not
24# defined after the completion of this macro.
25#
26MACRO(add_cppad_cxx_flags target_name) 
27        #
28        SET(flags ${cppad_cxx_flags})
29        FOREACH(package eigen fadbad sacado)
30                IF( ${target_name} MATCHES ".*_${package}$" )
31                        SET(flags "${cppad_cxx_flags_${package}}")
32                        MESSAGE(STATUS 
33                                "${target_name} cxx_flags = ${cppad_cxx_flags_${package}}"
34                        )
35                ENDIF( ${target_name} MATCHES ".*_${package}$" )
36                IF( ${target_name} MATCHES ".*_${package}_lib$" )
37                        SET(flags "${cppad_cxx_flags_${package}}")
38                        MESSAGE(STATUS 
39                                "${target_name} cxx_flags = ${cppad_cxx_flags_${package}}"
40                        )
41                ENDIF( ${target_name} MATCHES ".*_${package}_lib$" )
42        ENDFOREACH(package)
43        IF( flags )
44                SET_TARGET_PROPERTIES( 
45                        ${target_name} PROPERTIES COMPILE_FLAGS "${flags}"
46                )
47        ELSE( flags )
48                SET_TARGET_PROPERTIES( 
49                        ${target_name} PROPERTIES COMPILE_FLAGS ""
50                )
51        ENDIF( flags )
52ENDMACRO(add_cppad_cxx_flags) 
Note: See TracBrowser for help on using the repository browser.