2017-03-23 01:03:33 -07:00
|
|
|
cmake_minimum_required(VERSION 3.7.2)
|
2018-03-13 20:30:47 -07:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/Modules)
|
|
|
|
include(Colours)
|
|
|
|
include(Platform)
|
2017-03-27 21:03:35 -07:00
|
|
|
|
2018-03-13 20:30:47 -07:00
|
|
|
project(cellar CXX)
|
|
|
|
string(TIMESTAMP BUILD_DATE "%Y.%m.%d %H:%M:%S UTC" UTC)
|
2017-03-23 14:23:22 -07:00
|
|
|
# local cmake modules
|
|
|
|
|
2017-03-23 13:36:38 -07:00
|
|
|
# for installation rules, from CMake wiki
|
|
|
|
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/cellar")
|
|
|
|
|
|
|
|
# add the automatically determined parts of the RPATH
|
|
|
|
# which point to directories outside the build tree to the install RPATH
|
|
|
|
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|
|
|
|
2017-07-05 13:13:04 -07:00
|
|
|
include(Git)
|
|
|
|
git_init()
|
|
|
|
|
2018-03-13 20:30:47 -07:00
|
|
|
include(Cog)
|
|
|
|
cog_target()
|
|
|
|
|
2017-06-28 19:22:34 -07:00
|
|
|
include(Ronn)
|
|
|
|
|
2018-03-13 20:30:47 -07:00
|
|
|
generate_manpage(cellar 1)
|
|
|
|
add_manpage_target()
|
2017-03-23 14:23:22 -07:00
|
|
|
|
2018-03-13 19:19:52 -07:00
|
|
|
find_package(Boost 1.63 REQUIRED COMPONENTS filesystem system)
|
2018-03-13 20:30:47 -07:00
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
2017-03-23 01:03:33 -07:00
|
|
|
|
2017-03-23 11:13:00 -07:00
|
|
|
find_package(PkgConfig)
|
|
|
|
pkg_check_modules(TCLAP "tclap >= 1.2.1")
|
|
|
|
if(NOT TCLAP_FOUND)
|
|
|
|
MESSAGE(WARNING "TCLAP is required by this project, but was not found by CMake.
|
|
|
|
Continuing on the assumption that you've downloaded it from
|
|
|
|
http://tclap.sourceforge.net and put the headers in ./include
|
|
|
|
(wink, nudge)")
|
|
|
|
endif(NOT TCLAP_FOUND)
|
|
|
|
|
2018-03-13 20:30:47 -07:00
|
|
|
include(LavaTargets)
|
|
|
|
|
|
|
|
include_directories(include)
|
2017-07-05 13:13:04 -07:00
|
|
|
configure_file("${CMAKE_SOURCE_DIR}/include/cmake.hpp.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/include/cmake.hpp")
|
|
|
|
include_directories("${CMAKE_CURRENT_BINARY_DIR}/include")
|
2017-03-23 18:22:09 -07:00
|
|
|
set(src "${CMAKE_SOURCE_DIR}/src")
|
2017-03-23 01:03:33 -07:00
|
|
|
|
2018-03-13 20:30:47 -07:00
|
|
|
lava_create_gutlib(
|
|
|
|
SUBDIRS bottles config launch
|
|
|
|
DEPENDS cog)
|
2017-03-23 12:06:29 -07:00
|
|
|
|
2018-03-13 20:30:47 -07:00
|
|
|
lava_create_executable(TARGET cellar
|
|
|
|
SUBDIRS core help
|
|
|
|
LIBRARIES gutlib Boost::filesystem Boost::system
|
|
|
|
DEPENDS cog)
|
2017-06-28 19:22:34 -07:00
|
|
|
|
2018-03-13 20:30:47 -07:00
|
|
|
install(TARGETS cellar gutlib
|
2017-03-23 13:36:38 -07:00
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib/cellar
|
|
|
|
ARCHIVE DESTINATION share/cellar)
|