Add docopt to CMakeLists

This commit is contained in:
Robin Jadoul 2016-05-26 12:17:28 +02:00
parent fe6b242501
commit ff8af2a5a3
2 changed files with 15 additions and 2 deletions

View File

@ -29,6 +29,19 @@ if (NOT mstch_FOUND)
include_directories(${source_dir}/include)
endif()
ExternalProject_Add(ext-docopt
GIT_REPOSITORY https://github.com/docopt/docopt.cpp
INSTALL_COMMAND ""
EXCLUDE_FROM_ALL 1
)
add_library(docopt IMPORTED STATIC GLOBAL)
add_dependencies(docopt ext-docopt)
ExternalProject_Get_Property(ext-docopt source_dir binary_dir)
set_target_properties(docopt PROPERTIES "IMPORTED_LOCATION" "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}docopt${CMAKE_STATIC_LIBRARY_SUFFIX}")
include_directories(${source_dir})
##########################################
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}")

View File

@ -14,8 +14,8 @@ add_executable(Lexesis
inputparser.cpp
template.cpp
)
target_link_libraries(Lexesis Lexesis-backends mstch::mstch)
target_link_libraries(Lexesis Lexesis-backends mstch::mstch docopt)
install(TARGETS Lexesis
RUNTIME DESTINATION bin
DESTINATION man
)