Skip to content

Commit

Permalink
cmake: exec_program is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
LebedevRI committed Mar 10, 2014
1 parent 70b0c10 commit 1338599
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)


#
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/FindGphoto2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit 1338599

Please sign in to comment.