aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 350aeaed9d2eb9f42e7c2ca9e9ff7f0a5c2aa609 (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. set(CMAKE_BUILD_TYPE Release)
  13. set(CPACK_GENERATOR TGZ ZIP)
  14. if(WIN32 AND NOT CYGWIN)
  15. set(CPACK_GENERATOR NSIS ${CPACK_GENERATOR})
  16. endif(WIN32 AND NOT CYGWIN)
  17. if(APPLE)
  18. set(CPACK_GENERATOR DragNDrop ${CPACK_GENERATOR})
  19. endif(APPLE)
  20. if (UNIX AND NOT APPLE AND NOT WIN32)
  21. set(CPACK_GENERATOR DEB ${CPACK_GENERATOR})
  22. endif (UNIX AND NOT APPLE AND NOT WIN32)
  23. set(CPACK_SOURCE_PACKAGE_FILE_NAME ${PROJECT_NAME}-src-${PROJECT_VERSION})
  24. set(CPACK_SOURCE_GENERATOR TGZ ZIP)
  25. set(CPACK_PACKAGE_CONTACT http://talk.commonmark.org/)
  26. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_NAME})
  27. set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME} Development Team")
  28. set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
  29. set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
  30. set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
  31. set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
  32. set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
  33. set(CPACK_SOURCE_IGNORE_FILES "/docs/html;/autom4te.cache;/build/;/win32/;/.svn/;~$;${CPACK_SOURCE_IGNORE_FILES}")
  34. if(WIN32 AND NOT UNIX)
  35. set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}\\\\${PROJECT_VERSION}")
  36. # There is a bug in NSI that does not handle full unix paths properly. Make
  37. # sure there is at least one set of four (4) backlashes.
  38. # set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
  39. set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\${PROJECT_NAME}.exe")
  40. set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
  41. set(CPACK_NSIS_HELP_LINK "http://commonmark.org/")
  42. set(CPACK_NSIS_URL_INFO_ABOUT "http://commonmark.org/")
  43. set(CPACK_NSIS_CONTACT "http://talk.commonmark.org/")
  44. set(CPACK_NSIS_MODIFY_PATH ON)
  45. set(CPACK_NSIS_MENU_LINKS "doc/html/index.html;Documentation")
  46. else(WIN32 AND NOT UNIX)
  47. set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}/${PROJECT_VERSION}")
  48. set(CPACK_STRIP_FILES "bin/${PROJECT_NAME}")
  49. set(CPACK_SOURCE_STRIP_FILES "")
  50. endif(WIN32 AND NOT UNIX)
  51. set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME};${PROJECT_NAME})
  52. include(CPack)