Changed: Some code simplifications

This commit is contained in:
kervala 2011-05-14 14:04:03 +02:00
parent bbbf8754fb
commit 144410cfd4

View file

@ -7,7 +7,7 @@
# EXTERNAL_FOUND - True if the external libraries are available # EXTERNAL_FOUND - True if the external libraries are available
SET(EXTERNAL_TEMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external ${CMAKE_CURRENT_SOURCE_DIR}/../external ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty ${EXTERNAL_PATH}) SET(EXTERNAL_TEMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external ${CMAKE_CURRENT_SOURCE_DIR}/../external ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty ${EXTERNAL_PATH})
SET(EXTERNAL_TEMP_FILE "include/png.h") SET(EXTERNAL_TEMP_FILE "include/zlib.h")
SET(EXTERNAL_NAME "external") SET(EXTERNAL_NAME "external")
# If using STLport preprend external_stlport # If using STLport preprend external_stlport
@ -17,36 +17,35 @@ IF(WITH_STLPORT)
SET(EXTERNAL_NAME "external with STLport") SET(EXTERNAL_NAME "external with STLport")
ENDIF(WITH_STLPORT) ENDIF(WITH_STLPORT)
SET(EXTERNAL_FOUND FALSE) FIND_PATH(EXTERNAL_PATH
FOREACH(ITEM ${EXTERNAL_TEMP_PATH}) ${EXTERNAL_TEMP_FILE}
IF(EXISTS "${ITEM}/${EXTERNAL_TEMP_FILE}" AND NOT EXTERNAL_FOUND) PATHS
SET(EXTERNAL_FOUND TRUE) $ENV{EXTERNAL_PATH}
# Get absolute path to avoid .. ${EXTERNAL_TEMP_PATH}
GET_FILENAME_COMPONENT(ITEM ${ITEM} ABSOLUTE) /usr/local
SET(EXTERNAL_PATH ${ITEM} CACHE PATH "" FORCE) /usr
ENDIF(EXISTS "${ITEM}/${EXTERNAL_TEMP_FILE}" AND NOT EXTERNAL_FOUND) /sw
ENDFOREACH(ITEM ${EXTERNAL_TEMP_PATH}) /opt/local
/opt/csw
/opt
)
IF(EXTERNAL_FOUND) IF(EXTERNAL_PATH)
SET(EXTERNAL_FOUND TRUE)
SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include") SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include")
IF(NOT CMAKE_SIZEOF_VOID_P)
INCLUDE (CheckTypeSize)
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
ENDIF(NOT CMAKE_SIZEOF_VOID_P)
# Using 32 or 64 bits libraries # Using 32 or 64 bits libraries
IF(CMAKE_SIZEOF_VOID_P EQUAL 8) IF(TARGET_X64)
SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib64") SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib64")
ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8) ELSE(TARGET_X64)
SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib") SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib")
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8) ENDIF(TARGET_X64)
SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}") SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}")
# Stupid hack for FindOpenAL.cmake # Stupid hack for FindOpenAL.cmake
SET(CMAKE_INCLUDE_PATH "${EXTERNAL_PATH};${CMAKE_INCLUDE_PATH}") SET(CMAKE_INCLUDE_PATH "${EXTERNAL_PATH};${CMAKE_INCLUDE_PATH}")
SET(CMAKE_LIBRARY_PATH "${EXTERNAL_LIBRARY_PATH};${CMAKE_LIBRARY_PATH}") SET(CMAKE_LIBRARY_PATH "${EXTERNAL_LIBRARY_PATH};${CMAKE_LIBRARY_PATH}")
ENDIF(EXTERNAL_FOUND) ENDIF(EXTERNAL_PATH)
IF(EXTERNAL_FOUND) IF(EXTERNAL_FOUND)
IF(NOT External_FIND_QUIETLY) IF(NOT External_FIND_QUIETLY)