Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove adding svn version to gsad build #11

Merged
merged 1 commit into from
Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 3 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,6 @@ if (MANDATORY_TOOL_MISSING)
"your system. Please check the logs above.")
endif (MANDATORY_TOOL_MISSING)

## Retrieve svn revision (at configure time)
# Not using Subversion_WC_INFO, as it would have to connect to the repo
find_program (SVN_EXECUTABLE svn DOC "subversion command line client")

macro (Subversion_GET_REVISION dir variable)
execute_process (COMMAND ${SVN_EXECUTABLE} info ${CMAKE_SOURCE_DIR}/${dir}
OUTPUT_VARIABLE ${variable}
OUTPUT_STRIP_TRAILING_WHITESPACE)
string (REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
"\\2" ${variable} "${${variable}}")
endmacro (Subversion_GET_REVISION)

if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
if (EXISTS "${CMAKE_SOURCE_DIR}/.svn/" OR EXISTS "${CMAKE_SOURCE_DIR}/../.svn/")
if (SVN_EXECUTABLE)
Subversion_GET_REVISION(. ProjectRevision)
set (SVN_REVISION "~svn${ProjectRevision}")
else (SVN_EXECUTABLE)
set (SVN_REVISION "~svn")
endif (SVN_EXECUTABLE)
endif (EXISTS "${CMAKE_SOURCE_DIR}/.svn/" OR EXISTS "${CMAKE_SOURCE_DIR}/../.svn/")
endif (NOT CMAKE_BUILD_TYPE MATCHES "Release")

## Project version
# The following three variables should be set through the project command once
# we require CMake >= 3.0
Expand All @@ -107,10 +84,6 @@ set (PROJECT_VERSION_PATCH 0)
# unset if this is a stable release series.
set (PROJECT_BETA_RELEASE 1)

if (SVN_REVISION)
set (PROJECT_VERSION_SVN "${SVN_REVISION}")
endif (SVN_REVISION)

# If PROJECT_BETA_RELEASE is set, the version string will be set to:
# "major.minor+beta${PROJECT_BETA_RELEASE}"
# If PROJECT_BETA_RELEASE is NOT set, the version string will be set to:
Expand Down Expand Up @@ -143,9 +116,9 @@ set (CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
set (CPACK_PACKAGE_VENDOR "Greenbone Networks")
set (CPACK_SOURCE_IGNORE_FILES
"${CMAKE_BINARY_DIR}"
"/.svn/"
"swp$"
"${CMAKE_BINARY_DIR}"
"/.git/"
"swp$"
)

include (CPack)
Expand Down
46 changes: 0 additions & 46 deletions getsvn.cmake

This file was deleted.

21 changes: 0 additions & 21 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,27 +106,6 @@ add_executable (gsad
target_link_libraries (gsad gsad_gmp gsad_base gsad_xslt_ext ${LIBGVM_BASE_LDFLAGS} ${LIBGVM_UTIL_LDFLAGS} ${LIBGVM_GMP_LDFLAGS} ${LIBGCRYPT_LDFLAGS} ${CMAKE_THREAD_LIBS_INIT} ${LINKER_HARDENING_FLAGS})
set_target_properties (gsad PROPERTIES LINKER_LANGUAGE C)

if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
# If we got SVN_REVISION at configure time,
# assume we can get it at build time as well
if (SVN_REVISION)
# a custom target that is always built
add_custom_target (revisiontag ALL)

# creates svnversion.h using cmake script
add_custom_command (TARGET revisiontag COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
-P ${CMAKE_SOURCE_DIR}/getsvn.cmake)

# explicitly say that the executable depends on custom target
add_dependencies (gsad revisiontag)

# include the output directory, where the svnversion.h file is generated
include_directories (${CMAKE_CURRENT_BINARY_DIR})
add_definitions (-DSVN_REV_AVAILABLE)
endif (SVN_REVISION)
endif (NOT CMAKE_BUILD_TYPE MATCHES "Release")

if (SERVE_STATIC_ASSETS)
message (STATUS "Static asset serving is builtin, use with care.")
add_definitions (-DSERVE_STATIC_ASSETS)
Expand Down
4 changes: 0 additions & 4 deletions src/gsad.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@
#include "validator.h"
#include "xslt_i18n.h"

#ifdef SVN_REV_AVAILABLE
#include "svnrevision.h"
#endif

#undef G_LOG_DOMAIN
/**
* @brief GLib log domain.
Expand Down