diff options
| author | Silvio <silvio.traversaro@iit.it> | 2016-12-18 23:00:35 +0100 |
|---|---|---|
| committer | Silvio <silvio.traversaro@iit.it> | 2016-12-18 23:00:35 +0100 |
| commit | effbdfbb91e3672e41cfc442ce0244872b1fad8c (patch) | |
| tree | cfdc0e6b3a622d8e73478aadee13ab074a5a59ee /ports/ogre/OGREConfig.cmake | |
| parent | 835693ce97f271c0213f65c1c782e8df84cfb409 (diff) | |
| download | vcpkg-effbdfbb91e3672e41cfc442ce0244872b1fad8c.tar.gz vcpkg-effbdfbb91e3672e41cfc442ce0244872b1fad8c.zip | |
Add ogre port
Diffstat (limited to 'ports/ogre/OGREConfig.cmake')
| -rw-r--r-- | ports/ogre/OGREConfig.cmake | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/ports/ogre/OGREConfig.cmake b/ports/ogre/OGREConfig.cmake new file mode 100644 index 000000000..a20544431 --- /dev/null +++ b/ports/ogre/OGREConfig.cmake @@ -0,0 +1,37 @@ +#.rst: +# OGREConfig +# ------------ +# +# Dummy OGREConfig to simplify use of OGRE-provided FindOGRE module. +# +# This file is provided as part of the vcpkg port of OGRE . +# It is meant to be found automatically by find_package(OGRE), +# but then offloads all the real work to the FindOGRE module by temporarly +# adding its directory to CMAKE_MODULE_PATH +# +# See the FindOGRE module to see the defined variables:: +# + +# Temporarly add the directory in which OGREConfig.cmake is contained to +# get access to the FindOGRE module +get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +set(ORIGINAL_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) +list(APPEND CMAKE_MODULE_PATH ${SELF_DIR}) +find_package(OGRE MODULE) + +# Leave CMAKE_MODULE_PATH as we found it +set(CMAKE_MODULE_PATH ${ORIGINAL_CMAKE_MODULE_PATH}) + +# Handle components +# imported from https://github.com/Kitware/CMake/blob/v3.7.1/Modules/CMakePackageConfigHelpers.cmake#L300 +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +check_required_components(OGRE)
\ No newline at end of file |
