summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraw <futex@posteo.net>2020-01-30 23:09:00 +0100
committerGlenn Strauss <gstrauss@gluelogic.com>2020-01-30 21:47:59 -0500
commit2c409321df0f9302a986f5c2876638b99e8c892e (patch)
treea609be88160d5ad94a823e8d0536b2823f1a4ffc
parent8c9b5480f33e24c42c52df54629f58d1de58cd4f (diff)
downloadlighttpd-1.x-2c409321df0f9302a986f5c2876638b99e8c892e.tar.gz
lighttpd-1.x-2c409321df0f9302a986f5c2876638b99e8c892e.zip
[build] Fix build when using nested CMake
(FetchContent, ExternalProject_Add) github: closes #102
-rw-r--r--CMakeLists.txt2
-rw-r--r--scripts/cmake/LighttpdMacros.cmake6
2 files changed, 4 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e04efb6e..e15c928f 100644
--- a/CMakeLists.txt
+++ b/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)
diff --git a/scripts/cmake/LighttpdMacros.cmake b/scripts/cmake/LighttpdMacros.cmake
index 95cab8d9..69768098 100644
--- a/scripts/cmake/LighttpdMacros.cmake
+++ b/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)