Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
instant-ngp-tomography
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Pickles
instant-ngp-tomography
Commits
c4d622ea
Commit
c4d622ea
authored
2 years ago
by
Thomas Müller
Browse files
Options
Downloads
Patches
Plain Diff
Make FindOptiX.cmake agnostic to the OptiX version
parent
3b085e02
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/FindOptiX.cmake
+35
-44
35 additions, 44 deletions
cmake/FindOptiX.cmake
with
35 additions
and
44 deletions
cmake/FindOptiX.cmake
+
35
−
44
View file @
c4d622ea
...
...
@@ -30,63 +30,54 @@
# Our initial guess will be within the SDK.
if
(
DEFINED ENV{OptiX_INSTALL_DIR}
)
set
(
OptiX_IN
STALL
_DIR
$ENV{OptiX_INSTALL_DIR}
)
set
(
OptiX_IN
CLUDE
_DIR
S
"
$ENV{OptiX_INSTALL_DIR}
/include"
)
else
()
message
(
NOTICE
"-- !!! Warning OptiX_INSTALL_DIR not set in environment. using default"
)
if
(
MSVC
)
set
(
OptiX_INSTALL_DIR
"C:
\\
ProgramData
\\
NVIDIA Corporation
\\
OptiX SDK 7.5.0"
)
else
()
set
(
OptiX_INSTALL_DIR
"/usr/local/NVIDIA-OptiX-SDK-7.5.0-linux64-x86_64"
)
endif
()
#set(OptiX_INSTALL_DIR "${CMAKE_SOURCE_DIR}/../" CACHE PATH "Path to OptiX installed location.")
if
(
MSVC
)
file
(
GLOB OptiX_INCLUDE_DIRS
"C:/ProgramData/NVIDIA Corporation/OptiX SDK */include"
)
else
()
file
(
GLOB OptiX_INCLUDE_DIRS
"/usr/local/NVIDIA-OptiX-SDK-*-linux64-x86_64/include"
)
endif
()
endif
()
message
(
NOTICE
"-- OptiX_INSTALL_DIR value:
${
OptiX_INSTALL_DIR
}
"
)
# The distribution contains only 64 bit libraries. Error when we have been mis-configured.
if
(
NOT CMAKE_SIZEOF_VOID_P EQUAL 8
)
if
(
WIN32
)
message
(
SEND_ERROR
"Make sure when selecting the generator, you select one with Win64 or x64."
)
endif
()
message
(
FATAL_ERROR
"OptiX only supports builds configured for 64 bits."
)
if
(
NOT CMAKE_SIZEOF_VOID_P EQUAL 8
)
if
(
WIN32
)
message
(
SEND_ERROR
"Make sure when selecting the generator, you select one with Win64 or x64."
)
endif
()
message
(
FATAL_ERROR
"OptiX only supports builds configured for 64 bits."
)
endif
()
# search path based on the bit-ness of the build. (i.e. 64: bin64, lib64; 32:
# bin, lib). Note that on Mac, the OptiX library is a universal binary, so we
# only need to look in lib and not lib64 for 64 bit builds.
if
(
NOT APPLE
)
set
(
bit_dest
"64"
)
else
()
set
(
bit_dest
""
)
endif
()
# Include
# Sort optix directories in descending natural order such that the highest version comes first.
list
(
SORT OptiX_INCLUDE_DIRS COMPARE NATURAL ORDER DESCENDING
)
find_path
(
OptiX_INCLUDE
NAMES optix.h
PATHS
"
${
OptiX_IN
STALL_DIR
}
/include"
NO_DEFAULT_PATH
)
NAMES optix.h
PATHS
${
OptiX_IN
CLUDE_DIRS
}
NO_DEFAULT_PATH
)
find_path
(
OptiX_INCLUDE
NAMES optix.h
)
NAMES optix.h
)
# Check to make sure we found what we were looking for
function
(
OptiX_report_error error_message required component
)
if
(
DEFINED OptiX_FIND_REQUIRED_
${
component
}
AND NOT OptiX_FIND_REQUIRED_
${
component
}
)
set
(
required FALSE
)
endif
()
if
(
OptiX_FIND_REQUIRED AND required
)
message
(
FATAL_ERROR
"
${
error_message
}
Please locate before proceeding."
)
else
()
if
(
NOT OptiX_FIND_QUIETLY
)
message
(
STATUS
"
${
error_message
}
"
)
endif
(
NOT OptiX_FIND_QUIETLY
)
endif
()
if
(
DEFINED OptiX_FIND_REQUIRED_
${
component
}
AND NOT OptiX_FIND_REQUIRED_
${
component
}
)
set
(
required FALSE
)
endif
()
if
(
OptiX_FIND_REQUIRED AND required
)
message
(
FATAL_ERROR
"
${
error_message
}
Please locate before proceeding."
)
else
()
if
(
NOT OptiX_FIND_QUIETLY
)
message
(
STATUS
"
${
error_message
}
"
)
endif
(
NOT OptiX_FIND_QUIETLY
)
endif
()
endfunction
()
if
(
NOT OptiX_INCLUDE
)
OptiX_report_error
(
"OptiX headers (optix.h and friends) not found."
TRUE headers
)
set
(
OptiX_FOUND FALSE
)
if
(
NOT OptiX_INCLUDE
)
OptiX_report_error
(
"OptiX headers (optix.h and friends) not found."
TRUE headers
)
set
(
OptiX_FOUND FALSE
)
else
()
set
(
OptiX_FOUND TRUE
)
get_filename_component
(
OptiX_INSTALL_DIR
${
OptiX_INCLUDE
}
DIRECTORY
)
set
(
OptiX_FOUND TRUE
)
message
(
NOTICE
"-- Found OptiX:
${
OptiX_INSTALL_DIR
}
"
)
endif
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment