if (NOT FIND_INVRS_LOADED) message (STATUS "Check for inVRs directory: ${INVRS_DIR}") set (DEFAULT_INVRS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../) find_path (INVRS_DIR src/inVRs/SystemCore/SystemCore.h PATHS ${INVRS_DIR} ${DEFAULT_INVRS_DIR}) find_file (CHECK_INVRS_DIR src/inVRs/SystemCore/SystemCore.h PATHS ${INVRS_DIR}) if (NOT INVRS_DIR) message (FATAL_ERROR "Unable to find inVRs directory!\n" "Please pass the path to the inVRs directory to the cmake command, e.g.:\n" "\tcmake -DINVRS_DIR=/path/to/inVRs\n" "or enter the directory into the 'user.cmake' file\n" "You can download inVRs from http://www.inVRs.org\n") elseif (NOT CHECK_INVRS_DIR) message (FATAL_ERROR "Invalid inVRs directory passed!\n" "The inVRs directory must contain the subfolder src/SystemCore, e.g.:\n" "\t//src/SystemCore/SystemCore.h\n" "Please set the correct path in the 'user.cmake' file or pass it to cmake, e.g.:\n" "\tcmake -DINVRS_DIR=/path/to/inVRs") else (NOT INVRS_DIR) message (STATUS "Check for inVRs directory: ${INVRS_DIR} - done") endif (NOT INVRS_DIR) message (STATUS "Check for inVRs include directory: ${INVRS_INCLUDE_DIR}") find_path (INVRS_INCLUDE_DIR inVRs/SystemCore/SystemCore.h PATHS ${INVRS_INCLUDE_DIR} ${INVRS_DIR}/include) find_file (CHECK_INVRS_INCLUDE_DIR inVRs/SystemCore/SystemCore.h PATHS ${INVRS_INCLUDE_DIR}) if (NOT INVRS_INCLUDE_DIR) message (FATAL_ERROR "Unable to find inVRs include directory!\n" "The include-files for the inVRs installation could not be found.\n" "The files are expected to be in:\n" "${INVRS_DIR}/include\n" "Please ensure that you built AND INSTALLED inVRs!\n") elseif (NOT CHECK_INVRS_INCLUDE_DIR) message (FATAL_ERROR "Invalid inVRs include directory passed!\n" "The inVRs include directory must contain the subfolder inVRs/SystemCore, e.g.:\n" "\t//inVRs/SystemCore/SystemCore.h") else (NOT INVRS_INCLUDE_DIR) message (STATUS "Check for inVRs include directory: ${INVRS_INCLUDE_DIR} - done") endif (NOT INVRS_INCLUDE_DIR) message (STATUS "Check for inVRs library directory: ${INVRS_LIB_DIR}") if (WIN32) find_path (INVRS_LIB_DIR inVRsSystemCore.lib PATHS ${INVRS_DIR}/lib) find_file (CHECK_INVRS_LIB_DIR inVRsSystemCore.lib PATHS ${INVRS_LIB_DIR}) elseif (APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") find_path (INVRS_LIB_DIR libinVRsSystemCore.dylib PATHS ${INVRS_LIB_DIR} ${INVRS_DIR}/lib) find_file (CHECK_INVRS_LIB_DIR libinVRsSystemCore.dylib PATHS ${INVRS_LIB_DIR}) elseif (UNIX) find_path (INVRS_LIB_DIR libinVRsSystemCore.so PATHS ${INVRS_LIB_DIR} ${INVRS_DIR}/lib) find_file (CHECK_INVRS_LIB_DIR libinVRsSystemCore.so PATHS ${INVRS_LIB_DIR}) else (WIN32) message (FATAL_ERROR "Unable to identify target operating system!") endif (WIN32) if (NOT INVRS_LIB_DIR) message (FATAL_ERROR "Unable to find inVRs libraries!\n" "The library-files for the inVRs installation could not be found.\n" "The files are expected to be in:\n" "${INVRS_DIR}/lib\n" "Please ensure that you built and installed inVRs!\n") elseif (NOT CHECK_INVRS_LIB_DIR) if (NOT WIN32) message (FATAL_ERROR "Invalid inVRs library directory passed!\n" "The inVRs library directory must contain the inVRs libraries, e.g.:\n" "\t//libinVRsSystemCore.so") else (NOT WIN32) message (FATAL_ERROR "Invalid inVRs library directory passed!\n" "The inVRs library directory must contain the inVRs libraries, e.g.:\n" "\t//inVRsSystemCore.dll") endif (NOT WIN32) else (NOT INVRS_LIB_DIR) message (STATUS "Check for inVRs library directory: ${INVRS_LIB_DIR} - done") endif (NOT INVRS_LIB_DIR) set (INVRS_SOURCE_DIR ${INVRS_DIR}) set (FIND_INVRS_LOADED ON) endif (NOT FIND_INVRS_LOADED)