mirror of https://github.com/CGAL/cgal
LEDA Version is detected also when path and lib are passed by cmake-arguments
This commit is contained in:
parent
d272355dc3
commit
86fe5c6df1
|
|
@ -53,34 +53,35 @@ else()
|
|||
if ( NOT LEDA_LINKER_FLAGS )
|
||||
typed_cache_set( STRING "Linker flags for the LEDA library" LEDA_LINKER_FLAGS "$ENV{LEDA_LINKER_FLAGS}" )
|
||||
endif()
|
||||
|
||||
set( LEDA_BASIC_H "${LEDA_INCLUDE_DIR}/LEDA/system/basic.h" )
|
||||
if ( NOT EXISTS ${LEDA_BASIC_H} )
|
||||
set( LEDA_BASIC_H "${LEDA_INCLUDE_DIR}/LEDA/basic.h" )
|
||||
endif()
|
||||
|
||||
if ( EXISTS ${LEDA_BASIC_H} )
|
||||
|
||||
file(READ "${LEDA_BASIC_H}" LEDA_BASIC_H_CONTENTS)
|
||||
|
||||
string(REGEX REPLACE ".*#define __LEDA__ ([0-9]+).*" "\\1" LEDA_VERSION "${LEDA_BASIC_H_CONTENTS}")
|
||||
|
||||
message( STATUS "USING LEDA_VERSION = '${LEDA_VERSION}'" )
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ( NOT LEDA_VERSION AND NOT "$ENV{LEDA_VERSION}" STREQUAL "" )
|
||||
typed_cache_set( STRING "The version of the LEDA library" LEDA_VERSION "$ENV{LEDA_VERSION}" )
|
||||
endif()
|
||||
set( LEDA_BASIC_H "${LEDA_INCLUDE_DIR}/LEDA/system/basic.h" )
|
||||
if ( NOT EXISTS ${LEDA_BASIC_H} )
|
||||
set( LEDA_BASIC_H "${LEDA_INCLUDE_DIR}/LEDA/basic.h" )
|
||||
endif()
|
||||
|
||||
if ( EXISTS ${LEDA_BASIC_H} )
|
||||
|
||||
if ( LEDA_VERSION )
|
||||
if ( NOT "${LEDA_DEFINITIONS}" MATCHES "-DCGAL_LEDA_VERSION=${LEDA_VERSION}" )
|
||||
typed_cache_set( STRING "Definitions for the LEDA library" LEDA_DEFINITIONS "${LEDA_DEFINITIONS}" "-DCGAL_LEDA_VERSION=${LEDA_VERSION}" )
|
||||
endif()
|
||||
endif()
|
||||
file(READ "${LEDA_BASIC_H}" LEDA_BASIC_H_CONTENTS)
|
||||
|
||||
if ( LEDA_INCLUDE_DIR AND LEDA_LIBRARIES)
|
||||
set(LEDA_FOUND TRUE)
|
||||
endif()
|
||||
string(REGEX REPLACE ".*#define __LEDA__ ([0-9]+).*" "\\1" LEDA_VERSION "${LEDA_BASIC_H_CONTENTS}")
|
||||
|
||||
message( STATUS "USING LEDA_VERSION = '${LEDA_VERSION}'" )
|
||||
|
||||
endif()
|
||||
|
||||
if ( NOT LEDA_VERSION AND NOT "$ENV{LEDA_VERSION}" STREQUAL "" )
|
||||
typed_cache_set( STRING "The version of the LEDA library" LEDA_VERSION "$ENV{LEDA_VERSION}" )
|
||||
endif()
|
||||
|
||||
if ( LEDA_VERSION )
|
||||
if ( NOT "${LEDA_DEFINITIONS}" MATCHES "-DCGAL_LEDA_VERSION=${LEDA_VERSION}" )
|
||||
typed_cache_set( STRING "Definitions for the LEDA library" LEDA_DEFINITIONS "${LEDA_DEFINITIONS}" "-DCGAL_LEDA_VERSION=${LEDA_VERSION}" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ( LEDA_INCLUDE_DIR AND LEDA_LIBRARIES)
|
||||
set(LEDA_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue