source: trunk/cmake/add_cppad_cxx_flags.cmake @ 2859

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

merge in changes from branches/atomic; see bin/svn_merge.sh

  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1# $Id: add_cppad_cxx_flags.cmake 2859 2013-05-28 06:03:21Z 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                ENDIF( ${target_name} MATCHES ".*_${package}$" )
33        ENDFOREACH(package)
34        IF( flags )
35                SET_TARGET_PROPERTIES( 
36                        ${target_name} PROPERTIES COMPILE_FLAGS "${flags}"
37                )
38        ELSE( flags )
39                SET_TARGET_PROPERTIES( 
40                        ${target_name} PROPERTIES COMPILE_FLAGS ""
41                )
42        ENDIF( flags )
43ENDMACRO(add_cppad_cxx_flags) 
Note: See TracBrowser for help on using the repository browser.