Use_wxWindows.cmake 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #.rst:
  4. # Use_wxWindows
  5. # -------------
  6. #
  7. #
  8. #
  9. #
  10. # This convenience include finds if wxWindows is installed and set the
  11. # appropriate libs, incdirs, flags etc. author Jan Woetzel <jw -at-
  12. # mip.informatik.uni-kiel.de> (07/2003)
  13. #
  14. # USAGE:
  15. #
  16. # ::
  17. #
  18. # just include Use_wxWindows.cmake
  19. # in your projects CMakeLists.txt
  20. #
  21. # include( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
  22. #
  23. # ::
  24. #
  25. # if you are sure you need GL then
  26. #
  27. # set(WXWINDOWS_USE_GL 1)
  28. #
  29. # ::
  30. #
  31. # *before* you include this file.
  32. # -----------------------------------------------------
  33. # 16.Feb.2004: changed INCLUDE to FIND_PACKAGE to read from users own non-system CMAKE_MODULE_PATH (Jan Woetzel JW)
  34. # 07/2006: rewrite as FindwxWidgets.cmake, kept for backward compatibility JW
  35. message(STATUS "Use_wxWindows.cmake is DEPRECATED. \n"
  36. "Please use find_package(wxWidgets) and include(${wxWidgets_USE_FILE}) instead. (JW)")
  37. # ------------------------
  38. find_package( wxWindows )
  39. if(WXWINDOWS_FOUND)
  40. #message("DBG Use_wxWindows.cmake: WXWINDOWS_INCLUDE_DIR=${WXWINDOWS_INCLUDE_DIR} WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES} WXWINDOWS_LIBRARIES=${WXWINDOWS_LIBRARIES} CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS} WXWINDOWS_DEFINITIONS=${WXWINDOWS_DEFINITIONS}")
  41. if(WXWINDOWS_INCLUDE_DIR)
  42. include_directories(${WXWINDOWS_INCLUDE_DIR})
  43. endif()
  44. if(WXWINDOWS_LINK_DIRECTORIES)
  45. link_directories(${WXWINDOWS_LINK_DIRECTORIES})
  46. endif()
  47. if(WXWINDOWS_LIBRARIES)
  48. link_libraries(${WXWINDOWS_LIBRARIES})
  49. endif()
  50. if (CMAKE_WXWINDOWS_CXX_FLAGS)
  51. string(APPEND CMAKE_CXX_FLAGS " ${CMAKE_WXWINDOWS_CXX_FLAGS}")
  52. endif()
  53. if(WXWINDOWS_DEFINITIONS)
  54. add_definitions(${WXWINDOWS_DEFINITIONS})
  55. endif()
  56. else()
  57. message(SEND_ERROR "wxWindows not found by Use_wxWindows.cmake")
  58. endif()