mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
VTK-m find module better follow recommended best practices.
CMake best practices are found at: https://cmake.org/cmake/help/v3.3/manual/cmake-developer.7.html#modules
This commit is contained in:
parent
6410f06e8d
commit
5d23c4bf21
@ -21,7 +21,7 @@
|
||||
# Once done this will define
|
||||
#
|
||||
# EGL_FOUND - true if EGL has been found
|
||||
# EGL_INCLUDE_DIR - where the EGL/egl.h and KHR/khrplatform.h can be found
|
||||
# EGL_INCLUDE_DIRS - where the EGL/egl.h and KHR/khrplatform.h can be found
|
||||
# EGL_LIBRARY - link this to use libEGL.so.1
|
||||
# EGL_opengl_LIBRARY - link with these two libraries instead of the gl library
|
||||
# EGL_gldispatch_LIBRARY for full OpenGL support through EGL
|
||||
@ -102,10 +102,15 @@ if(NOT EGL_gldispatch_LIBRARY)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(EGL_LIBRARIES ${EGL_LIBRARY} ${EGL_opengl_LIBRARY} ${EGL_gldispatch_LIBRARY})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(EGL DEFAULT_MSG
|
||||
EGL_LIBRARY EGL_opengl_LIBRARY EGL_gldispatch_LIBRARY EGL_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(EGL
|
||||
FOUND_VAR EGL_FOUND
|
||||
REQUIRED_VARS EGL_LIBRARY EGL_opengl_LIBRARY EGL_gldispatch_LIBRARY EGL_INCLUDE_DIR)
|
||||
|
||||
if(EGL_FOUND)
|
||||
set(EGL_LIBRARIES ${EGL_LIBRARY} ${EGL_opengl_LIBRARY} ${EGL_gldispatch_LIBRARY})
|
||||
set(EGL_INCLUDE_DIRS ${EGL_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
|
||||
mark_as_advanced(EGL_DIR EGL_INCLUDE_DIR EGL_LIBRARY EGL_opengl_LIBRARY EGL_gldispatch_LIBRARY)
|
||||
|
@ -64,15 +64,17 @@
|
||||
#
|
||||
# * Kitware, Inc.
|
||||
|
||||
|
||||
find_path(GLEW_INCLUDE_DIR GL/glew.h)
|
||||
find_library(GLEW_LIBRARY NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64)
|
||||
|
||||
set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
|
||||
set(GLEW_LIBRARIES ${GLEW_LIBRARY})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GLEW
|
||||
FOUND_VAR GLEW_FOUND
|
||||
REQUIRED_VARS GLEW_INCLUDE_DIR GLEW_LIBRARY)
|
||||
|
||||
if(GLEW_FOUND)
|
||||
set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
|
||||
set(GLEW_LIBRARIES ${GLEW_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(GLEW_INCLUDE_DIR GLEW_LIBRARY)
|
||||
|
@ -23,8 +23,8 @@
|
||||
# Once done this will define
|
||||
#
|
||||
# GLFW_FOUND
|
||||
# GLFW_INCLUDE_DIR
|
||||
# GLFW_LIBRARY
|
||||
# GLFW_INCLUDE_DIRS
|
||||
# GLFW_LIBRARIES
|
||||
#
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
@ -94,9 +94,14 @@ if (${CMAKE_HOST_UNIX})
|
||||
DOC "The GLFW library")
|
||||
endif ()
|
||||
|
||||
find_package_handle_standard_args(GLFW DEFAULT_MSG
|
||||
GLFW_INCLUDE_DIR
|
||||
GLFW_LIBRARY
|
||||
find_package_handle_standard_args(GLFW
|
||||
FOUND_VAR GLFW_FOUND
|
||||
REQUIRED_VARS GLFW_INCLUDE_DIR GLFW_LIBRARY
|
||||
)
|
||||
|
||||
if(GLFW_FOUND)
|
||||
set(GLFW_LIBRARIES ${GLFW_LIBRARY})
|
||||
set(GLFW_INCLUDE_DIRS ${GLFW_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
mark_as_advanced( GLFW_INCLUDE_DIR GLFW_LIBRARY )
|
||||
|
@ -69,9 +69,13 @@ endif()
|
||||
# Check for required components
|
||||
include( FindPackageHandleStandardArgs )
|
||||
find_package_handle_standard_args( Thrust
|
||||
FOUND_VAR Thrust_FOUND
|
||||
REQUIRED_VARS THRUST_INCLUDE_DIR
|
||||
VERSION_VAR THRUST_VERSION
|
||||
)
|
||||
|
||||
set(THRUST_INCLUDE_DIRS ${THRUST_INCLUDE_DIR})
|
||||
if(Thrust_FOUND)
|
||||
set(THRUST_INCLUDE_DIRS ${THRUST_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(THRUST_INCLUDE_DIR)
|
||||
|
@ -189,8 +189,8 @@ macro(vtkm_configure_component_EGL)
|
||||
|
||||
vtkm_finish_configure_component(EGL
|
||||
DEPENDENT_VARIABLES VTKm_OpenGL_FOUND EGL_FOUND
|
||||
ADD_INCLUDES ${EGL_INCLUDE_DIR}
|
||||
ADD_LIBRARIES ${EGL_LIBRARY}
|
||||
ADD_INCLUDES ${EGL_INCLUDE_DIRS}
|
||||
ADD_LIBRARIES ${EGL_LIBRARIES}
|
||||
)
|
||||
endmacro(vtkm_configure_component_EGL)
|
||||
|
||||
@ -201,8 +201,8 @@ macro(vtkm_configure_component_GLFW)
|
||||
|
||||
vtkm_finish_configure_component(GLFW
|
||||
DEPENDENT_VARIABLES VTKm_OpenGL_FOUND GLFW_FOUND
|
||||
ADD_INCLUDES ${GLFW_INCLUDE_DIR}
|
||||
ADD_LIBRARIES ${GLFW_LIBRARY}
|
||||
ADD_INCLUDES ${GLFW_INCLUDE_DIRS}
|
||||
ADD_LIBRARIES ${GLFW_LIBRARIES}
|
||||
)
|
||||
endmacro(vtkm_configure_component_GLFW)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user