You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FindOpenViBEVisualizationToolkit.cmake 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # ---------------------------------
  2. # Finds openvibe-toolkit
  3. # Adds library to target
  4. # Adds include path
  5. # ---------------------------------
  6. option(LINK_OPENVIBE_VISUALIZATION_TOOLKIT "By default, link openvibe-visualization-toolkit, otherwise only use the includes" ON)
  7. option(DYNAMIC_LINK_OPENVIBE_VISUALIZATION_TOOLKIT "Dynamically link openvibe-visualization-toolkit" ON)
  8. if(NOT CMAKE_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio*")
  9. set(MULTI_BUILD TRUE)
  10. elseif(CMAKE_BUILD_TYPE AND OV_PACKAGE)
  11. set(SOLO_PACKAGE TRUE)
  12. elseif(CMAKE_BUILD_TYPE)
  13. set(SOLO_BUILD TRUE)
  14. else()
  15. message(FATAL_ERROR "Build should specify a type or use a multi-type generator (like Visual Studio)")
  16. endif()
  17. if(DYNAMIC_LINK_OPENVIBE_VISUALIZATION_TOOLKIT)
  18. set(OPENVIBE_VISUALIZATION_TOOLKIT_LINKING "")
  19. add_definitions(-DOVVIZ_Shared)
  20. if(WIN32)
  21. set(LIB_EXT lib)
  22. elseif(APPLE)
  23. set(LIB_PREFIX "lib")
  24. set(LIB_EXT "dylib")
  25. elseif(UNIX)
  26. set(LIB_PREFIX "lib")
  27. set(LIB_EXT "so")
  28. endif()
  29. else()
  30. set(OPENVIBE_VISUALIZATION_TOOLKIT_LINKING "-static")
  31. add_definitions(-DOVVIZ_Static)
  32. if(WIN32)
  33. set(LIB_EXT lib)
  34. elseif(UNIX)
  35. set(LIB_PREFIX "lib")
  36. set(LIB_EXT "a")
  37. endif()
  38. endif()
  39. # set(PATH_OPENVIBE_VISUALIZATION_TOOLKIT "PATH_OPENVIBE_VISUALIZATION_TOOLKIT-NOTFOUND")
  40. if(MULTI_BUILD)
  41. # set(DESIGNER_SDK_PATH ${DESIGNER_SDK_PATH}/$<UPPER_CASE:$<CONFIG>>)
  42. set(PATH_OPENVIBE_VISUALIZATION_TOOLKIT ${DESIGNER_SDK_PATH}/include)
  43. else()
  44. find_path(PATH_OPENVIBE_VISUALIZATION_TOOLKIT visualization-toolkit/ovviz_all.h PATHS ${DESIGNER_SDK_PATH}/include/ NO_DEFAULT_PATH)
  45. endif()
  46. if(PATH_OPENVIBE_VISUALIZATION_TOOLKIT)
  47. message(STATUS " Found openvibe-visualization-toolkit... ${PATH_OPENVIBE_VISUALIZATION_TOOLKIT}")
  48. include_directories(${PATH_OPENVIBE_VISUALIZATION_TOOLKIT}/)
  49. if(LINK_OPENVIBE_VISUALIZATION_TOOLKIT)
  50. # find_library(VISUALIZATION_TOOLKIT_LIBRARY openvibe-visualization-toolkit${OPENVIBE_VISUALIZATION_TOOLKIT_LINKING} PATHS ${DESIGNER_SDK_PATH}/lib NO_DEFAULT_PATH)
  51. set(VISUALIZATION_TOOLKIT_LIBRARY ${DESIGNER_SDK_PATH}/lib/${LIB_PREFIX}openvibe-visualization-toolkit${OPENVIBE_VISUALIZATION_TOOLKIT_LINKING}.${LIB_EXT})
  52. target_link_libraries(${PROJECT_NAME} ${VISUALIZATION_TOOLKIT_LIBRARY})
  53. endif()
  54. add_definitions(-DTARGET_HAS_OpenViBEVisualizationToolkit)
  55. else()
  56. message(WARNING " FAILED to find openvibe-visualization-toolkit... [${PATH_OPENVIBE_VISUALIZATION_TOOLKIT}]")
  57. endif()