Fix build on linux
This commit is contained in:
56
cmake/modules/FindASSIMP.cmake
Normal file
56
cmake/modules/FindASSIMP.cmake
Normal file
@@ -0,0 +1,56 @@
|
||||
# Find assimp
|
||||
# Copyright © 2016 Dylan Baker
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining
|
||||
# a copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
# Provides a subset of what the one would get by calling CONFIG REQUIRED
|
||||
# directly, it will unset any unsupported versions
|
||||
# Currently it provides the following:
|
||||
# ASSIMP_FOUND -- TRUE if assimp was found
|
||||
# ASSIMP_LIBRARIES -- Libraries to link against
|
||||
|
||||
find_package(ASSIMP CONFIG)
|
||||
if (ASSIMP_LIBRARIES)
|
||||
# Unset variables that would be difficult to get via the find module
|
||||
unset(ASSIMP_ROOT_DIR)
|
||||
unset(ASSIMP_CXX_FLAGS)
|
||||
unset(ASSIMP_LINK_FLAGS)
|
||||
unset(ASSIMP_Boost_VERSION)
|
||||
|
||||
# TODO: It would be nice to find these, but they're not being used at the
|
||||
# moment. They also need to be added to REQUIRED_VARS if added
|
||||
unset(ASSIMP_INCLUDE_DIRS)
|
||||
unset(ASSIMP_LIBRARY_DIRS)
|
||||
|
||||
# Like the found path
|
||||
set(ASSIMP_FOUND TRUE)
|
||||
message("-- Found ASSIMP")
|
||||
else ()
|
||||
find_library(ASSIMP_LIBRARIES
|
||||
NAMES assimp
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
ASSIMP
|
||||
REQUIRED_VARS ASSIMP_LIBRARIES
|
||||
)
|
||||
endif (ASSIMP_LIBRARIES)
|
||||
|
||||
set(ASSIMP_FOUND True)
|
||||
51
cmake/modules/FindXCB.cmake
Normal file
51
cmake/modules/FindXCB.cmake
Normal file
@@ -0,0 +1,51 @@
|
||||
# - FindXCB
|
||||
#
|
||||
# Copyright 2015 Valve Coporation
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
if(NOT XCB_FIND_COMPONENTS)
|
||||
set(XCB_FIND_COMPONENTS xcb)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
set(XCB_FOUND true)
|
||||
set(XCB_INCLUDE_DIRS "")
|
||||
set(XCB_LIBRARIES "")
|
||||
foreach(comp ${XCB_FIND_COMPONENTS})
|
||||
# component name
|
||||
string(TOUPPER ${comp} compname)
|
||||
string(REPLACE "-" "_" compname ${compname})
|
||||
# header name
|
||||
string(REPLACE "xcb-" "" headername xcb/${comp}.h)
|
||||
# library name
|
||||
set(libname ${comp})
|
||||
|
||||
pkg_check_modules(PC_${comp} QUIET ${comp})
|
||||
|
||||
find_path(${compname}_INCLUDE_DIR NAMES ${headername}
|
||||
HINTS
|
||||
${PC_${comp}_INCLUDEDIR}
|
||||
${PC_${comp}_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
find_library(${compname}_LIBRARY NAMES ${libname}
|
||||
HINTS
|
||||
${PC_${comp}_LIBDIR}
|
||||
${PC_${comp}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
find_package_handle_standard_args(${comp}
|
||||
FOUND_VAR ${comp}_FOUND
|
||||
REQUIRED_VARS ${compname}_INCLUDE_DIR ${compname}_LIBRARY)
|
||||
mark_as_advanced(${compname}_INCLUDE_DIR ${compname}_LIBRARY)
|
||||
|
||||
list(APPEND XCB_INCLUDE_DIRS ${${compname}_INCLUDE_DIR})
|
||||
list(APPEND XCB_LIBRARIES ${${compname}_LIBRARY})
|
||||
|
||||
if(NOT ${comp}_FOUND)
|
||||
set(XCB_FOUND false)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list(REMOVE_DUPLICATES XCB_INCLUDE_DIRS)
|
||||
Reference in New Issue
Block a user