Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
David Golden
CMake
Commits
52b6effd
Commit
52b6effd
authored
8 years ago
by
Brad King
Browse files
Options
Downloads
Patches
Plain Diff
Android: Detect and save the NDK directory
Add a new CMakeSystem.cmake entry for the NDK location.
parent
8e0cb45e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/Platform/Android-Determine.cmake
+27
-0
27 additions, 0 deletions
Modules/Platform/Android-Determine.cmake
with
27 additions
and
0 deletions
Modules/Platform/Android-Determine.cmake
+
27
−
0
View file @
52b6effd
...
...
@@ -12,6 +12,8 @@
# License text for the above reference.)
# When CMAKE_SYSTEM_NAME is "Android", CMakeDetermineSystem loads this module.
# This module detects platform-wide information about the Android target
# in order to store it in "CMakeSystem.cmake".
# Support for NVIDIA Nsight Tegra Visual Studio Edition was previously
# implemented in the CMake VS IDE generators. Avoid interfering with
...
...
@@ -19,3 +21,28 @@
if
(
CMAKE_VS_PLATFORM_NAME STREQUAL
"Tegra-Android"
)
return
()
endif
()
# Find the Android NDK.
if
(
CMAKE_ANDROID_NDK
)
if
(
NOT IS_DIRECTORY
"
${
CMAKE_ANDROID_NDK
}
"
)
message
(
FATAL_ERROR
"Android: The NDK root directory specified by CMAKE_ANDROID_NDK:
\n
"
"
${
CMAKE_ANDROID_NDK
}
\n
"
"does not exist."
)
endif
()
else
()
if
(
IS_DIRECTORY
"$ENV{ANDROID_NDK_ROOT}"
)
file
(
TO_CMAKE_PATH
"$ENV{ANDROID_NDK_ROOT}"
CMAKE_ANDROID_NDK
)
endif
()
# TODO: Search harder for the NDK.
endif
()
if
(
NOT CMAKE_ANDROID_NDK
)
message
(
FATAL_ERROR
"Android: The NDK root directory was not found."
)
endif
()
# Save the Android-specific information in CMakeSystem.cmake.
set
(
CMAKE_SYSTEM_CUSTOM_CODE
"
set(CMAKE_ANDROID_NDK
\"
${
CMAKE_ANDROID_NDK
}
\"
)
"
)
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