FindCOINUTILS.cmake 2.06 KB
Newer Older
David Bommes's avatar
David Bommes committed
1
2
3
4
5
6
# - Try to find COINUTILS
# Once done this will define
#  COINUTILS_FOUND - System has COINUTILS
#  COINUTILS_INCLUDE_DIRS - The COINUTILS include directories
#  COINUTILS_LIBRARIES - The libraries needed to use COINUTILS

Jan Möbius's avatar
Jan Möbius committed
7
8
9
10
11
12
13
14
15
16
17
# I8 Search paths for windows libraries
if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*Win64" )
  SET(VS_SEARCH_PATH "c:/libs/vs2012/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
  SET(VS_SEARCH_PATH "c:/libs/vs2012/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*Win64" )
  SET(VS_SEARCH_PATH "c:/libs/vs2013/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*" )
  SET(VS_SEARCH_PATH "c:/libs/vs2013/x32/")
endif()

David Bommes's avatar
David Bommes committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
if (COINUTILS_INCLUDE_DIR)
  # in cache already
  set(COINUTILS_FOUND TRUE)
  set(COINUTILS_INCLUDE_DIRS "${COINUTILS_INCLUDE_DIR}" )
  set(COINUTILS_LIBRARIES "${COINUTILS_LIBRARY}" )
else (COINUTILS_INCLUDE_DIR)

find_path(COINUTILS_INCLUDE_DIR 
          NAMES CoinUtilsConfig.h
          PATHS "$ENV{COINUTILS_DIR}/include/coin"
                "$ENV{CBC_DIR}/include/coin"
                 "/usr/include/coin"
                 "C:\\libs\\coinutils\\include"
                 "C:\\libs\\cbc\\include"
Jan Möbius's avatar
Jan Möbius committed
32
				 "${VS_SEARCH_PATH}\\CBC-2.9.4\\CoinUtils\\include"
David Bommes's avatar
David Bommes committed
33
34
35
36
37
38
39
40
41
42
43
          )

find_library( COINUTILS_LIBRARY 
              NAMES CoinUtils

              PATHS "$ENV{COINUTILS_DIR}/lib"
                    "$ENV{CBC_DIR}/lib" 
                    "/usr/lib"
                    "/usr/lib/coin"
                    "C:\\libs\\coinutils\\lib"
                    "C:\\libs\\cbc\\lib"
Jan Möbius's avatar
Jan Möbius committed
44
					"${VS_SEARCH_PATH}\\CBC-2.9.4\\CoinUtils\\include"
David Bommes's avatar
David Bommes committed
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
              )

set(COINUTILS_INCLUDE_DIRS "${COINUTILS_INCLUDE_DIR}" )
set(COINUTILS_LIBRARIES "${COINUTILS_LIBRARY}" )


include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set COINUTILS_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(COINUTILS  DEFAULT_MSG
                                  COINUTILS_LIBRARY COINUTILS_INCLUDE_DIR)

mark_as_advanced(COINUTILS_INCLUDE_DIR COINUTILS_LIBRARY)

endif(COINUTILS_INCLUDE_DIR)