CMakeLists.txt 1.24 KB
Newer Older
Yuri Chornoivan's avatar
Yuri Chornoivan committed
1
# This cmake file are managing embedded 3party Cantor dependencies
2
3
4

# 3dparty patched Discount
# Embedded for a while
5
6
7
8
9
include(ExternalProject)
set (DISCOUNT_ONLY_LIBRARY ON)
set (DISCOUNT_MAKE_INSTALL OFF)
ExternalProject_Add(
    discount_project
10
    URL ${CMAKE_CURRENT_SOURCE_DIR}/discount-2.2.6-patched
11
    SOURCE_SUBDIR cmake
12
    CMAKE_ARGS DISCOUNT_ONLY_LIBRARY DISCOUNT_MAKE_INSTALL -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE}
13
    CMAKE_CACHE_ARGS "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true"
14
15
16
17
    PREFIX ${CMAKE_CURRENT_BINARY_DIR}
    INSTALL_COMMAND ""
    BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/discount_project-build
    BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/discount_project-build/libmarkdown${CMAKE_STATIC_LIBRARY_SUFFIX}
18
19
)

20
21
ExternalProject_Get_Property(discount_project source_dir)
ExternalProject_Get_Property(discount_project binary_dir)
Nikita Sirgienko's avatar
Nikita Sirgienko committed
22

23
add_library(Discount::Lib STATIC IMPORTED GLOBAL)
24
25
set_target_properties(Discount::Lib PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES ${source_dir}
26
    IMPORTED_LOCATION ${binary_dir}/libmarkdown${CMAKE_STATIC_LIBRARY_SUFFIX}
27
    POSITION_INDEPENDENT_CODE ON
28
)
29
add_dependencies(Discount::Lib discount_project-build)
30
31

# preview.sty
32
install(FILES preview.sty DESTINATION  ${KDE_INSTALL_DATADIR}/cantor/latex)