PageRenderTime 67ms CodeModel.GetById 31ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/v5_7_1/CMakeLists.txt

#
CMake | 199 lines | 109 code | 26 blank | 64 comment | 11 complexity | 4c1958f8e525300d10fe7233bdb20127 MD5 | raw file
Possible License(s): LGPL-2.0, BSD-3-Clause-No-Nuclear-License-2014, Apache-2.0, GPL-2.0
  1. # Top-level CMakeLists.txt for PLplot
  2. ###
  3. ### Process this file with cmake to produce Makefile
  4. ###
  5. # Copyright (C) 2006 Alan W. Irwin
  6. #
  7. # This file is part of PLplot.
  8. #
  9. # PLplot is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU Library General Public License as published
  11. # by the Free Software Foundation; version 2 of the License.
  12. #
  13. # PLplot is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU Library General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU Library General Public License
  19. # along with PLplot; if not, write to the Free Software
  20. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. # Version 2.4.4 or above of cmake is required!
  22. CMAKE_MINIMUM_REQUIRED(VERSION 2.4.4 FATAL_ERROR)
  23. # Recommended way to do user overrides of C-related variables, is given at
  24. # http://public.kitware.com/pipermail/cmake/2006-July/010334.html.
  25. # See also, CMakeCInformation.cmake. There are also C++, and Fortran-specific
  26. # overrides that can be done. However, I prefer putting overrides in just
  27. # one file so I use the overall variable CMAKE_USER_MAKE_RULES_OVERRIDE
  28. # instead.
  29. set(
  30. CMAKE_USER_MAKE_RULES_OVERRIDE
  31. ${CMAKE_SOURCE_DIR}/cmake/UserOverride.cmake
  32. )
  33. project(plplot)
  34. set(PACKAGE plplot)
  35. # Location where PLplot cmake build system first looks for cmake modules.
  36. set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
  37. # Version data that need modification for each release.
  38. include(plplot_version)
  39. # parameters to control overall cmake behaviour.
  40. # Configure PLplot component variables....
  41. include(plplot)
  42. # Use configured variables to process configurable top-level files.
  43. configure_file(
  44. ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
  45. ${CMAKE_CURRENT_BINARY_DIR}/config.h
  46. )
  47. # Allow access to the generated config.h for this build.
  48. ADD_DEFINITIONS("-DHAVE_CONFIG_H")
  49. # Install top-level files
  50. # Enable testing framework for examples
  51. if (BUILD_TEST)
  52. enable_testing()
  53. endif (BUILD_TEST)
  54. # Disable warnings about deprecated functions (Visual C++ 2005)
  55. if(MSVC_VERSION GREATER 1399)
  56. ADD_DEFINITIONS("/D_CRT_SECURE_NO_DEPRECATE")
  57. endif(MSVC_VERSION GREATER 1399)
  58. # in windows all created dlls are gathered in the dll directory
  59. # if you add this directory to your PATH all shared libraries are available
  60. if(BUILD_SHARED_LIBS AND WIN32 AND NOT CYGWIN)
  61. SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dll)
  62. endif(BUILD_SHARED_LIBS AND WIN32 AND NOT CYGWIN)
  63. # Borland Compiler must compile in ANSII mode
  64. if(BORLAND)
  65. ADD_DEFINITIONS(-A)
  66. endif(BORLAND)
  67. set(top_level_DOCFILES
  68. AUTHORS
  69. COPYING.LIB
  70. ChangeLog
  71. Copyright
  72. FAQ
  73. NEWS
  74. PROBLEMS
  75. README
  76. README.release
  77. )
  78. install(FILES ${top_level_DOCFILES} DESTINATION ${DOC_DIR})
  79. # Process other directories including using configured variables to
  80. # process configurable files in those directories.
  81. # N.B. Order is important here at the cmake stage because targets must
  82. # be processed by cmake in a specific order e.g., due to get_target_property
  83. # invocations. Note, this order has nothing to do with the order which make
  84. # processes these subdirectories at build time. That build-time order
  85. # is determined by the dependencies between targets and also by file
  86. # dependencies that are established by the cmake configuration files.
  87. # needs no cmake processing
  88. #add_subdirectory(fonts)
  89. add_subdirectory(lib)
  90. add_subdirectory(include)
  91. add_subdirectory(src)
  92. add_subdirectory(data)
  93. add_subdirectory(bindings)
  94. add_subdirectory(drivers)
  95. add_subdirectory(examples)
  96. add_subdirectory(utils)
  97. add_subdirectory(test)
  98. add_subdirectory(scripts)
  99. add_subdirectory(doc)
  100. add_subdirectory(pkgcfg)
  101. # needs no cmake processing
  102. #add_subdirectory(cf)
  103. summary()
  104. if(PREBUILD_DIST)
  105. # Pre-build everything required for a distribution tarball and copy it to
  106. # the source tree (if build tree is different from source tree).
  107. # List of targets that must be (pre-)built.
  108. # N.B. the plhershey-unicode.h_built target has to be pre-built only because
  109. # of the needs of the old windows build at sys/win32/msdev.
  110. set(
  111. DIST_TARGETS
  112. plhershey-unicode.h_built
  113. )
  114. if(ENABLE_octave)
  115. set(DIST_TARGETS ${DIST_TARGETS} make_documentation)
  116. endif(ENABLE_octave)
  117. if(BUILD_PRINT)
  118. set(DIST_TARGETS ${DIST_TARGETS} print)
  119. endif(BUILD_PRINT)
  120. if(BUILD_INFO)
  121. set(DIST_TARGETS ${DIST_TARGETS} info)
  122. endif(BUILD_INFO)
  123. if(BUILD_MAN)
  124. set(DIST_TARGETS ${DIST_TARGETS} man)
  125. endif(BUILD_MAN)
  126. if(BUILD_HTML)
  127. set(DIST_TARGETS ${DIST_TARGETS} html)
  128. endif(BUILD_HTML)
  129. if(CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}")
  130. add_custom_target(prebuild_dist)
  131. else(CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}")
  132. # copy prebuilds back to source tree.
  133. add_custom_target(
  134. prebuild_dist
  135. COMMAND ${CMAKE_COMMAND} -E copy
  136. ${CMAKE_BINARY_DIR}/include/plhershey-unicode.h
  137. ${CMAKE_SOURCE_DIR}/include
  138. COMMAND ${CMAKE_COMMAND} -E copy_directory
  139. ${CMAKE_BINARY_DIR}/bindings/octave/plplot_octave_txt
  140. ${CMAKE_SOURCE_DIR}/bindings/octave/plplot_octave_txt
  141. COMMAND cp
  142. `cat static_built_files ${INFO_MANIFEST} ${MAN_MANIFEST} ${HTML_MANIFEST}`
  143. ${CMAKE_SOURCE_DIR}/doc/docbook/src
  144. WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/doc/docbook/src
  145. )
  146. endif(CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}")
  147. add_dependencies(prebuild_dist ${DIST_TARGETS})
  148. endif(PREBUILD_DIST)
  149. #
  150. # Packing stuff
  151. #
  152. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Scientific Plotting Library PLplot")
  153. set(CPACK_PACKAGE_VENDOR "PLplot development team")
  154. set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README)
  155. set(CPACK_GENERATOR TGZ)
  156. set(
  157. CPACK_SOURCE_PACKAGE_FILE_NAME
  158. "plplot-${VERSION}"
  159. CACHE INTERNAL "tarball basename"
  160. )
  161. set(CPACK_SOURCE_GENERATOR TGZ)
  162. # The following components are regex's to match anywhere (unless anchored)
  163. # in absolute path + filename to find files or directories to be excluded
  164. # from source tarball.
  165. set(CPACK_SOURCE_IGNORE_FILES
  166. "~$"
  167. "\\\\.cvsignore$"
  168. "^${PROJECT_SOURCE_DIR}.*/CVS/"
  169. "^${PROJECT_SOURCE_DIR}/debian/"
  170. "^${PROJECT_SOURCE_DIR}/old/"
  171. )
  172. #message("CPACK_SOURCE_IGNORE_FILES = ${CPACK_SOURCE_IGNORE_FILES}")
  173. include(CPack)