1 cmake_minimum_required(VERSION 2.8.11)
4 SET(walker_version "git-prerelease")
7 COMMAND git -C ${CMAKE_CURRENT_SOURCE_DIR} describe --always --dirty --tags
8 RESULT_VARIABLE GIT_RETCODE
9 OUTPUT_VARIABLE GIT_OUTPUT_VERSION
10 ERROR_VARIABLE GIT_RAN_ERROR
11 OUTPUT_STRIP_TRAILING_WHITESPACE
14 #message("Git result: ${GIT_RETCODE} / ${GIT_OUTPUT_VERSION} / ${GIT_RAN_ERROR}")
16 # exit status 0 means successful
18 set(GIT_RAN_SUCCESSFULLY 0)
20 set(GIT_RAN_SUCCESSFULLY 1)
24 # overwriting version.h in ok (?), I want the generated one to be preferred
25 # and I guess include_directories in only appended...
27 "${CMAKE_CURRENT_SOURCE_DIR}/version.h.in"
28 "${CMAKE_CURRENT_BINARY_DIR}/version.h"
31 find_package(CURL REQUIRED)
34 COMPONENTS program_options
37 ## huh, path spec is relative to... ???
41 ${CMAKE_CURRENT_BINARY_DIR}
46 # TODO: What's the difference between this and SET_SOURCE_FILES_PROPERTIES?
47 add_definitions(-Wall)
48 add_definitions(-Wextra)
49 add_definitions(-Wshadow)
50 add_definitions(-std=c++11)
51 add_definitions(-Werror=return-type)
55 # Define the CXX sources
57 ${CMAKE_CURRENT_SOURCE_DIR}/CurlWikiGrabber.cpp
58 ${CMAKE_CURRENT_SOURCE_DIR}/CurlUrlCreator.cpp
59 ${CMAKE_CURRENT_SOURCE_DIR}/WikimediaJsonToArticleConverter.cpp
60 ${CMAKE_CURRENT_SOURCE_DIR}/CacheJsonToArticleConverter.cpp
61 ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
62 ${CMAKE_CURRENT_SOURCE_DIR}/ArticleCollection.cpp
63 ${CMAKE_CURRENT_SOURCE_DIR}/WikiWalker.cpp
64 ${CMAKE_CURRENT_SOURCE_DIR}/ToJsonWriter.cpp
65 ${CMAKE_CURRENT_SOURCE_DIR}/ToGraphvizWriter.cpp
66 ${CMAKE_CURRENT_SOURCE_DIR}/Article.cpp
67 ${CMAKE_CURRENT_SOURCE_DIR}/BoostPoCommandLineParser.cpp
68 ${CMAKE_CURRENT_SOURCE_DIR}/../lib/jsoncpp/jsoncpp.cpp
71 add_executable(walker ${CXX_SRCS})
73 target_link_libraries(walker
75 ${Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE}
78 install (TARGETS walker DESTINATION bin)
81 add_test(NAME versiondisplay