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.

FindLibMensiaAdvancedVisualisation.cmake 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # ---------------------------------
  2. # Finds mensia's advanced visualization toolkit
  3. # Adds library to target
  4. # Adds include path
  5. # ---------------------------------
  6. option(LINK_LIBADVVIZ "By default, link libadvviz, otherwise only use the includes" ON)
  7. option(DYNAMIC_LINK_LIBADVVIZ "Dynamically link libadvviz" OFF)
  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_LIBADVVIZ)
  18. message(STATUS "Dynamic linking libadvviz")
  19. set(LIBADVVIZ_LINKING "")
  20. add_definitions(-DADVVIZ_Shared)
  21. if(WIN32)
  22. set(LIB_EXT lib)
  23. elseif(APPLE)
  24. set(LIB_PREFIX "lib")
  25. set(LIB_EXT "dylib")
  26. elseif(UNIX)
  27. set(LIB_PREFIX "lib")
  28. set(LIB_EXT "so")
  29. endif()
  30. else()
  31. message(STATUS "Static linking libadvviz")
  32. set(LIBADVVIZ_LINKING "-static")
  33. add_definitions(-DADVVIZ_Static)
  34. if(WIN32)
  35. set(LIB_EXT lib)
  36. elseif(UNIX)
  37. set(LIB_PREFIX "lib")
  38. set(LIB_EXT "a")
  39. endif()
  40. endif()
  41. # set(PATH_LIBADVVIZ "PATH_LIBADVVIZ-NOTFOUND")
  42. if(MULTI_BUILD)
  43. # set(DESIGNER_SDK_PATH ${DESIGNER_SDK_PATH}/$<UPPER_CASE:$<CONFIG>>)
  44. set(PATH_LIBADVVIZ ${DESIGNER_SDK_PATH}/include)
  45. else()
  46. find_path(PATH_LIBADVVIZ mensia/ PATHS ${DESIGNER_SDK_PATH}/include/ NO_DEFAULT_PATH)
  47. endif()
  48. if(PATH_LIBADVVIZ)
  49. message(STATUS " Found libadvviz... ${PATH_LIBADVVIZ}")
  50. include_directories(${PATH_LIBADVVIZ}/)
  51. if(LINK_LIBADVVIZ)
  52. # find_library(PATH libadvviz${LIBADVVIZ_LINKING} PATHS ${DESIGNER_SDK_PATH}/lib NO_DEFAULT_PATH)
  53. # set(VISUALIZATION_TOOLKIT_LIBRARY ${DESIGNER_SDK_PATH}/lib/${LIB_PREFIX}libadvviz${LIBADVVIZ_LINKING}.${LIB_EXT})
  54. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PATH_LIBADVVIZ}/../lib/${LIB_PREFIX}mensia-advanced-visualization${LIBADVVIZ_LINKING}.${LIB_EXT})
  55. endif()
  56. add_definitions(-DTARGET_HAS_LibAdvancedVisualization)
  57. else()
  58. message(WARNING " FAILED to find libadvviz... [${PATH_LIBADVVIZ}]")
  59. endif()