expandurl-mastodon/CMakeLists.txt

47 lines
1.4 KiB
CMake
Raw Normal View History

cmake_minimum_required (VERSION 3.7)
project (expandurl-mastodon
VERSION 0.7.4
LANGUAGES CXX
)
include(GNUInstallDirs)
2018-05-13 07:01:30 +02:00
find_package(CURL REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(CURLPP REQUIRED curlpp)
pkg_check_modules(JSONCPP REQUIRED jsoncpp)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
2018-05-13 14:21:12 +02:00
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
2018-05-22 20:45:54 +02:00
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
# uint_fast16_t can be bigger than 16 bit, but that doesn't matter because
# everything but the last 16 bit is padded with zeroes.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format")
endif()
2018-05-13 14:21:12 +02:00
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_BINARY_DIR})
2018-05-13 07:01:30 +02:00
include_directories(${CURL_INCLUDE_DIRS})
include_directories(${CURLPP_INCLUDE_DIRS})
include_directories(${JSONCPP_INCLUDE_DIRS})
link_directories(${CURL_LIBRARY_DIRS})
link_directories(${CURLPP_LIBRARY_DIRS})
link_directories(${JSONCPP_LIBRARY_DIRS})
# Write version in header
configure_file (
"${PROJECT_SOURCE_DIR}/src/version.hpp.in"
"${PROJECT_BINARY_DIR}/version.hpp"
)
file(GLOB sources src/*.cpp)
add_executable(expandurl-mastodon ${sources})
2018-05-13 07:01:30 +02:00
target_link_libraries(expandurl-mastodon
${CURLPP_LIBRARIES} ${JSONCPP_LIBRARIES}
mastodon-cpp pthread)
install(TARGETS expandurl-mastodon DESTINATION ${CMAKE_INSTALL_BINDIR})