Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
00e96f59
Commit
00e96f59
authored
Oct 15, 2015
by
Ghislain MARY
Browse files
Regenerate liblinphone_gitversion.h with CMake when the git revision has changed.
parent
952e5a90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
16 deletions
+31
-16
coreapi/CMakeLists.txt
coreapi/CMakeLists.txt
+7
-8
coreapi/gitversion.cmake
coreapi/gitversion.cmake
+3
-8
coreapi/gitversion.h.in
coreapi/gitversion.h.in
+21
-0
No files found.
coreapi/CMakeLists.txt
View file @
00e96f59
...
...
@@ -120,13 +120,11 @@ else()
list
(
APPEND SOURCE_FILES linphone_tunnel_stubs.c
)
endif
()
set
(
GENERATED_SOURCE_FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/liblinphone_gitversion.h
)
set_source_files_properties
(
${
GENERATED_SOURCE_FILES
}
PROPERTIES GENERATED TRUE
)
find_package
(
Git
)
add_custom_command
(
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/liblinphone_gitversion.h
COMMAND
${
CMAKE_COMMAND
}
-DGIT_EXECUTABLE=
${
GIT_EXECUTABLE
}
-DWORK_DIR=
${
CMAKE_CURRENT_SOURCE_DIR
}
-DOUTPUT_DIR=
${
CMAKE_CURRENT_BINARY_DIR
}
-P
${
CMAKE_CURRENT_SOURCE_DIR
}
/gitversion.cmake
)
add_custom_target
(
liblinphone-git-version
COMMAND
${
CMAKE_COMMAND
}
-DGIT_EXECUTABLE=
${
GIT_EXECUTABLE
}
-DWORK_DIR=
${
CMAKE_CURRENT_SOURCE_DIR
}
-DOUTPUT_DIR=
${
CMAKE_CURRENT_BINARY_DIR
}
-P
${
CMAKE_CURRENT_SOURCE_DIR
}
/gitversion.cmake
BYPRODUCTS
"
${
CMAKE_CURRENT_BINARY_DIR
}
/liblinphone_gitversion.h"
)
add_definitions
(
-DUSE_BELLESIP
...
...
@@ -161,10 +159,10 @@ if(INTL_FOUND)
endif
()
if
(
ENABLE_STATIC
)
add_library
(
linphone STATIC
${
SOURCE_FILES
}
${
GENERATED_SOURCE_FILES
}
)
add_library
(
linphone STATIC
${
SOURCE_FILES
}
)
target_link_libraries
(
linphone
${
LIBS
}
)
else
()
add_library
(
linphone SHARED
${
SOURCE_FILES
}
${
GENERATED_SOURCE_FILES
}
)
add_library
(
linphone SHARED
${
SOURCE_FILES
}
)
set_target_properties
(
linphone PROPERTIES VERSION
${
LINPHONE_SO_VERSION
}
LINKER_LANGUAGE CXX
)
target_link_libraries
(
linphone
${
LIBS
}
)
if
(
MSVC
)
...
...
@@ -176,6 +174,7 @@ else()
endif
()
endif
()
endif
()
add_dependencies
(
linphone liblinphone-git-version
)
if
(
WIN32 AND CMAKE_SYSTEM_NAME STREQUAL
"WindowsPhone"
)
set_target_properties
(
linphone PROPERTIES PREFIX
"lib"
)
endif
()
...
...
coreapi/gitversion.cmake
View file @
00e96f59
...
...
@@ -27,13 +27,8 @@ if(GIT_EXECUTABLE)
OUTPUT_VARIABLE GIT_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E echo
"#define LIBLINPHONE_GIT_VERSION
\"
${
GIT_REVISION
}
\"
"
OUTPUT_FILE
${
OUTPUT_DIR
}
/liblinphone_gitversion.h
)
else
()
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E echo
"#define LIBLINPHONE_GIT_VERSION
\"
unknown
\"
"
OUTPUT_FILE
${
OUTPUT_DIR
}
/liblinphone_gitversion.h
)
set
(
GIT_REVISION
"unknown"
)
endif
()
configure_file
(
"
${
WORK_DIR
}
/gitversion.h.in"
"
${
OUTPUT_DIR
}
/liblinphone_gitversion.h"
@ONLY
)
coreapi/gitversion.h.in
0 → 100644
View file @
00e96f59
/*
linphone
Copyright (C) 2010-2014 Belledonne Communications SARL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#define LIBLINPHONE_GIT_VERSION "@GIT_REVISION@"
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment