Skip to content

Commit 30c6bf7

Browse files
committed
cmake: Auto discover NXDK_DIR
1 parent 2aab910 commit 30c6bf7

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

share/toolchain-nxdk.cmake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
if(DEFINED ENV{NXDK_DIR})
2-
set(NXDK_DIR $ENV{NXDK_DIR})
3-
else()
4-
message(FATAL_ERROR "The environment variable NXDK_DIR needs to be defined.")
5-
endif()
1+
get_filename_component(NXDK_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
2+
set(NXDK_DIR "${NXDK_ROOT_DIR}" CACHE PATH "Path to the nxdk root directory.")
3+
message(STATUS "Using NXDK from: ${NXDK_DIR}")
64

75
set(CMAKE_SYSTEM_NAME Generic)
86
set(CMAKE_SYSTEM_VERSION 1)

0 commit comments

Comments
 (0)