2013-09-28 17:59:50 +08:00
|
|
|
# CMakeLists.txt for the ZoneMinder perl module.
|
|
|
|
|
2013-11-03 06:20:49 +08:00
|
|
|
# If this is an out-of-source build, copy the files we need to the binary directory
|
|
|
|
if(NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR))
|
2015-04-09 01:22:46 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/Changes" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.PL" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/META.yml" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/README" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/t" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/lib" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" PATTERN "*.in" EXCLUDE)
|
2013-11-03 06:20:49 +08:00
|
|
|
endif()
|
|
|
|
|
2013-09-28 17:59:50 +08:00
|
|
|
# Create files from the .in files
|
2013-11-01 00:10:00 +08:00
|
|
|
configure_file(lib/ZoneMinder/Base.pm.in "${CMAKE_CURRENT_BINARY_DIR}/lib/ZoneMinder/Base.pm" @ONLY)
|
|
|
|
configure_file(lib/ZoneMinder/Config.pm.in "${CMAKE_CURRENT_BINARY_DIR}/lib/ZoneMinder/Config.pm" @ONLY)
|
|
|
|
configure_file(lib/ZoneMinder/Memory.pm.in "${CMAKE_CURRENT_BINARY_DIR}/lib/ZoneMinder/Memory.pm" @ONLY)
|
|
|
|
configure_file(lib/ZoneMinder/ConfigData.pm.in "${CMAKE_CURRENT_BINARY_DIR}/lib/ZoneMinder/ConfigData.pm" @ONLY)
|
2017-08-25 23:16:37 +08:00
|
|
|
configure_file(lib/ZoneMinder/ONVIF.pm.in "${CMAKE_CURRENT_BINARY_DIR}/lib/ZoneMinder/ONVIF.pm" @ONLY)
|
2013-09-28 17:59:50 +08:00
|
|
|
|
2013-10-29 16:01:29 +08:00
|
|
|
if(CMAKE_VERBOSE_MAKEFILE)
|
|
|
|
set(MAKEMAKER_NOECHO_COMMAND "")
|
|
|
|
else()
|
|
|
|
set(MAKEMAKER_NOECHO_COMMAND "NOECHO=\"1>/dev/null\"")
|
|
|
|
endif()
|
|
|
|
|
2013-09-28 17:59:50 +08:00
|
|
|
# Add build target for the perl modules
|
2021-02-04 04:22:28 +08:00
|
|
|
add_custom_target(zmperlmodules ALL perl Makefile.PL ${ZM_PERL_MM_PARMS_FULL} FIRST_MAKEFILE=MakefilePerl DESTDIR="${CMAKE_CURRENT_BINARY_DIR}/output" ${MAKEMAKER_NOECHO_COMMAND} COMMAND make -f MakefilePerl pure_install COMMENT "Building ZoneMinder perl modules")
|
2013-09-28 17:59:50 +08:00
|
|
|
|
|
|
|
# Add install target for the perl modules
|
2015-04-07 21:19:21 +08:00
|
|
|
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/output/" DESTINATION "/")
|
2013-09-28 17:59:50 +08:00
|
|
|
|
2013-11-01 00:10:00 +08:00
|
|
|
# Add additional files and directories to make clean
|
2013-10-29 17:21:23 +08:00
|
|
|
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "output;blib;pm_to_blib;MakefilePerl")
|