From 01a2880100c6f1fa3d4773ed144910e241550854 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 27 Feb 2020 12:00:09 -0500 Subject: [PATCH] fix build outside of build directory --- CMakeLists.txt | 2 +- zmconfgen.pl.in | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60391bb3b..1b8754ac4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -910,7 +910,7 @@ message(STATUS "Optional libraries not found:${optlibsnotfound}") # Run ZM configuration generator message(STATUS "Running ZoneMinder configuration generator") -execute_process(COMMAND perl ./zmconfgen.pl RESULT_VARIABLE zmconfgen_result) +execute_process(COMMAND perl ${CMAKE_CURRENT_BINARY_DIR}/zmconfgen.pl RESULT_VARIABLE zmconfgen_result) if(zmconfgen_result EQUAL 0) message(STATUS "ZoneMinder configuration generator completed successfully") diff --git a/zmconfgen.pl.in b/zmconfgen.pl.in index c5b6517ac..bbd5308ac 100644 --- a/zmconfgen.pl.in +++ b/zmconfgen.pl.in @@ -25,13 +25,13 @@ # use strict; -use lib './scripts/ZoneMinder/lib'; +use lib '@CMAKE_CURRENT_BINARY_DIR@/scripts/ZoneMinder/lib'; use ZoneMinder::ConfigData qw/:data/; $| = 1; -my $config_header = "src/zm_config_defines.h"; -my $config_sql = "db/zm_create.sql"; +my $config_header = '@CMAKE_CURRENT_BINARY_DIR@/src/zm_config_defines.h'; +my $config_sql = '@CMAKE_CURRENT_BINARY_DIR@/db/zm_create.sql'; generateConfigFiles();