aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 2e4c870e5ed7f410998b0fd190928ee430315ac5 (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. add_subdirectory(api_test)
  13. add_subdirectory(man)
  14. enable_testing()
  15. # To get verbose output: cmake --build build --target "test" -- ARGS='-V'
  16. add_test(spectest_library
  17. python "${CMAKE_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec"
  18. "${CMAKE_SOURCE_DIR}/spec.txt" "--library-dir" "${CMAKE_BINARY_DIR}/src"
  19. )
  20. add_test(pathological_tests_library
  21. python "${CMAKE_SOURCE_DIR}/pathological_tests.py"
  22. "--library-dir" "${CMAKE_BINARY_DIR}/src"
  23. )
  24. add_test(NAME api_test COMMAND api_test)
  25. if (WIN32)
  26. file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR}/src WIN_DLL_DIR)
  27. set_tests_properties(api_test PROPERTIES
  28. ENVIRONMENT "PATH=${WIN_DLL_DIR};$ENV{PATH}"
  29. )
  30. endif(WIN32)
  31. add_test(spectest_executable
  32. python "${CMAKE_SOURCE_DIR}/spec_tests.py" "--no-normalize" "--spec" "${CMAKE_SOURCE_DIR}/spec.txt" "--program" "${CMAKE_BINARY_DIR}/src/cmark"
  33. )
  34. if(NOT CMAKE_BUILD_TYPE)
  35. set(CMAKE_BUILD_TYPE "Release" CACHE STRING
  36. "Choose the type of build, options are: Debug Release." FORCE)
  37. endif(NOT CMAKE_BUILD_TYPE)