source: trunk/cmake/optional_package.cmake @ 3803

Last change on this file since 3803 was 3803, checked in by bradbell, 4 years ago

merge to branch: trunk
from repository: https://github.com/coin-or/CppAD
start hash code: d75b0cba62a41b958b974a326168299773bc4614
end hash code: 8dd8b10d36b325a3f4bbf3c03f1ea00e288331ae

commit 8dd8b10d36b325a3f4bbf3c03f1ea00e288331ae
Author: Brad Bell <bradbell@…>
Date: Fri Mar 18 20:25:17 2016 -0700

  1. replace multiple */test_one.sh.in by one bin/test_one.sh.
  2. remove test_one.sh.in from auto-tools build.

commit e524af11d04938103d42963e393b3637616dc278
Author: Brad Bell <bradbell@…>
Date: Fri Mar 18 10:02:38 2016 -0700

Move solve.cpp -> ipopt_solve.cpp so has same name as its directory.

commit 4714099e4eef9226536760e206f988440eec2f48
Author: Brad Bell <bradbell@…>
Date: Fri Mar 18 09:50:37 2016 -0700

Use system include option to supress all warnings in eigen and fadbad source.

  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1# $Id: optional_package.cmake 3803 2016-03-19 05:07:48Z bradbell $
2# -----------------------------------------------------------------------------
3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-16 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# optional_package(prefix_variable system_include description)
13#
14# prefix_variable: (out)
15# is a PATH variable that holds the install prefix for this optional package.
16#
17# system_include: (in)
18# If this is true, the include files for this package should be treated as
19# system files (no warnings).
20#
21# description: (in)
22# is a description for the install prefix for this optional package.
23#
24# If package_variable is not set by the cmake command line (or gui),
25# it is set to the default value NOTFOUND.
26#
27# If package_variable is set by the cmake command line, the following is done:
28# 1. All the valid include subdirectories are added using INCLUDE_DIRECTORIES.
29# 2. All the valid library subdirectories are added using LINK_DIRECTORIES.
30# The set of valid include and library directories are determined by
31# cmake_install_includedirs and cmakd_install_libdirs respectively.
32#
33# description: (in)
34#
35MACRO(optional_package prefix_variable system_include description)
36        SET(${prefix_variable} NOTFOUND CACHE PATH "${description}")
37        SET(prefix ${${prefix_variable}} )
38        MESSAGE(STATUS "${prefix_variable} = ${prefix}")
39        IF ( prefix )
40                # List of preprocessor include file search directories
41                FOREACH(dir ${cmake_install_includedirs})
42                        IF(IS_DIRECTORY ${prefix}/${dir} )
43                                IF( ${system_include} )
44                                        INCLUDE_DIRECTORIES( SYSTEM ${prefix}/${dir} )
45                                        MESSAGE(STATUS "    Found SYSTEM ${prefix}/${dir}")
46                                ELSE( ${system_include} )
47                                        INCLUDE_DIRECTORIES( ${prefix}/${dir} )
48                                        MESSAGE(STATUS "    Found ${prefix}/${dir}")
49                                ENDIF( ${system_include} )
50                        ENDIF(IS_DIRECTORY ${prefix}/${dir} )
51                ENDFOREACH(dir)
52                # Paths in which the linker will search for libraries,
53                # only applies to targets created after it is called
54                FOREACH(dir ${cmake_install_libdirs})
55                        IF(IS_DIRECTORY ${prefix}/${dir} )
56                                LINK_DIRECTORIES( ${prefix}/${dir} )
57                                MESSAGE(STATUS "    Found ${prefix}/${dir}")
58                        ENDIF(IS_DIRECTORY ${prefix}/${dir} )
59                ENDFOREACH(dir)
60        ENDIF ( prefix )
61ENDMACRO(optional_package)
Note: See TracBrowser for help on using the repository browser.