From 1a3238563207e677edb14b4c133def9ec7cf95a9 Mon Sep 17 00:00:00 2001 From: Koncord Date: Tue, 12 Jul 2016 20:37:39 +0800 Subject: [PATCH] Fix cmake modules --- cmake/FindRakNet.cmake | 18 +++++------------- cmake/FindTerra.cmake | 19 +++++-------------- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/cmake/FindRakNet.cmake b/cmake/FindRakNet.cmake index 9ce071cd1..f589b25b8 100644 --- a/cmake/FindRakNet.cmake +++ b/cmake/FindRakNet.cmake @@ -6,15 +6,7 @@ # RakNet_INCLUDES - the RakNet include directory # RakNet_LIBRARY - Link these to use RakNet -if(Win32) -SET(RakNet_LIBRARY_Name RakNetLibStatic) -SET(RakNet_LIBRARY_Name_Debug RakNetLibStaticDebug) -else(Win32) -SET(RakNet_LIBRARY_Name RakNetStatic) -SET(RakNet_LIBRARY_Name_Debug RakNetStatic_Debug) -endif(Win32) - -FIND_LIBRARY (RakNet_LIBRARY_RELEASE NAMES ${RakNet_LIBRARY_Name} +FIND_LIBRARY (RakNet_LIBRARY_RELEASE NAMES RakNetLibStatic PATHS ENV LD_LIBRARY_PATH ENV LIBRARY_PATH @@ -23,10 +15,10 @@ FIND_LIBRARY (RakNet_LIBRARY_RELEASE NAMES ${RakNet_LIBRARY_Name} /usr/local/lib64 /usr/local/lib /opt/local/lib - ${RAKNET_ROOT}/lib + $ENV{RAKNET_ROOT}/lib ) -FIND_LIBRARY (RakNet_LIBRARY_DEBUG NAMES ${RakNet_LIBRARY_Name_Debug} +FIND_LIBRARY (RakNet_LIBRARY_DEBUG NAMES RakNetLibStatic PATHS ENV LD_LIBRARY_PATH ENV LIBRARY_PATH @@ -35,7 +27,7 @@ FIND_LIBRARY (RakNet_LIBRARY_DEBUG NAMES ${RakNet_LIBRARY_Name_Debug} /usr/local/lib64 /usr/local/lib /opt/local/lib - ${RAKNET_ROOT}/lib + $ENV{RAKNET_ROOT}/lib ) @@ -45,7 +37,7 @@ FIND_PATH (RakNet_INCLUDES raknet/RakPeer.h /usr/include /usr/local/include /opt/local/include - ${RAKNET_ROOT}/include + $ENV{RAKNET_ROOT}/include ) IF(RakNet_INCLUDES AND RakNet_LIBRARY_RELEASE) diff --git a/cmake/FindTerra.cmake b/cmake/FindTerra.cmake index 7b44f206a..6b38306cf 100644 --- a/cmake/FindTerra.cmake +++ b/cmake/FindTerra.cmake @@ -5,13 +5,7 @@ # Terra_INCLUDES - the Terra include directory # Terra_LIBRARY - Link these to use Terra -if(Win32) -SET(Terra_LIBRARY_Name terra.so) -else(Win32) -SET(Terra_LIBRARY_Name terra) -endif(Win32) - -FIND_LIBRARY (Terra_LIBRARY_RELEASE NAMES ${Terra_LIBRARY_Name} +FIND_LIBRARY (Terra_LIBRARY_RELEASE NAMES terra PATHS ENV LD_LIBRARY_PATH ENV LIBRARY_PATH @@ -20,11 +14,10 @@ FIND_LIBRARY (Terra_LIBRARY_RELEASE NAMES ${Terra_LIBRARY_Name} /usr/local/lib64 /usr/local/lib /opt/local/lib - ${Terra_ROOT}/lib - ${Terra_DIR}/lib + $ENV{Terra_ROOT}/lib ) -FIND_LIBRARY (Terra_LIBRARY_DEBUG NAMES ${Terra_LIBRARY_Name_Debug} +FIND_LIBRARY (Terra_LIBRARY_DEBUG NAMES terra PATHS ENV LD_LIBRARY_PATH ENV LIBRARY_PATH @@ -33,8 +26,7 @@ FIND_LIBRARY (Terra_LIBRARY_DEBUG NAMES ${Terra_LIBRARY_Name_Debug} /usr/local/lib64 /usr/local/lib /opt/local/lib - ${Terra_ROOT}/lib - ${Terra_DIR}/lib + $ENV{Terra_ROOT}/lib ) @@ -44,8 +36,7 @@ FIND_PATH (Terra_INCLUDES terra/terra.h /usr/include /usr/local/include /opt/local/include - ${Terra_ROOT}/include - ${Terra_DIR}/include + $ENV{Terra_ROOT}/include ) IF(Terra_INCLUDES AND Terra_LIBRARY_RELEASE)