From 1338599a106dc7cbdf9de8f50141235919ee43a2 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Mon, 10 Mar 2014 11:58:15 +0400 Subject: [PATCH] cmake: exec_program is deprecated --- CMakeLists.txt | 5 +++-- cmake/modules/FindGphoto2.cmake | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f64a68352d3..88639499e730 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,7 +94,8 @@ endif() # if(NOT SOURCE_PACKAGE) message("-- Determining version") - exec_program(git ${CMAKE_CURRENT_SOURCE_DIR} ARGS describe --tags HEAD | "sed 's,^release-,,;s,-,+,;s,-,~,;'" OUTPUT_VARIABLE PROJECT_VERSION) + EXECUTE_PROCESS(COMMAND git describe --tags HEAD #OUTPUT_VARIABLE PROJECT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND sed "s,^release-,,;s,-,+,;s,-,~,;" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE PROJECT_VERSION) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cmake.cmake" "${CMAKE_CURRENT_BINARY_DIR}/version.cmake" @ONLY) else(NOT SOURCE_PACKAGE) include(cmake/version.cmake) @@ -103,7 +104,7 @@ endif() # # Initial cmake/debian/postinst and prerm script for debian package # -make_directory(${CMAKE_CURRENT_SOURCE_DIR}/packaging/debian) +file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/packaging/debian) # diff --git a/cmake/modules/FindGphoto2.cmake b/cmake/modules/FindGphoto2.cmake index e5ffe29f6b01..46946eb41ddc 100644 --- a/cmake/modules/FindGphoto2.cmake +++ b/cmake/modules/FindGphoto2.cmake @@ -32,7 +32,7 @@ mark_as_advanced(GPHOTO2_PORT_LIBRARY) # Detect libgphoto2 version FIND_PROGRAM(GPHOTO2CONFIG_EXECUTABLE NAMES gphoto2-config) IF(GPHOTO2CONFIG_EXECUTABLE) - EXEC_PROGRAM(${GPHOTO2CONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPHOTO2_VERSION) + EXECUTE_PROCESS(COMMAND ${GPHOTO2CONFIG_EXECUTABLE} --version OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE _return_VALUE OUTPUT_VARIABLE GPHOTO2_VERSION) string(REGEX REPLACE "^.*libgphoto2 ([0-9]+).*$" "\\1" GPHOTO2_VERSION_MAJOR "${GPHOTO2_VERSION}") string(REGEX REPLACE "^.*libgphoto2 [0-9]+\\.([0-9]+).*$" "\\1" GPHOTO2_VERSION_MINOR "${GPHOTO2_VERSION}") string(REGEX REPLACE "^.*libgphoto2 [0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" GPHOTO2_VERSION_PATCH "${GPHOTO2_VERSION}")