FindTAO.cmake 2.19 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
if (TAO_INCLUDE_DIRS)
  # Already in cache, be silent
  SET(TAO_FIND_QUIETLY TRUE)
endif (TAO_INCLUDE_DIRS)

if (WIN32)
   find_path(TAO_INCLUDE_DIR NAMES tao.h
     PREFIXES SRC
     PATHS
     "C:\\libs\\gurobi45"
     ${TAO_DIR}/include
   )

   find_library( TAO_LIBRARY_RELEASE 
                 SuperLU
                 PATHS "C:\\libs\\gurobi45\\lib" )
   find_library( TAO_LIBRARY_DEBUG
                   SuperLUd
                   PATHS "C:\\libs\\gurobi45\\lib" )


   set ( TAO_LIBRARY "optimized;${TAO_LIBRARY_RELEASE};debug;${TAO_LIBRARY_DEBUG}" CACHE  STRING "TAO Libraries" )

ELSEIF(APPLE)

   find_path(TAO_INCLUDE_DIR NAMES gurobi_c++.h
	     PATHS "${CMAKE_SOURCE_DIR}/MacOS/Libs/gurobi40"
	     	   ${TAO_INCLUDE_PATH}
            )

   find_library( TAO_LIBRARY 
                 SuperLU
                 PATHS "${CMAKE_SOURCE_DIR}/MacOS/Libs/gurobi40")

ELSE( WIN32 )
find_path(TAO_INCLUDE_DIR NAMES "include/tao.h"
     PATHS "$ENV{TAO_DIR}"
     /usr/include/tao
   )
40
   
41 42 43 44 45 46

#   MESSAGE(STATUS "$ENV{TAO_HOME}/include")
   IF(TAO_INCLUDE_DIR)
      SET(TAO_FOUND TRUE)
      SET(TAO_INCLUDE_DIRS "${TAO_INCLUDE_DIR}/include;${TAO_INCLUDE_DIR}")
      SET(TAO_INCLUDE_DIR ${TAO_INCLUDE_DIR}/include;${TAO_INCLUDE_DIR} CACHE PATH "Path to TAO Includes")
47 48 49 50 51 52 53 54 55 56 57 58 59
      
      #check VERSION 1.x or 2
      IF(IS_DIRECTORY "$ENV{TAO_DIR}/lib/$ENV{PETSC_ARCH}/")
#        MESSAGE(STATUS "TAO Version 1.x")
	SET(TAO_LIBRARY_DIR "$ENV{TAO_DIR}/lib/$ENV{PETSC_ARCH}/" CACHE PATH "Path to TAO Library")
	SET(TAO_LIBRARY "tao;taopetsc;taofortran" CACHE STRING "TAO Libraries")  
      ELSE(IS_DIRECTORY "$ENV{TAO_DIR}/lib/$ENV{PETSC_ARCH}/") #VERSION 2
#        MESSAGE(STATUS "TAO Version 2.x")
	SET(TAO_LIBRARY_DIR "$ENV{TAO_DIR}/$ENV{PETSC_ARCH}/lib" CACHE PATH "Path to TAO Library")
	SET(TAO_LIBRARY "tao" CACHE STRING "TAO Libraries")  
      ENDIF(IS_DIRECTORY "$ENV{TAO_DIR}/lib/$ENV{PETSC_ARCH}/")
      
      #      MESSAGE(STATUS "${TAO_LIBRARY_DIR}")
60 61 62 63 64 65 66 67 68 69
#      MESSAGE(STATUS "${TAO_LIBRARY}")
    ELSE(TAO_INCLUDE_DIR)
      SET(TAO_FOUND FALSE)
      SET(TAO_INCLUDE_DIR ${TAO_INCLUDE_DIR})
    ENDIF(TAO_INCLUDE_DIR)

   #find_library( TAO_LIBRARY 
    #             gurobi
     #            PATHS "${TAO_HOME}/lib" )
ENDIF()