aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 44c125af17d5aaec14b51d24c4feb86aa87dc563 (plain)
  1. project(cmark)
  2. cmake_minimum_required(VERSION 2.8)
  3. if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
  4. message(FATAL_ERROR "Do not build in-source.\nPlease remove CMakeCache.txt and the CMakeFiles/ directory.\nThen: mkdir build ; cd build ; cmake .. ; make")
  5. endif()
  6. set(PROJECT_NAME "cmark")
  7. set(PROJECT_VERSION_MAJOR 0)
  8. set(PROJECT_VERSION_MINOR 0)
  9. set(PROJECT_VERSION_PATCH 1)
  10. set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} )
  11. add_subdirectory(src)
  12. if(NOT CMAKE_BUILD_TYPE)
  13. set(CMAKE_BUILD_TYPE "Release" CACHE STRING
  14. "Choose the type of build, options are: Debug Release." FORCE)
  15. endif(NOT CMAKE_BUILD_TYPE)
  16. set(CPACK_GENERATOR TGZ ZIP)
  17. if(WIN32 AND NOT CYGWIN)
  18. set(CPACK_GENERATOR NSIS ${CPACK_GENERATOR})
  19. endif(WIN32 AND NOT CYGWIN)
  20. if(APPLE)
  21. set(CPACK_GENERATOR DragNDrop ${CPACK_GENERATOR})
  22. endif(APPLE)
  23. if (UNIX AND NOT APPLE AND NOT WIN32)
  24. set(CPACK_GENERATOR DEB ${CPACK_GENERATOR})
  25. endif (UNIX AND NOT APPLE AND NOT WIN32)
  26. set(CPACK_SOURCE_PACKAGE_FILE_NAME ${PROJECT_NAME}-src-${PROJECT_VERSION})
  27. set(CPACK_SOURCE_GENERATOR TGZ ZIP)
  28. set(CPACK_PACKAGE_CONTACT http://talk.commonmark.org/)
  29. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_NAME})
  30. set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME} Development Team")
  31. set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
  32. set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
  33. set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
  34. set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
  35. set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
  36. set(CPACK_SOURCE_IGNORE_FILES "/docs/html;/autom4te.cache;/build/;/win32/;/.svn/;~$;${CPACK_SOURCE_IGNORE_FILES}")
  37. if(WIN32 AND NOT UNIX)
  38. set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}\\\\${PROJECT_VERSION}")
  39. # There is a bug in NSI that does not handle full unix paths properly. Make
  40. # sure there is at least one set of four (4) backlashes.
  41. # set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
  42. set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\${PROJECT_NAME}.exe")
  43. set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
  44. set(CPACK_NSIS_HELP_LINK "http://commonmark.org/")
  45. set(CPACK_NSIS_URL_INFO_ABOUT "http://commonmark.org/")
  46. set(CPACK_NSIS_CONTACT "http://talk.commonmark.org/")
  47. set(CPACK_NSIS_MODIFY_PATH ON)
  48. set(CPACK_NSIS_MENU_LINKS "doc/html/index.html;Documentation")
  49. else(WIN32 AND NOT UNIX)
  50. set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}/${PROJECT_VERSION}")
  51. set(CPACK_STRIP_FILES "bin/${PROJECT_NAME}")
  52. set(CPACK_SOURCE_STRIP_FILES "")
  53. endif(WIN32 AND NOT UNIX)
  54. set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME};${PROJECT_NAME})
  55. include(CPack)