FindGVLE.cmake 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # FindGVLE.cmake
  2. # ==============
  3. #
  4. # Try to find GVLE
  5. #
  6. # Copyright 2012-2014 INRA
  7. # Gauthier Quesnel <quesnel@users.sourceforge.net>
  8. # Ronan Trépos <ronan.trepos@toulouse.inra.fr>
  9. #
  10. # Distributed under the OS-approved BSD License (the "License");
  11. # This software is distributed WITHOUT ANY WARRANTY; without even the
  12. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. # See the License for more information.
  14. #
  15. # Once done this will define:
  16. #
  17. # GVLE_FOUND - The system has GVLE
  18. # GVLE_INCLUDE_DIR - The GVLE include directory
  19. # GVLE_LIBRARY_DIRS - Directories containing libraries to link
  20. # GVLE_LIBRARIES - Link these to use shared libraries of GVLE
  21. #
  22. # CMake variables used by this module:
  23. #
  24. # VLE_ABI_VERSION - gives the VLE version to search for (e.g 1.1, 1.2)
  25. # (REQUIRED)
  26. # GVLE_DEBUG - If true, prints debug traces
  27. # (default OFF)
  28. # GVLE_USING_CMAKE - If true, on windows, use cmake for finding GVLE,
  29. # else use pkgconfig
  30. # (default ON)
  31. # VLE_BASEPATH_LOCAL - cmake variable for base path of vle
  32. # (default NOT_DEFINED)
  33. #
  34. # Environment variables used by this module:
  35. #
  36. # VLE_BASEPATH - environment variable for base path of vle
  37. #
  38. #=============================================================================
  39. #
  40. # Notes :
  41. # ---------
  42. # FindGVLE will try to find GVLE, VLE and the gtkmm dependencies,
  43. # finding GVLE does not require to call FindVLE before
  44. #
  45. #=============================================================================
  46. #
  47. # Usage
  48. # -----
  49. #
  50. # set(VLE_ABI_VERSION 1.2)
  51. # find_package(GVLE REQUIRED)
  52. #
  53. #=============================================================================
  54. #
  55. # Check VLE_ABI_VERSION
  56. #
  57. if (NOT DEFINED VLE_ABI_VERSION)
  58. message (FATAL_ERROR "Cmake variable VLE_ABI_VERSION is not set")
  59. endif ()
  60. #
  61. # Set default behavior of find gvle
  62. #
  63. if (WIN32)
  64. if (DEFINED GVLE_USING_CMAKE)
  65. set (_find_gvle_using_cmake ${GVLE_USING_CMAKE})
  66. else ()
  67. set (_find_gvle_using_cmake 1)
  68. endif ()
  69. else ()
  70. set (_find_gvle_using_cmake 0)
  71. endif ()
  72. if (DEFINED GVLE_DEBUG)
  73. set (_gvle_debug ${GVLE_DEBUG})
  74. else ()
  75. set (_gvle_debug 0)
  76. endif ()
  77. #
  78. # Find GVLE
  79. #
  80. if (${_find_gvle_using_cmake})
  81. find_path(_gvle_base_include zlib.h PATHS
  82. $ENV{VLE_BASEPATH}/include
  83. ${VLE_BASEPATH_LOCAL}/include
  84. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\VLE ${VLE_ABI_VERSION}.0;Path]/include"
  85. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\VLE ${VLE_ABI_VERSION}.0;]/include"
  86. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\Wow6432Node\\VLE ${VLE_ABI_VERSION}.0;]/include")
  87. find_path(_gvle_base_bin zlib1.dll PATHS
  88. $ENV{VLE_BASEPATH}/bin
  89. ${VLE_BASEPATH_LOCAL}/bin
  90. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\VLE ${VLE_ABI_VERSION}.0;Path]/bin"
  91. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\VLE ${VLE_ABI_VERSION}.0;]/bin"
  92. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\Wow6432Node\\VLE ${VLE_ABI_VERSION}.0;]/bin")
  93. find_path(_gvle_base_lib libz.dll.a PATHS
  94. $ENV{VLE_BASEPATH}/lib
  95. ${VLE_BASEPATH_LOCAL}/lib
  96. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\VLE ${VLE_ABI_VERSION}.0;Path]/lib"
  97. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\VLE ${VLE_ABI_VERSION}.0;]/lib"
  98. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\VLE Development Team\\Wow6432Node\\VLE ${VLE_ABI_VERSION}.0;]/lib")
  99. if (${_gvle_debug})
  100. message (" gvle_debug _gvle_base_include ${_gvle_base_include}")
  101. message (" gvle_debug _gvle_base_bin ${_gvle_base_bin}")
  102. message (" gvle_debug _gvle_base_lib ${_gvle_base_lib}")
  103. endif ()
  104. if(NOT _gvle_base_include OR NOT _gvle_base_bin OR NOT _gvle_base_lib)
  105. message (FATAL_ERROR "Missing gvle dependencies")
  106. endif ()
  107. set(GVLE_INCLUDE_DIRS
  108. ${_gvle_base_include}/vle-${VLE_ABI_VERSION}; ${_gvle_base_include};
  109. ${_gvle_base_include}/gtkmm-2.4;${_gvle_base_lib}/gtkmm-2.4/include;
  110. ${_gvle_base_include}/cairomm-1.0;${_gvle_base_lib}/cairomm-1.0/include;
  111. ${_gvle_base_include}/atkmm-1.6;
  112. ${_gvle_base_include}/giomm-2.4;${_gvle_base_lib}/giomm-2.4/include;
  113. ${_gvle_base_include}/pangomm-1.4;${_gvle_base_lib}/pangomm-1.4/include;
  114. ${_gvle_base_include}/gdkmm-2.4;${_gvle_base_lib}/gdkmm-2.4/include;
  115. ${_gvle_base_include}/atk-1.0;
  116. ${_gvle_base_include}/glibmm-2.4;${_gvle_base_lib}/glibmm-2.4/include;
  117. ${_gvle_base_include}/glib-2.0;${_gvle_base_lib}/glib-2.0/include;
  118. ${_gvle_base_include}/sigc++-2.0;${_gvle_base_lib}/sigc++-2.0/include;
  119. ${_gvle_base_include}/pango-1.0;${_gvle_base_include}/cairo;
  120. ${_gvle_base_include}/freetype2;${_gvle_base_include}/libpgn14;
  121. ${_gvle_base_include}/gtk-2.0;${_gvle_base_lib}/gtk-2.0/include;
  122. ${_gvle_base_include}/gdk-pixbuf-2.0;
  123. ${_gvle_base_lib}/gdk-pixbuf-2.0/include;
  124. ${_gvle_base_include}/libxml2)
  125. set (GVLE_LIBRARY_DIRS
  126. ${_gvle_base_bin}; ${_gvle_base_lib};
  127. c:/devel/dist/win32/lipng-1.4.3-1/lib)
  128. set (GVLE_LIBRARIES
  129. gvle-${VLE_ABI_VERSION} gtkmm-2.4 vle-${VLE_ABI_VERSION} atkmm-1.6
  130. gdkmm-2.4 giomm-2.4 pangomm-1.4 gtk-win32-2.0 cairomm-1.0 gdk-win32-2.0
  131. atk-1.0 gio-2.0 pangowin32-1.0 gdi32 pangocairo-1.0 gdk_pixbuf-2.0 png14
  132. pango-1.0 gmodule-2.0 cairo xml2 glibmm-2.4 gobject-2.0 sigc-2.0
  133. gthread-2.0 glib-2.0 intl)
  134. else () # find gvle using pkg-config
  135. find_package(PkgConfig REQUIRED)
  136. PKG_CHECK_MODULES(GVLE gvle-${VLE_ABI_VERSION})
  137. endif ()
  138. # handle the QUIETLY and REQUIRED arguments and set GVLE_FOUND to TRUE if all
  139. # listed variables are TRUE
  140. include(FindPackageHandleStandardArgs)
  141. FIND_PACKAGE_HANDLE_STANDARD_ARGS(GVLE REQUIRED_VARS
  142. GVLE_INCLUDE_DIRS GVLE_LIBRARIES)
  143. if (${_gvle_debug})
  144. message (" gvle_debug GVLE_INCLUDE_DIRS ${GVLE_INCLUDE_DIRS}")
  145. message (" gvle_debug GVLE_LIBRARY_DIRS ${GVLE_LIBRARY_DIRS}")
  146. message (" gvle_debug GVLE_LIBRARIES ${GVLE_LIBRARIES}")
  147. endif ()
  148. #mark_as_advanced(GVLE_INCLUDE_DIRS GVLE_LIBRARIES GVLE_LIBRARY_DIRS)