aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 3dc16a4a126dcd60034487e8cfbc5e0fd3f6101c (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(UNIX)
  13. INSTALL(FILES man/man1/cmark.1 DESTINATION share/man/man1)
  14. endif(UNIX)
  15. enable_testing()
  16. # To get verbose output: cmake --build build --target "test" -- ARGS='-V'
  17. add_test(spectest
  18. COMMAND perl "${CMAKE_SOURCE_DIR}/runtests.pl" "${CMAKE_SOURCE_DIR}/spec.txt" "${CMAKE_BINARY_DIR}/src/cmark"
  19. )
  20. if(NOT CMAKE_BUILD_TYPE)
  21. set(CMAKE_BUILD_TYPE "Release" CACHE STRING
  22. "Choose the type of build, options are: Debug Release." FORCE)
  23. endif(NOT CMAKE_BUILD_TYPE)