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
e4dcb70b
Commit
e4dcb70b
authored
Jan 14, 2014
by
Ghislain MARY
Browse files
Add generation of linphone_gitversion.h when using cmake.
parent
e756795d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
CMakeLists.txt
CMakeLists.txt
+1
-0
coreapi/CMakeLists.txt
coreapi/CMakeLists.txt
+36
-0
No files found.
CMakeLists.txt
View file @
e4dcb70b
...
...
@@ -29,6 +29,7 @@ endif()
include_directories
(
include/
coreapi/
${
CMAKE_CURRENT_BINARY_DIR
}
/coreapi/
${
CMAKE_CURRENT_SOURCE_DIR
}
/../cmake/libxml2/
)
...
...
coreapi/CMakeLists.txt
View file @
e4dcb70b
find_program
(
GIT git
)
set
(
GIT_VERSION
"unknown"
)
if
(
GIT
)
execute_process
(
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
COMMAND
${
GIT
}
describe --always
OUTPUT_VARIABLE GIT_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process
(
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
COMMAND
${
GIT
}
describe --abbrev=0
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process
(
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
COMMAND
${
GIT
}
rev-parse HEAD
OUTPUT_VARIABLE GIT_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
GIT_DESCRIBE
)
set
(
GIT_VERSION
${
GIT_DESCRIBE
}
)
else
(
GIT_DESCRIBE
)
if
(
GIT_REVISION
)
set
(
GIT_VERSION
${
GIT_REVISION
}
)
endif
(
GIT_REVISION
)
endif
(
GIT_DESCRIBE
)
endif
(
GIT
)
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E echo
"#define LIBLINPHONE_GIT_VERSION
\"
${
GIT_VERSION
}
\"
"
OUTPUT_FILE
${
CMAKE_CURRENT_BINARY_DIR
}
/liblinphone_gitversion.h
)
set
(
SOURCE_FILES
address.c
authentication.c
...
...
@@ -66,6 +101,7 @@ add_definitions(
if
(
WIN32
)
add_definitions
(
-DWINDOW_NATIVE
/FIliblinphone_gitversion.h
)
set
(
LIBS ws2_32
)
...
...
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