Browse Source

[build] Fix build when using nested CMake

(FetchContent, ExternalProject_Add)

github: closes #102
personal/stbuehler/ci-build
raw 2 years ago
committed by Glenn Strauss
parent
commit
2c409321df
  1. 2
      CMakeLists.txt
  2. 6
      scripts/cmake/LighttpdMacros.cmake

2
CMakeLists.txt

@ -2,7 +2,7 @@ project(lighttpd C)
cmake_minimum_required(VERSION 2.8.2 FATAL_ERROR)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/scripts/cmake)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake)
include(CTest)

6
scripts/cmake/LighttpdMacros.cmake

@ -25,9 +25,9 @@ endmacro(ADD_AND_INSTALL_LIBRARY)
macro(LEMON_PARSER SRCFILE)
get_filename_component(SRCBASE ${SRCFILE} NAME_WE)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${SRCBASE}.c ${CMAKE_CURRENT_BINARY_DIR}/${SRCBASE}.h
COMMAND ${CMAKE_BINARY_DIR}/build/lemon
ARGS -q ${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE} ${CMAKE_SOURCE_DIR}/src/lempar.c
DEPENDS ${CMAKE_BINARY_DIR}/build/lemon ${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE} ${CMAKE_SOURCE_DIR}/src/lempar.c
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/lemon
ARGS -q ${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE} ${CMAKE_CURRENT_SOURCE_DIR}/lempar.c
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/lemon ${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE} ${CMAKE_CURRENT_SOURCE_DIR}/lempar.c
COMMENT "Generating ${SRCBASE}.c from ${SRCFILE}"
)
endmacro(LEMON_PARSER)

Loading…
Cancel
Save