2013-08-16 15:27:19 +00:00
|
|
|
project (wordreference CXX)
|
|
|
|
|
2013-08-22 10:07:38 +00:00
|
|
|
# http://stackoverflow.com/questions/1435953/how-can-i-pass-git-sha1-to-compiler-as-definition-using-cmake
|
|
|
|
include(GetGitRevisionDescription)
|
|
|
|
|
2013-08-16 15:27:19 +00:00
|
|
|
find_package(CURL REQUIRED)
|
|
|
|
find_package(Boost 1.32.0 REQUIRED program_options)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DJSON_DEBUG")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
|
|
|
|
2013-08-22 10:07:38 +00:00
|
|
|
set(PROJ_VER_MAJOR "0")
|
|
|
|
set(PROJ_VER_MINOR "1")
|
|
|
|
set(PROJ_VER_REVISION "1")
|
|
|
|
get_git_head_revision(GIT_REFSPEC PROJ_GIT_SHA1)
|
|
|
|
|
|
|
|
configure_file (
|
|
|
|
${PROJECT_SOURCE_DIR}/cmake_gen.h.in
|
|
|
|
${PROJECT_BINARY_DIR}/cmake_gen.h
|
|
|
|
)
|
|
|
|
|
2013-08-16 15:27:19 +00:00
|
|
|
include_directories(SYSTEM
|
|
|
|
${CURL_INCLUDE_DIRS}
|
|
|
|
${Boost_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
include_directories(
|
2013-08-16 23:27:12 +00:00
|
|
|
src/
|
2013-08-16 15:27:19 +00:00
|
|
|
../libjson/
|
2013-08-22 10:07:38 +00:00
|
|
|
${PROJECT_BINARY_DIR}
|
2013-08-16 15:27:19 +00:00
|
|
|
)
|
|
|
|
link_directories(
|
|
|
|
${Boost_LIBRARY_DIRS}
|
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(${PROJECT_NAME}
|
2013-08-16 23:27:12 +00:00
|
|
|
src/main.cpp
|
|
|
|
src/WordReference.cpp
|
2013-08-17 00:50:40 +00:00
|
|
|
src/HttpReader.cpp
|
2013-08-20 17:25:02 +00:00
|
|
|
src/CharConv.cpp
|
2013-08-16 15:27:19 +00:00
|
|
|
)
|
|
|
|
target_link_libraries(${PROJECT_NAME}
|
|
|
|
${Boost_LIBRARIES}
|
|
|
|
${CURL_LIBRARIES}
|
|
|
|
libjson
|
|
|
|
)
|