mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2026-10-25 22:28:17 +08:00
Bug 5133197: Add cmake toolchain and and update the CMakeList of some sample for tegra linux cross build
This commit is contained in:
@@ -27,9 +27,13 @@ include(CheckIncludeFile)
|
||||
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
|
||||
|
||||
# Find GLFW header and lib for Windows
|
||||
if(WIN32)
|
||||
find_file(GLFW3_H "GLFW/glfw3.h" PATH "${GLFW_INCLUDE_DIR}")
|
||||
find_library(GLFW3_LIB "glfw3" PATH "${GLFW_LIB_DIR}")
|
||||
if(WIN32 OR CMAKE_CROSSCOMPILING)
|
||||
set(GLFW_INCLUDE_DIRS "${GLFW_INCLUDE_DIR}" "${CMAKE_INCLUDE_PATH}")
|
||||
find_file(GLFW3_H "GLFW/glfw3.h" PATHS ${GLFW_INCLUDE_DIRS})
|
||||
find_library(GLFW3_LIB
|
||||
NAMES glfw3 glfw
|
||||
PATHS "${GLFW_LIB_DIR}"
|
||||
PATH_SUFFIXES lib lib64)
|
||||
if(GLFW3_H AND GLFW3_LIB)
|
||||
message(STATUS "Found GLFW/glfw3.h and GLFW library.")
|
||||
set(HAVE_GLFW3_H 1)
|
||||
@@ -58,9 +62,9 @@ if(${Vulkan_FOUND})
|
||||
OpenGL::GL
|
||||
CUDA::cuda_driver
|
||||
)
|
||||
if(WIN32)
|
||||
if(WIN32 OR CMAKE_CROSSCOMPILING)
|
||||
target_include_directories(simpleVulkanMMAP PUBLIC
|
||||
${GLFW_INCLUDE_DIR}
|
||||
${GLFW_INCLUDE_DIRS}
|
||||
)
|
||||
target_link_libraries(simpleVulkanMMAP
|
||||
${GLFW3_LIB}
|
||||
|
||||
Reference in New Issue
Block a user