2010-08-18 15:34:47 -05:00
|
|
|
# - Find the LEF/DEF includes and libraries.
|
|
|
|
# The following variables are set if LEF/DEF is found. If LEF/DEF is not
|
|
|
|
# found, LEFDEF_FOUND is set to false.
|
|
|
|
# LEFDEF_FOUND - True when LEF/DEF is found.
|
|
|
|
# LEFDEF_INCLUDE_DIR - the path to where the LEF/DEF include files are.
|
|
|
|
# LEFDEF_LIBRARIES - The path to where the LEF/DEF library files are.
|
|
|
|
#
|
|
|
|
# The DEF C API library: LEFDEF_CDEF_LIBRARY
|
|
|
|
# LEFDEF_CDEF_LIBRARY_RELEASE
|
|
|
|
#
|
|
|
|
# The DEF C API library (zlib) : LEFDEF_ZCDEF_LIBRARY
|
|
|
|
# LEFDEF_ZCDEF_LIBRARY_RELEASE
|
|
|
|
#
|
|
|
|
# The DEF C++ API library: LEFDEF_DEF_LIBRARY
|
|
|
|
# LEFDEF_DEF_LIBRARY_RELEASE
|
|
|
|
#
|
|
|
|
# The DEF C++ API library (zlib) : LEFDEF_ZDEF_LIBRARY
|
|
|
|
# LEFDEF_ZDEF_LIBRARY_RELEASE
|
|
|
|
#
|
|
|
|
# The LEF C API library: LEFDEF_CLEF_LIBRARY
|
|
|
|
# LEFDEF_CLEF_LIBRARY_RELEASE
|
|
|
|
#
|
|
|
|
# The LEF C API library (zlib) : LEFDEF_ZCLEF_LIBRARY
|
|
|
|
# LEFDEF_ZCLEF_LIBRARY_RELEASE
|
|
|
|
#
|
|
|
|
# The LEF C++ API library: LEFDEF_LEF_LIBRARY
|
|
|
|
# LEFDEF_LEF_LIBRARY_RELEASE
|
|
|
|
#
|
|
|
|
# The LEF C++ API library (zlib) : LEFDEF_ZLEF_LIBRARY
|
|
|
|
# LEFDEF_ZLEF_LIBRARY_RELEASE
|
|
|
|
|
2017-10-30 09:38:29 -05:00
|
|
|
# Try to find a reasonable CORIOLIS_TOP value.
|
|
|
|
if( NOT("$ENV{CORIOLIS_USER_TOP}" STREQUAL "") )
|
|
|
|
set ( CORIOLIS_USER_TOP "$ENV{CORIOLIS_USER_TOP}" )
|
|
|
|
else( NOT("$ENV{CORIOLIS_USER_TOP}" STREQUAL "") )
|
|
|
|
if( NOT("$ENV{CORIOLIS_TOP}" STREQUAL "") )
|
|
|
|
set ( CORIOLIS_TOP "$ENV{CORIOLIS_TOP}" )
|
|
|
|
endif( NOT("$ENV{CORIOLIS_TOP}" STREQUAL "") )
|
|
|
|
endif( NOT("$ENV{CORIOLIS_USER_TOP}" STREQUAL "") )
|
2010-08-18 15:34:47 -05:00
|
|
|
|
|
|
|
|
2017-10-30 09:38:29 -05:00
|
|
|
macro( _find_lefdef_lib varname libname )
|
|
|
|
find_library( LEFDEF_${varname}_LIBRARY_RELEASE NAMES ${libname} PATHS ${LEFDEF_LIBRARY_DIR} )
|
|
|
|
|
|
|
|
if( LEFDEF_${varname}_LIBRARY_RELEASE )
|
|
|
|
set( LEFDEF_${varname}_LIBRARY_DEBUG ${LEFDEF_${varname}_LIBRARY_RELEASE} CACHE STRING "Path to a library" FORCE )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if( LEFDEF_${varname}_LIBRARY_RELEASE )
|
|
|
|
list( APPEND LEFDEF_LIBRARIES "optimized" ${LEFDEF_${varname}_LIBRARY_RELEASE}
|
|
|
|
"debug" ${LEFDEF_${varname}_LIBRARY_DEBUG} )
|
|
|
|
set( LEFDEF_${varname}_LIBRARY_FOUND 1 )
|
|
|
|
mark_as_advanced( LEFDEF_${varname}_LIBRARY_RELEASE
|
|
|
|
LEFDEF_${varname}_LIBRARY_DEBUG )
|
|
|
|
else()
|
|
|
|
set ( LEFDEF_FOUND "NO" )
|
|
|
|
endif()
|
|
|
|
endmacro()
|
2010-08-18 15:34:47 -05:00
|
|
|
|
|
|
|
|
2017-10-30 09:38:29 -05:00
|
|
|
set( LEFDEF_INCLUDE_DIR_DESCRIPTION "directory containing the LEF/DEF include files. E.g /opt/lefdef-5.6/include" )
|
|
|
|
set( LEFDEF_LIBRARY_DIR_DESCRIPTION "directory containing the LEF/DEF library files. E.g /opt/lefdef-5.6/lib" )
|
|
|
|
set( LEFDEF_DIR_MESSAGE "Set the LEFDEF_INCLUDE_DIR cmake cache entry to the ${LEFDEF_INCLUDE_DIR_DESCRIPTION}" )
|
2010-08-18 15:34:47 -05:00
|
|
|
|
|
|
|
|
|
|
|
# Don't even bother under Win32
|
2017-10-30 09:38:29 -05:00
|
|
|
if( UNIX )
|
|
|
|
set( LEFDEF_FOUND "YES" )
|
|
|
|
set( LEFDEF_SEARCH_PATH "$ENV{CORIOLIS_TOP}"
|
|
|
|
"$ENV{LEFDEF_TOP}"
|
2010-08-18 15:34:47 -05:00
|
|
|
"/usr"
|
2017-10-30 09:38:29 -05:00
|
|
|
"/opt/lefdef-5.8"
|
2010-08-18 15:34:47 -05:00
|
|
|
"/opt/lefdef-5.7"
|
2017-10-30 09:38:29 -05:00
|
|
|
"/opt/lefdef-5.6"
|
2015-06-07 07:12:00 -05:00
|
|
|
"/opt/lefdef"
|
|
|
|
"$ENV{HOME}/oa/lefdef/5.7-s038"
|
2015-06-12 09:27:29 -05:00
|
|
|
"/soc/oa"
|
2015-06-07 07:12:00 -05:00
|
|
|
)
|
2017-10-30 09:38:29 -05:00
|
|
|
message( "-- Components of LEFDEF_DIR_SEARCH:" )
|
2017-11-17 08:32:30 -06:00
|
|
|
foreach( PATH ${LEFDEF_SEARCH_PATH} )
|
2017-10-30 09:38:29 -05:00
|
|
|
message( "-- ${PATH}" )
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
set( LEFDEF_LIBRARIES "" )
|
|
|
|
set( LEFDEF_LIBRARY_SEARCH_PATH "" )
|
|
|
|
|
2017-11-17 08:32:30 -06:00
|
|
|
find_path( LEFDEF_INCLUDE_DIR NAMES "defiDefs.hpp"
|
2010-08-18 15:34:47 -05:00
|
|
|
PATHS ${LEFDEF_SEARCH_PATH}
|
2017-11-17 08:32:30 -06:00
|
|
|
PATH_SUFFIXES "include/lefdef" "include"
|
2010-08-18 15:34:47 -05:00
|
|
|
DOC "The ${LEFDEF_INCLUDE_DIR_DESCRIPTION}" )
|
2017-10-30 09:38:29 -05:00
|
|
|
message( STATUS "LEFDEF_INCLUDE_DIR: ${LEFDEF_INCLUDE_DIR}" )
|
|
|
|
|
2017-11-27 07:16:10 -06:00
|
|
|
find_path( LEFDEF_LIBRARY_DIR NAMES "libdef.so"
|
2015-06-07 07:12:00 -05:00
|
|
|
PATHS ${LEFDEF_SEARCH_PATH}
|
2010-08-25 06:57:11 -05:00
|
|
|
PATH_SUFFIXES "lib${LIB_SUFFIX}"
|
2010-08-18 15:34:47 -05:00
|
|
|
DOC "The ${LEFDEF_LIBRARY_DIR_DESCRIPTION}" )
|
2017-10-30 09:38:29 -05:00
|
|
|
message( STATUS "LEFDEF_LIBRARY_DIR: ${LEFDEF_LIBRARY_DIR}" )
|
|
|
|
|
|
|
|
if( LEFDEF_INCLUDE_DIR AND LEFDEF_LIBRARY_DIR )
|
2017-11-26 13:02:54 -06:00
|
|
|
#_find_lefdef_lib( "CDEF" "cdef" )
|
|
|
|
#_find_lefdef_lib( "ZCDEF" "cdefzlib" )
|
2017-10-30 09:38:29 -05:00
|
|
|
_find_lefdef_lib( "DEF" "def" )
|
|
|
|
_find_lefdef_lib( "ZDEF" "defzlib" )
|
2017-11-26 13:02:54 -06:00
|
|
|
#_find_lefdef_lib( "CLEF" "clef" )
|
|
|
|
#_find_lefdef_lib( "ZCLEF" "clefzlib" )
|
2017-10-30 09:38:29 -05:00
|
|
|
_find_lefdef_lib( "LEF" "lef" )
|
|
|
|
_find_lefdef_lib( "ZLEF" "lefzlib" )
|
|
|
|
else()
|
|
|
|
set( LEFDEF_FOUND "NO" )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if( LEFDEF_FOUND )
|
|
|
|
add_definitions( -DHAVE_LEFDEF )
|
|
|
|
if( NOT LEFDEF_FIND_QUIETLY )
|
|
|
|
message( STATUS "Found LEF/DEF" )
|
|
|
|
endif()
|
|
|
|
else( LEFDEF_FOUND )
|
|
|
|
set( LEFDEF_LIBRARIES "" )
|
|
|
|
set( LEFDEF_INCLUDE_DIR "" )
|
|
|
|
set( LEFDEF_LIBRARY_DIR "" )
|
|
|
|
if( LEFDEF_FIND_REQUIRED )
|
|
|
|
message( STATUS "LEF/DEF libraries and/or includes NOT found!" )
|
|
|
|
endif()
|
|
|
|
endif( LEFDEF_FOUND )
|
|
|
|
|
|
|
|
mark_as_advanced( LEFDEF_INCLUDE_DIR LEFDEF_LIBRARY_DIR LEFDEF_LIBRARIES )
|
|
|
|
endif( UNIX )
|