Commit 225f619f authored by Rashad Kanavath's avatar Rashad Kanavath

COMP: cleaup inhouse cmake scripts

parent 59536df6
......@@ -28,54 +28,33 @@
#
# Try to find GLEW library and include path.
# Once done this will define
#rewritten for OTB by Rashad Kanavath
#
# GLEW_FOUND
# GLEW_INCLUDE_PATH
# GLEW_LIBRARY
#
IF (WIN32)
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
$ENV{PROGRAMFILES}/GLEW/include
${GLEW_ROOT_DIR}/include
DOC "The directory where GL/glew.h resides")
find_path(
GLEW_INCLUDE_DIR GL/glew.h
DOC "The directory where GL/glew.h resides"
)
FIND_LIBRARY( GLEW_LIBRARY
NAMES glew GLEW glew32 glew32s
PATHS
$ENV{PROGRAMFILES}/GLEW/lib
${GLEW_ROOT_DIR}/lib
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
DOC "The GLEW library")
ELSE (WIN32)
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${GLEW_ROOT_DIR}/include
DOC "The directory where GL/glew.h resides")
if(WIN32)
set(GLEW_LIB_NAMES glew GLEW glew32 glew32s)
else()
set(GLEW_LIB_NAMES libGLEW GLEW)
endif()
# Prefer the static library.
FIND_LIBRARY( GLEW_LIBRARY
NAMES libGLEW.so GLEW
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${GLEW_ROOT_DIR}/lib
DOC "The GLEW library")
ENDIF (WIN32)
FIND_LIBRARY( GLEW_LIBRARY
NAMES ${GLEW_LIB_NAMES}
DOC "The GLEW library")
SET(GLEW_FOUND "NO")
IF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
SET(GLEW_LIBRARIES ${GLEW_LIBRARY})
SET(GLEW_FOUND "YES")
ENDIF ()
set(GLEW_FOUND FALSE)
if (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
set(GLEW_LIBRARIES ${GLEW_LIBRARY})
set(GLEW_FOUND TRUE)
endif()
INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW
......
......@@ -80,4 +80,4 @@ ENDIF()
INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLFW
REQUIRED_VARS GLFW_LIBRARY GLFW_INCLUDE_DIR
VERSION_VAR GLFW_VERSION_STRING)
\ No newline at end of file
VERSION_VAR GLFW_VERSION_STRING)
......@@ -58,23 +58,9 @@
# standard install paths.
# Explicit -DVAR=value arguments should still be able to override everything.
find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
HINTS
# enough environment variables?
$ENV{OPENTHREADS_INCLUDE_DIR}
$ENV{OPENTHREADS_DIR}
$ENV{OSG_INCLUDE_DIR}
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
PATHS
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
/usr/freeware
PATH_SUFFIXES include
find_path(
OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
PATH_SUFFIXES include
)
mark_as_advanced(OPENTHREADS_INCLUDE_DIR)
......@@ -95,41 +81,12 @@ endif()
find_library(OPENTHREADS_LIBRARY
NAMES OpenThreads OpenThreadsWin32
HINTS
$ENV{OPENTHREADS_LIBRARY_DIR}
$ENV{OPENTHREADS_DIR}
$ENV{OSG_LIBRARY_DIR}
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
PATHS
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
PATH_SUFFIXES lib64 lib
)
mark_as_advanced(OPENTHREADS_LIBRARY)
find_library(OPENTHREADS_LIBRARY_DEBUG
NAMES OpenThreadsd OpenThreadsWin32d
HINTS
$ENV{OPENTHREADS_DEBUG_LIBRARY_DIR}
$ENV{OPENTHREADS_LIBRARY_DIR}
$ENV{OPENTHREADS_DIR}
$ENV{OSG_LIBRARY_DIR}
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
PATHS
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
PATH_SUFFIXES lib64 lib
)
mark_as_advanced(OPENTHREADS_LIBRARY_DEBUG)
......
......@@ -31,7 +31,7 @@
# QWT_MINOR_VERSION - minor version
# QWT_PATCH_VERSION - patch version
# QWT_VERSION_STRING - version (ex. 5.2.1)
# QWT_ROOT_DIR - root dir (ex. /usr/local)
# QWT_ROOT_DIR - root dir
#=============================================================================
# Copyright 2010-2013, Julien Schueller
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment