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.

89 lines
3.4 KiB

  1. # - Convenience include for using wxWidgets library.
  2. # Determines if wxWidgets was FOUND and sets the appropriate libs, incdirs,
  3. # flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES are called.
  4. #
  5. # USAGE
  6. # # Note that for MinGW users the order of libs is important!
  7. # FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
  8. # INCLUDE(${wxWidgets_USE_FILE})
  9. # # and for each of your dependent executable/library targets:
  10. # TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
  11. #
  12. # DEPRECATED
  13. # LINK_LIBRARIES is not called in favor of adding dependencies per target.
  14. #
  15. # AUTHOR
  16. # Jan Woetzel <jw -at- mip.informatik.uni-kiel.de>
  17. #=============================================================================
  18. # Copyright 2004-2009 Kitware, Inc.
  19. # Copyright 2006 Jan Woetzel
  20. #
  21. # Distributed under the OSI-approved BSD License (the "License");
  22. # see accompanying file Copyright.txt for details.
  23. #
  24. # This software is distributed WITHOUT ANY WARRANTY; without even the
  25. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  26. # See the License for more information.
  27. #=============================================================================
  28. # (To distribute this file outside of CMake, substitute the full
  29. # License text for the above reference.)
  30. # debug message and logging.
  31. # comment these out for distribution
  32. IF (NOT LOGFILE )
  33. # SET(LOGFILE "${PROJECT_BINARY_DIR}/CMakeOutput.log")
  34. ENDIF (NOT LOGFILE )
  35. MACRO(MSG _MSG)
  36. # FILE(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}\n")
  37. # MESSAGE(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
  38. ENDMACRO(MSG)
  39. MSG("wxWidgets_FOUND=${wxWidgets_FOUND}")
  40. IF (wxWidgets_FOUND)
  41. IF (wxWidgets_INCLUDE_DIRS)
  42. IF(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
  43. INCLUDE_DIRECTORIES(${wxWidgets_INCLUDE_DIRS})
  44. ELSE(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
  45. INCLUDE_DIRECTORIES(SYSTEM ${wxWidgets_INCLUDE_DIRS})
  46. ENDIF(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
  47. MSG("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}")
  48. ENDIF(wxWidgets_INCLUDE_DIRS)
  49. IF (wxWidgets_LIBRARY_DIRS)
  50. LINK_DIRECTORIES(${wxWidgets_LIBRARY_DIRS})
  51. MSG("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}")
  52. ENDIF(wxWidgets_LIBRARY_DIRS)
  53. IF (wxWidgets_DEFINITIONS)
  54. SET_PROPERTY(DIRECTORY APPEND
  55. PROPERTY COMPILE_DEFINITIONS ${wxWidgets_DEFINITIONS})
  56. MSG("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}")
  57. ENDIF(wxWidgets_DEFINITIONS)
  58. IF (wxWidgets_DEFINITIONS_DEBUG)
  59. SET_PROPERTY(DIRECTORY APPEND
  60. PROPERTY COMPILE_DEFINITIONS_DEBUG ${wxWidgets_DEFINITIONS_DEBUG})
  61. MSG("wxWidgets_DEFINITIONS_DEBUG=${wxWidgets_DEFINITIONS_DEBUG}")
  62. ENDIF(wxWidgets_DEFINITIONS_DEBUG)
  63. IF (wxWidgets_CXX_FLAGS)
  64. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${wxWidgets_CXX_FLAGS}")
  65. MSG("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}")
  66. ENDIF(wxWidgets_CXX_FLAGS)
  67. # DEPRECATED JW
  68. # just for backward compatibility: add deps to all targets
  69. # library projects better use advanced FIND_PACKAGE(wxWidgets) directly.
  70. #IF(wxWidgets_LIBRARIES)
  71. # LINK_LIBRARIES(${wxWidgets_LIBRARIES})
  72. # # BUG: str too long: MSG("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}")
  73. # IF(LOGFILE)
  74. # FILE(APPEND ${LOGFILE} "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${wxWidgets_LIBRARIES}\n")
  75. # ENDIF(LOGFILE)
  76. #ENDIF(wxWidgets_LIBRARIES)
  77. ELSE (wxWidgets_FOUND)
  78. MESSAGE("wxWidgets requested but not found.")
  79. ENDIF(wxWidgets_FOUND)