CMakeLists.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Minimum requirement for CMake version.
  2. # 3.13 or later for Linux and Mac OSX.
  3. # it causes error for build with cmake 3.12 or earlier.
  4. # 3.12 or later for Windows
  5. # because Qt5.9 only support MSVC2017,
  6. # and MSVC2017 is integrated with cmake 3.12.
  7. cmake_policy(SET CMP0042 NEW)
  8. cmake_minimum_required (VERSION 3.12)
  9. project(VNote VERSION 2.8.2
  10. DESCRIPTION "VNote is a markdown note taking application"
  11. HOMEPAGE_URL "https://tamlok.github.io/vnote"
  12. LANGUAGES C CXX)
  13. set(CMAKE_CXX_STANDARD 14)
  14. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  15. ## Qt5 configurations
  16. set(CMAKE_AUTOMOC ON)
  17. set(CMAKE_AUTOUIC ON)
  18. set(CMAKE_AUTORCC ON)
  19. # find Qt5 installation
  20. find_package(Qt5 REQUIRED COMPONENTS Core Gui Network PrintSupport WebChannel WebEngine
  21. WebEngineWidgets Positioning Svg Widgets LinguistTools
  22. HINTS
  23. "/opt/qt59/lib/cmake/Qt5/"
  24. "c:/Qt/Qt5.9.8/5.9.8/msvc2017_64/lib/cmake/Qt5/"
  25. "c:/Qt/Qt5.9.9/5.9.9/msvc2017_64/lib/cmake/Qt5/"
  26. "/usr/local/Cellar/qt/5.9.8/clang_64/lib/cmake/Qt5/"
  27. "/usr/local/Cellar/qt/5.9.9/clang_64/lib/cmake/Qt5/")
  28. ## hoedown library
  29. add_library(hoedown STATIC
  30. hoedown/src/autolink.c hoedown/src/document.c hoedown/src/html.c hoedown/src/html_smartypants.c
  31. hoedown/src/version.c hoedown/src/buffer.c hoedown/src/escape.c hoedown/src/html_blocks.c
  32. hoedown/src/stack.c )
  33. target_link_libraries(hoedown PRIVATE Qt5::Core Qt5::Gui)
  34. ## peg-highlight library
  35. add_library(peg-highlight STATIC peg-highlight/pmh_parser.c peg-highlight/pmh_styleparser.c)
  36. target_link_libraries(peg-highlight PRIVATE Qt5::Core Qt5::Gui)
  37. ## project sources
  38. add_subdirectory(src)
  39. include(${CMAKE_CURRENT_LIST_DIR}/Packaging.cmake)
  40. # vim: ts=2 sw=2 sts=2 et