45 lines
976 B
CMake
45 lines
976 B
CMake
project (wordreference CXX)
|
|
|
|
# http://stackoverflow.com/questions/1435953/how-can-i-pass-git-sha1-to-compiler-as-definition-using-cmake
|
|
include(GetGitRevisionDescription)
|
|
|
|
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}")
|
|
|
|
set(PROJ_VER_MAJOR "0")
|
|
set(PROJ_VER_MINOR "1")
|
|
set(PROJ_VER_REVISION "2")
|
|
get_git_head_revision(GIT_REFSPEC PROJ_GIT_SHA1)
|
|
|
|
configure_file (
|
|
${PROJECT_SOURCE_DIR}/cmake_gen.h.in
|
|
${PROJECT_BINARY_DIR}/cmake_gen.h
|
|
)
|
|
|
|
include_directories(SYSTEM
|
|
${CURL_INCLUDE_DIRS}
|
|
${Boost_INCLUDE_DIRS}
|
|
)
|
|
include_directories(
|
|
src/
|
|
../libjson/
|
|
${PROJECT_BINARY_DIR}
|
|
)
|
|
link_directories(
|
|
${Boost_LIBRARY_DIRS}
|
|
)
|
|
|
|
add_executable(${PROJECT_NAME}
|
|
src/main.cpp
|
|
src/WordReference.cpp
|
|
src/HttpReader.cpp
|
|
src/CharConv.cpp
|
|
)
|
|
target_link_libraries(${PROJECT_NAME}
|
|
${Boost_LIBRARIES}
|
|
${CURL_LIBRARIES}
|
|
libjson
|
|
)
|