mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 19:29:47 +02:00
extended support for lua to v5.3; removed some duplicate messages showing up during 'cmake configuration' time
This commit is contained in:
@@ -25,50 +25,47 @@ INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR)
|
||||
|
||||
IF(CURL_FOUND)
|
||||
SET(CURL_LIBRARIES ${CURL_LIBRARY})
|
||||
SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
|
||||
|
||||
SET(CURL_LIBRARIES ${CURL_LIBRARY})
|
||||
SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
|
||||
# IF we are using a system that supports curl-config use it
|
||||
# and force using static libs
|
||||
IF(UNIX AND NOT APPLE)
|
||||
FIND_PROGRAM( CMAKE_CURL_CONFIG curl-config)
|
||||
MARK_AS_ADVANCED(CMAKE_CURL_CONFIG)
|
||||
|
||||
# IF we are using a system that supports curl-config use it
|
||||
# and force using static libs
|
||||
IF(UNIX AND NOT APPLE)
|
||||
FIND_PROGRAM( CMAKE_CURL_CONFIG curl-config)
|
||||
MARK_AS_ADVANCED(CMAKE_CURL_CONFIG)
|
||||
IF(CMAKE_CURL_CONFIG)
|
||||
OPTION(WANT_STATIC_LIBS "builds as many static libs as possible" OFF)
|
||||
OPTION(FORCE_CURL_DYNAMIC_LIBS "force the use of dynamic libs for CURL" OFF)
|
||||
MESSAGE(STATUS "Force Curl dynamic: ${FORCE_CURL_DYNAMIC_LIBS}")
|
||||
|
||||
IF(CMAKE_CURL_CONFIG)
|
||||
OPTION(WANT_STATIC_LIBS "builds as many static libs as possible" OFF)
|
||||
OPTION(FORCE_CURL_DYNAMIC_LIBS "force the use of dynamic libs for CURL" OFF)
|
||||
MESSAGE(STATUS "Force Curl dynamic: ${FORCE_CURL_DYNAMIC_LIBS}")
|
||||
IF(WANT_STATIC_LIBS AND NOT FORCE_CURL_DYNAMIC_LIBS)
|
||||
# run the curl-config program to get --static-libs
|
||||
EXEC_PROGRAM(sh
|
||||
ARGS "${CMAKE_CURL_CONFIG} --static-libs"
|
||||
OUTPUT_VARIABLE CURL_STATIC_LIBS
|
||||
RETURN_VALUE RET)
|
||||
|
||||
IF(WANT_STATIC_LIBS AND NOT FORCE_CURL_DYNAMIC_LIBS)
|
||||
# run the curl-config program to get --static-libs
|
||||
EXEC_PROGRAM(sh
|
||||
ARGS "${CMAKE_CURL_CONFIG} --static-libs"
|
||||
OUTPUT_VARIABLE CURL_STATIC_LIBS
|
||||
RETURN_VALUE RET)
|
||||
MESSAGE(STATUS "CURL RET = ${RET} libs: [${CURL_STATIC_LIBS}]")
|
||||
ELSE()
|
||||
SET(RET 1)
|
||||
ENDIF()
|
||||
|
||||
MESSAGE(STATUS "CURL RET = ${RET} libs: [${CURL_STATIC_LIBS}]")
|
||||
ELSE()
|
||||
SET(RET 1)
|
||||
ENDIF()
|
||||
IF(RET EQUAL 0 AND CURL_STATIC_LIBS)
|
||||
MESSAGE(STATUS "#2 CURL RET = ${RET}, using CURL static libs")
|
||||
SET(CURL_LIBRARIES "-Bstatic ${CURL_STATIC_LIBS}")
|
||||
ELSE()
|
||||
EXEC_PROGRAM(sh
|
||||
ARGS "${CMAKE_CURL_CONFIG} --libs"
|
||||
OUTPUT_VARIABLE CURL_STATIC_LIBS
|
||||
RETURN_VALUE RET)
|
||||
|
||||
IF(RET EQUAL 0 AND CURL_STATIC_LIBS)
|
||||
MESSAGE(STATUS "USING CURL STATIC LIBS: ${CURL_STATIC_LIBS}")
|
||||
SET(CURL_LIBRARIES "-Bstatic ${CURL_STATIC_LIBS}")
|
||||
ELSE()
|
||||
|
||||
EXEC_PROGRAM(sh
|
||||
ARGS "${CMAKE_CURL_CONFIG} --libs"
|
||||
OUTPUT_VARIABLE CURL_STATIC_LIBS
|
||||
RETURN_VALUE RET)
|
||||
|
||||
MESSAGE(STATUS "#2 CURL RET = ${RET} using CURL dynamic libs: ${CURL_STATIC_LIBS}")
|
||||
SET(CURL_LIBRARIES "${CURL_STATIC_LIBS}")
|
||||
|
||||
ENDIF()
|
||||
MESSAGE(STATUS "#2 CURL RET = ${RET}, using CURL dynamic libs: ${CURL_STATIC_LIBS}")
|
||||
SET(CURL_LIBRARIES "${CURL_STATIC_LIBS}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ELSE(CURL_FOUND)
|
||||
SET(CURL_LIBRARIES)
|
||||
SET(CURL_INCLUDE_DIRS)
|
||||
SET(CURL_LIBRARIES)
|
||||
SET(CURL_INCLUDE_DIRS)
|
||||
ENDIF(CURL_FOUND)
|
||||
|
@@ -15,81 +15,76 @@ set (_cppunit_DEBUG false)
|
||||
# If CPPUNIT_ROOT was defined in the environment, use it.
|
||||
|
||||
if (NOT CPPUNIT_ROOT AND NOT $ENV{CPPUNIT_ROOT} STREQUAL "")
|
||||
set(CPPUNIT_ROOT $ENV{CPPUNIT_ROOT})
|
||||
endif(NOT CPPUNIT_ROOT AND NOT $ENV{CPPUNIT_ROOT} STREQUAL "")
|
||||
set(CPPUNIT_ROOT $ENV{CPPUNIT_ROOT})
|
||||
endif()
|
||||
|
||||
# If CPPUNIT_INCLUDEDIR was defined in the environment, use it.
|
||||
if( NOT $ENV{CPPUNIT_INCLUDEDIR} STREQUAL "" )
|
||||
set(CPPUNIT_INCLUDEDIR $ENV{CPPUNIT_INCLUDEDIR})
|
||||
endif( NOT $ENV{CPPUNIT_INCLUDEDIR} STREQUAL "" )
|
||||
set(CPPUNIT_INCLUDEDIR $ENV{CPPUNIT_INCLUDEDIR})
|
||||
endif()
|
||||
|
||||
# If CPPUNIT_LIBRARYDIR was defined in the environment, use it.
|
||||
if( NOT $ENV{CPPUNIT_LIBRARYDIR} STREQUAL "" )
|
||||
set(CPPUNIT_LIBRARYDIR $ENV{CPPUNIT_LIBRARYDIR})
|
||||
endif( NOT $ENV{CPPUNIT_LIBRARYDIR} STREQUAL "" )
|
||||
set(CPPUNIT_LIBRARYDIR $ENV{CPPUNIT_LIBRARYDIR})
|
||||
endif()
|
||||
|
||||
if( CPPUNIT_ROOT )
|
||||
set(_cppunit_INCLUDE_SEARCH_DIRS
|
||||
${CPPUNIT_ROOT}/include )
|
||||
set(_cppunit_LIBRARY_SEARCH_DIRS
|
||||
${CPPUNIT_ROOT}/lib )
|
||||
endif( CPPUNIT_ROOT )
|
||||
set(_cppunit_INCLUDE_SEARCH_DIRS
|
||||
${CPPUNIT_ROOT}/include )
|
||||
set(_cppunit_LIBRARY_SEARCH_DIRS
|
||||
${CPPUNIT_ROOT}/lib )
|
||||
endif()
|
||||
|
||||
if( CPPUNIT_INCLUDEDIR )
|
||||
file(TO_CMAKE_PATH ${CPPUNIT_INCLUDEDIR} CPPUNIT_INCLUDEDIR)
|
||||
SET(_cppunit_INCLUDE_SEARCH_DIRS
|
||||
${CPPUNIT_INCLUDEDIR} )
|
||||
endif( CPPUNIT_INCLUDEDIR )
|
||||
file(TO_CMAKE_PATH ${CPPUNIT_INCLUDEDIR} CPPUNIT_INCLUDEDIR)
|
||||
SET(_cppunit_INCLUDE_SEARCH_DIRS
|
||||
${CPPUNIT_INCLUDEDIR} )
|
||||
endif()
|
||||
|
||||
if( CPPUNIT_LIBRARYDIR )
|
||||
file(TO_CMAKE_PATH ${CPPUNIT_LIBRARYDIR} CPPUNIT_LIBRARYDIR)
|
||||
SET(_cppunit_LIBRARY_SEARCH_DIRS
|
||||
${CPPUNIT_LIBRARYDIR} )
|
||||
endif( CPPUNIT_LIBRARYDIR )
|
||||
|
||||
# now find CPPUNIT_INCLUDE_DIR
|
||||
file(TO_CMAKE_PATH ${CPPUNIT_LIBRARYDIR} CPPUNIT_LIBRARYDIR)
|
||||
SET(_cppunit_LIBRARY_SEARCH_DIRS
|
||||
${CPPUNIT_LIBRARYDIR} )
|
||||
endif()
|
||||
|
||||
if ( _cppunit_DEBUG)
|
||||
message(STATUS "search include dirs for cppunit = ${_cppunit_INCLUDE_SEARCH_DIRS}")
|
||||
endif ( _cppunit_DEBUG)
|
||||
endif ()
|
||||
|
||||
find_path(CPPUNIT_INCLUDE_DIR
|
||||
NAMES cppunit/Test.h
|
||||
HINTS ${_cppunit_INCLUDE_SEARCH_DIRS})
|
||||
# now find CPPUNIT_INCLUDE_DIR
|
||||
find_path(CPPUNIT_INCLUDE_DIR
|
||||
NAMES cppunit/Test.h
|
||||
HINTS ${_cppunit_INCLUDE_SEARCH_DIRS})
|
||||
|
||||
if ( _cppunit_DEBUG)
|
||||
message(STATUS "include dir for cppunit = ${CPPUNIT_INCLUDE_DIR}")
|
||||
endif ( _cppunit_DEBUG)
|
||||
message(STATUS "include dir for cppunit = ${CPPUNIT_INCLUDE_DIR}")
|
||||
message(STATUS "search library dirs for cppunit = ${_cppunit_LIBRARY_SEARCH_DIRS}")
|
||||
endif ()
|
||||
|
||||
# now find CPPUNIT_LIBRARY
|
||||
find_library(CPPUNIT_LIBRARY
|
||||
NAMES cppunit
|
||||
HINTS ${_cppunit_LIBRARY_SEARCH_DIRS})
|
||||
|
||||
if ( _cppunit_DEBUG)
|
||||
message(STATUS "search library dirs for cppunit = ${_cppunit_LIBRARY_SEARCH_DIRS}")
|
||||
endif ( _cppunit_DEBUG)
|
||||
|
||||
find_library(CPPUNIT_LIBRARY
|
||||
NAMES cppunit
|
||||
HINTS ${_cppunit_LIBRARY_SEARCH_DIRS})
|
||||
|
||||
if ( _cppunit_DEBUG)
|
||||
message(STATUS "library dir for cppunit = ${CPPUNIT_LIBRARY}")
|
||||
endif ( _cppunit_DEBUG)
|
||||
message(STATUS "library dir for cppunit = ${CPPUNIT_LIBRARY}")
|
||||
endif ()
|
||||
|
||||
if (CPPUNIT_INCLUDE_DIR AND CPPUNIT_LIBRARY)
|
||||
SET(CPPUNIT_FOUND TRUE)
|
||||
endif (CPPUNIT_INCLUDE_DIR AND CPPUNIT_LIBRARY)
|
||||
SET(CPPUNIT_FOUND TRUE)
|
||||
endif ()
|
||||
|
||||
if (CPPUNIT_FOUND)
|
||||
# show which CppUnit was found only if not quiet
|
||||
if (NOT CppUnit_FIND_QUIETLY)
|
||||
message(STATUS "Found CppUnit: ${CPPUNIT_LIBRARY}")
|
||||
endif (NOT CppUnit_FIND_QUIETLY)
|
||||
else (CPPUNIT_FOUND)
|
||||
# fatal error if CppUnit is required but not found
|
||||
if (CppUnit_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find CppUnit")
|
||||
endif (CppUnit_FIND_REQUIRED)
|
||||
endif (CPPUNIT_FOUND)
|
||||
# show which CppUnit was found only if not quiet
|
||||
if (NOT CppUnit_FIND_QUIETLY)
|
||||
#message(STATUS "Found CppUnit: ${CPPUNIT_LIBRARY}")
|
||||
endif ()
|
||||
else ()
|
||||
# fatal error if CppUnit is required but not found
|
||||
if (CppUnit_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find CppUnit")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARY CPPUNIT_INCLUDE_DIR)
|
||||
|
@@ -33,7 +33,7 @@ IF(WANT_STATIC_LIBS)
|
||||
SET(FRIBIDI_NAMES fribidi.a libfribidi.a ${FRIBIDI_NAMES})
|
||||
ENDIF()
|
||||
|
||||
MESSAGE(STATUS "** Searching for library names: [${FRIBIDI_NAMES}] ...")
|
||||
#MESSAGE(STATUS "** Searching for library names: [${FRIBIDI_NAMES}] ...")
|
||||
|
||||
FIND_LIBRARY(FRIBIDI_LIBRARY
|
||||
NAMES ${FRIBIDI_NAMES}
|
||||
|
@@ -18,59 +18,68 @@ IF(LUA_INCLUDE_DIR AND LUA_LIBRARIES)
|
||||
#SET(LUA_FIND_QUIETLY TRUE)
|
||||
ENDIF(LUA_INCLUDE_DIR AND LUA_LIBRARIES)
|
||||
|
||||
IF(FORCE_LUA_5_2)
|
||||
MESSAGE(STATUS "Trying to FORCE LUA 5.2 ...")
|
||||
IF(FORCE_LUA_5_3)
|
||||
MESSAGE(STATUS "Trying to FORCE LUA 5.3 ...")
|
||||
|
||||
SET(LUA_FIND_INCLUDE_PATHS /usr/include/lua5.2
|
||||
/usr/include
|
||||
/usr/include/lua )
|
||||
SET(LUA_FIND_STATIC_LIB_NAMES liblua5.2.a lua5.2 liblua.a lua )
|
||||
SET(LUA_FIND_DYNAMIC_LIB_NAMES lua5.2 lua )
|
||||
SET(LUA_FIND_INCLUDE_PATHS /usr/include/lua5.3
|
||||
/usr/include/lua
|
||||
/usr/include )
|
||||
SET(LUA_FIND_STATIC_LIB_NAMES liblua5.3.a lua5.3 liblua.a lua )
|
||||
SET(LUA_FIND_DYNAMIC_LIB_NAMES lua5.3 lua )
|
||||
|
||||
ELSEIF(FORCE_LUA_5_2)
|
||||
MESSAGE(STATUS "Trying to FORCE LUA 5.2 ...")
|
||||
|
||||
SET(LUA_FIND_INCLUDE_PATHS /usr/include/lua5.2
|
||||
/usr/include/lua
|
||||
/usr/include )
|
||||
SET(LUA_FIND_STATIC_LIB_NAMES liblua5.2.a lua5.2 liblua.a lua )
|
||||
SET(LUA_FIND_DYNAMIC_LIB_NAMES lua5.2 lua )
|
||||
|
||||
ELSEIF(FORCE_LUA_5_1)
|
||||
MESSAGE(STATUS "Trying to FORCE LUA 5.1 ...")
|
||||
|
||||
SET(LUA_FIND_INCLUDE_PATHS /usr/include/lua5.1
|
||||
/usr/include
|
||||
/usr/include/lua )
|
||||
SET(LUA_FIND_STATIC_LIB_NAMES liblua5.1.a lua5.1 liblua.a lua )
|
||||
SET(LUA_FIND_DYNAMIC_LIB_NAMES lua5.1 lua )
|
||||
SET(LUA_FIND_INCLUDE_PATHS /usr/include/lua5.1
|
||||
/usr/include/lua
|
||||
/usr/include )
|
||||
SET(LUA_FIND_STATIC_LIB_NAMES liblua5.1.a lua5.1 liblua.a lua )
|
||||
SET(LUA_FIND_DYNAMIC_LIB_NAMES lua5.1 lua )
|
||||
ELSE()
|
||||
SET(LUA_FIND_INCLUDE_PATHS /usr/include
|
||||
/usr/include/lua5.2
|
||||
/usr/include/lua
|
||||
/usr/include/lua5.1 )
|
||||
SET(LUA_FIND_STATIC_LIB_NAMES liblua5.2.a liblua.a liblua5.1.a lua5.2 lua lua5.1 )
|
||||
SET(LUA_FIND_DYNAMIC_LIB_NAMES lua5.2 lua lua5.1 )
|
||||
SET(LUA_FIND_INCLUDE_PATHS /usr/include/lua5.3
|
||||
/usr/include/lua5.2
|
||||
/usr/include/lua
|
||||
/usr/include/lua5.1
|
||||
/usr/include )
|
||||
SET(LUA_FIND_STATIC_LIB_NAMES liblua5.3.a liblua5.2.a liblua.a liblua5.1.a lua5.3 lua5.2 lua lua5.1 )
|
||||
SET(LUA_FIND_DYNAMIC_LIB_NAMES lua5.3 lua5.2 lua lua5.1 )
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(LUA_INCLUDE_DIR NAMES lua.hpp
|
||||
FIND_PATH(LUA_INCLUDE_DIR NAMES lua.hpp
|
||||
PATHS ${LUA_FIND_INCLUDE_PATHS}
|
||||
IF(FreeBSD)
|
||||
SET(PATHS "/usr/local/include/lua51")
|
||||
ENDIF()
|
||||
$ENV{LUA_HOME}
|
||||
)
|
||||
SET(PATHS "/usr/local/include/lua53 /usr/local/include/lua52 /usr/local/include/lua51")
|
||||
ENDIF()
|
||||
$ENV{LUA_HOME})
|
||||
|
||||
IF (LUA_STATIC AND NOT LUA_LIBRARIES)
|
||||
FIND_LIBRARY(LUA_LIBRARIES NAMES ${LUA_FIND_STATIC_LIB_NAMES}
|
||||
PATHS
|
||||
IF(FreeBSD)
|
||||
SET(PATHS "/usr/local/lib/lua51")
|
||||
ENDIF()
|
||||
$ENV{LUA_HOME})
|
||||
PATHS
|
||||
IF(FreeBSD)
|
||||
SET(PATHS "/usr/local/lib/lua53 /usr/local/lib/lua52 /usr/local/lib/lua51")
|
||||
ENDIF()
|
||||
$ENV{LUA_HOME})
|
||||
|
||||
ELSE()
|
||||
FIND_LIBRARY(LUA_LIBRARIES NAMES ${LUA_FIND_DYNAMIC_LIB_NAMES}
|
||||
PATHS
|
||||
IF(FreeBSD)
|
||||
SET(PATHS "/usr/local/lib/lua51")
|
||||
ENDIF()
|
||||
$ENV{LUA_HOME})
|
||||
PATHS
|
||||
IF(FreeBSD)
|
||||
SET(PATHS "/usr/local/lib/lua53 /usr/local/lib/lua52 /usr/local/lib/lua51")
|
||||
ENDIF()
|
||||
$ENV{LUA_HOME})
|
||||
ENDIF()
|
||||
|
||||
MESSAGE(STATUS "LUA_INC: ${LUA_INCLUDE_DIR}")
|
||||
MESSAGE(STATUS "LUA_LIB: ${LUA_LIBRARIES}")
|
||||
#MESSAGE(STATUS "LUA_INC: ${LUA_INCLUDE_DIR}")
|
||||
#MESSAGE(STATUS "LUA_LIB: ${LUA_LIBRARIES}")
|
||||
|
||||
IF(LUA_INCLUDE_DIR AND LUA_LIBRARIES)
|
||||
SET(LUA_FOUND TRUE)
|
||||
|
@@ -40,12 +40,12 @@ SET(MINIUPNPC_DIR_SEARCH $ENV{MINIUPNPC_ROOT})
|
||||
#find_path(MINIUPNP_INCLUDE_DIR miniupnpc.h
|
||||
# PATH_SUFFIXES miniupnpc)
|
||||
|
||||
FIND_PATH(MINIUPNP_INCLUDE_DIR miniupnpc.h
|
||||
FIND_PATH(MINIUPNP_INCLUDE_DIR miniupnpc.h
|
||||
${MINIUPNPC_DIR_SEARCH}/include/miniupnpc
|
||||
/usr/include/miniupnpc
|
||||
/usr/local/include/miniupnpc)
|
||||
/usr/local/include/miniupnpc)
|
||||
|
||||
message(STATUS "Finding miniupnpc.h result: ${MINIUPNP_INCLUDE_DIR}")
|
||||
#message(STATUS "Finding miniupnpc.h result: ${MINIUPNP_INCLUDE_DIR}")
|
||||
|
||||
#find_library(MINIUPNP_LIBRARY miniupnpc)
|
||||
|
||||
@@ -57,7 +57,7 @@ ENDIF()
|
||||
|
||||
FIND_LIBRARY(MINIUPNP_LIBRARY NAMES ${MINIUPNPC_LIBRARY_NAMES})
|
||||
|
||||
message(STATUS "Finding miniupnpc lib result: ${MINIUPNP_LIBRARY}")
|
||||
#message(STATUS "Finding miniupnpc lib result: ${MINIUPNP_LIBRARY}")
|
||||
|
||||
if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY)
|
||||
set (MINIUPNP_FOUND TRUE)
|
||||
@@ -69,7 +69,7 @@ if (MINIUPNP_FOUND)
|
||||
message (STATUS "Found the miniupnpc headers at ${MINIUPNP_INCLUDE_DIR}")
|
||||
endif (NOT MINIUPNP_FIND_QUIETLY)
|
||||
|
||||
message(STATUS "Detecting version of miniupnpc in path: ${MINIUPNP_INCLUDE_DIR}")
|
||||
#message(STATUS "Detecting version of miniupnpc in path: ${MINIUPNP_INCLUDE_DIR}")
|
||||
|
||||
set(CMAKE_REQUIRED_INCLUDES ${MINIUPNP_INCLUDE_DIR})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${MINIUPNP_LIBRARY})
|
||||
|
Reference in New Issue
Block a user