6d7ca06e02
The following shell script was used: while read f do sed -Ei 's/[[:space:]]+$//g' "$f" done <<EOF $(svn ls -R | grep \ -e '.\cpp$' \ -e '\.cmake$' \ -e '\.txt$' \ -e '\.cppcheck$' \ -e '\.frag$' \ -e '\.h$' \ -e '\.hpp$' \ -e '\.vert$' \ -e '\.xml$' \ -e '\.java$' \ -e '\.c$') EOF As a side effect, this has also converted some files from CRLF line endings to LF. File extensions such as .ac or .osg were intentionally left out because those usually are very large files generated by tools. git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9507 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 6c1e5ab34415982ec77fc92a77e1b1c149518eca Former-commit-id: c6cf9480ae7c1d2f9a999eb6c6b976eef8bae3ba
76 lines
3.1 KiB
CMake
Executable file
76 lines
3.1 KiB
CMake
Executable file
# - Find ENET library
|
|
# Find the native ENET includes and library
|
|
# This module defines
|
|
# ENET_INCLUDE_DIR, where to find enet/enet.h
|
|
# ENET_LIBRARY libraries to link against to use ENET
|
|
# ENET_FOUND If false, do not try to use ENET
|
|
# $ENETDIR is an environment variable that would correspond
|
|
# to the prefix used to configure ENET.
|
|
#
|
|
# Created by Jean-Philippe Meuret, based on the FindOpenAL.cmake module
|
|
# modified by Bryan Donlan, from original version by Eric Wang.
|
|
FIND_PATH(ENET_INCLUDE_DIR enet/enet.h
|
|
HINTS ENV $ENETDIR
|
|
PATH_SUFFIXES
|
|
Headers include
|
|
PATHS
|
|
~/Library/Frameworks/GLFW.framework
|
|
/Library/Frameworks/GLFW.framework
|
|
/System/Library/Frameworks/GLFW.framework # Tiger
|
|
/usr/local
|
|
/usr
|
|
/sw # Fink
|
|
/opt/local # DarwinPorts
|
|
/opt/csw # Blastwave
|
|
/opt)
|
|
|
|
# I'm not sure if I should do a special casing for Apple. It is
|
|
# unlikely that other Unix systems will find the framework path.
|
|
# But if they do ([Next|Open|GNU]Step?),
|
|
# do they want the -framework option also?
|
|
IF(${ENET_INCLUDE_DIR} MATCHES ".framework")
|
|
STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" ENET_FRAMEWORK_PATH_TMP ${ENET_INCLUDE_DIR})
|
|
IF("${ENET_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
|
|
OR "${ENET_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
|
|
)
|
|
# String is in default search path, don't need to use -F
|
|
SET (ENET_LIBRARY "-framework GLFW" CACHE STRING "GLFW framework for OSX")
|
|
ELSE("${ENET_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
|
|
OR "${ENET_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
|
|
)
|
|
# String is not /Library/Frameworks, need to use -F
|
|
SET(ENET_LIBRARY "-F${ENET_FRAMEWORK_PATH_TMP} -framework GLFW" CACHE STRING "GLFW framework for OSX")
|
|
ENDIF("${ENET_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
|
|
OR "${ENET_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
|
|
)
|
|
# Clear the temp variable so nobody can see it
|
|
SET(ENET_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
|
|
|
|
ELSE(${ENET_INCLUDE_DIR} MATCHES ".framework")
|
|
FIND_LIBRARY(ENET_LIBRARY
|
|
NAMES enet
|
|
HINTS ENV ENETDIR
|
|
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
|
|
PATHS
|
|
/usr/local
|
|
/usr
|
|
/sw
|
|
/opt/local
|
|
/opt/csw
|
|
/opt)
|
|
ENDIF(${ENET_INCLUDE_DIR} MATCHES ".framework")
|
|
|
|
SET(ENET_FOUND "NO")
|
|
IF (ENET_LIBRARY)
|
|
#If ENET_INCLUDE_DIR points to /usr/include/enet while enet.h is in /usr/include/enet/enet.h,
|
|
#then #include <time.h> will cause /usr/include/enet/time.h be loaded instead of /usr/include/time.h, which causes compiler errors.
|
|
#We warn the user if the wrong include is possibly used
|
|
IF(NOT EXISTS "${ENET_INCLUDE_DIR}/enet/enet.h")
|
|
MESSAGE(WARNING " The file ${ENET_INCLUDE_DIR}/enet/enet.h does not exists. Make sure ENET_INCLUDE_DIR points to the directory containing \"enet/enet.h\" and not to the directory containing \"enet.h\". ENET_INCLUDE_DIR currently has value \"${ENET_INCLUDE_DIR}\"")
|
|
ENDIF(NOT EXISTS "${ENET_INCLUDE_DIR}/enet/enet.h")
|
|
SET(ENET_FOUND "YES")
|
|
#MESSAGE(STATUS "Found ENET: ${ENET_LIBRARY}")
|
|
ENDIF(ENET_LIBRARY)
|
|
|
|
|
|
#MARK_AS_ADVANCED(ENET_INCLUDE_DIR ENET_LIBRARY)
|