SET(UNIX 1)

GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)

LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
  # Standard
  $ENV{BUILDLINK_DIR} $ENV{PREFIX} / /usr
  )

SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH}
  # Standard
  $ENV{BUILDLINK_DIR}/include /include /usr/include 

  )

SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}
  # Standard
  $ENV{BUILDLINK_DIR}/lib /lib     /usr/lib
  )

SET(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH}
  $ENV{BUILDLINK_DIR}/bin /bin /usr/bin /sbin
  )

LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
  /lib /usr/lib /usr/lib32 /usr/lib64
  )

# Enable use of lib64 search path variants by default.
SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
