@@ -19,16 +19,16 @@ IF(JSONC_FOUND)
ENDIF()
ADD_CUSTOM_COMMAND(
- OUTPUT contrib/lemon
- DEPENDS contrib/lemon.c contrib/lempar.c
- COMMAND gcc -o contrib/lemon contrib/lemon.c
+ OUTPUT ${CMAKE_CURRENT_LIST_DIR}/contrib/lemon
+ DEPENDS ${CMAKE_CURRENT_LIST_DIR}/contrib/lemon.c ${CMAKE_CURRENT_LIST_DIR}/contrib/lempar.c
+ COMMAND gcc -o ${CMAKE_CURRENT_LIST_DIR}/contrib/lemon ${CMAKE_CURRENT_LIST_DIR}/contrib/lemon.c
COMMENT "Generating lemon parser generator"
)
ADD_CUSTOM_COMMAND(
- OUTPUT parser.c
- DEPENDS parser.y contrib/lemon
- COMMAND ./contrib/lemon parser.y
+ OUTPUT ${CMAKE_CURRENT_LIST_DIR}/parser.c
+ DEPENDS ${CMAKE_CURRENT_LIST_DIR}/parser.y ${CMAKE_CURRENT_LIST_DIR}/contrib/lemon
+ COMMAND ${CMAKE_CURRENT_LIST_DIR}/contrib/lemon ${CMAKE_CURRENT_LIST_DIR}/parser.y
COMMENT "Generating parser.c"
)
When building with debuild/fakeroot the build folder is different from sources Signed-off-by: Sergey Ponomarev <stokito@gmail.com> --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)