From ff8af2a5a3a9cce519ff38cb639334105125ce7a Mon Sep 17 00:00:00 2001 From: Robin Jadoul Date: Thu, 26 May 2016 12:17:28 +0200 Subject: [PATCH] Add docopt to CMakeLists --- CMakeLists.txt | 13 +++++++++++++ src/CMakeLists.txt | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aab7f20..30f0c66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 316e1aa..e36d059 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 )