forgot to include cmakelists changes

This commit is contained in:
Nicholas O'Connor 2017-03-23 01:03:56 -07:00
parent fc09bf57dc
commit 7164692e1f

View File

@ -1,29 +1,34 @@
cmake_minimum_required(VERSION 3.7.2)
project(cellar)
project(cellar CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(PythonInterp)
find_package(Boost 1.63 REQUIRED COMPONENTS filesystem)
include_directories(include)
set(src "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(coggedfiles)
file(GLOB cogfiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
file(GLOB_RECURSE cogfiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cog")
foreach(cogfile ${cogfiles})
string(REGEX REPLACE ".in\$" "" outfile "${cogfile}")
string(REGEX REPLACE ".cog\$" "" outfile "${cogfile}")
set(thisfile "${CMAKE_CURRENT_SOURCE_DIR}/${outfile}")
add_custom_command(OUTPUT "${outfile}"
add_custom_command(OUTPUT "${thisfile}"
COMMAND ${PYTHON_EXECUTABLE} -m cogapp -d -o "${outfile}" "${cogfile}"
DEPENDS ${cogfile}
COMMENT "Greasing the cog for ${outfile}")
COMMENT "Greasing the cog for ${thisfile}")
set(coggedfiles ${coggedfiles} ${thisfile})
set(coggedfiles ${coggedfiles} "${thisfile}")
endforeach(cogfile)
add_custom_target(cog ALL DEPENDS ${cogfiles})
add_custom_target(cog ALL DEPENDS ${coggedfiles})
add_executable(cellar src/cellar.cpp src/commands.cpp src/fs.cpp
src/bottles.cpp src/version.cpp)
add_executable(cellar ${src}/cellar.cpp ${src}/commands.cpp ${src}/fs.cpp
${src}/bottles.cpp ${src}/version.cpp)
add_dependencies(cellar cog)
target_link_libraries(cellar ${Boost_LIBRARIES})