Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
Simox
Commits
faa70b0a
Commit
faa70b0a
authored
9 years ago
by
Nikolaus Vahrenkamp
Browse files
Options
Downloads
Patches
Plain Diff
cmake git setup
parent
d4e2b86a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+30
-9
30 additions, 9 deletions
CMakeLists.txt
with
30 additions
and
9 deletions
CMakeLists.txt
+
30
−
9
View file @
faa70b0a
...
...
@@ -127,14 +127,34 @@ install(EXPORT SimoxTargets DESTINATION
#############################################################
# PACKAGING (DEB)
FIND_PACKAGE
(
Subversion QUIET
)
IF
(
Subversion_FOUND
)
Subversion_WC_INFO
(
${
CMAKE_HOME_DIRECTORY
}
Project
)
MESSAGE
(
"Current revision is
${
Project_WC_REVISION
}
"
)
ELSE
()
SET
(
Project_WC_REVISION
"Unknown"
)
MESSAGE
(
"Could not determine current svn revision."
)
ENDIF
()
# git version not used any more!
find_package
(
Git QUIET
)
if
(
GIT_FOUND
)
# output format <tag>-<commit-id>-dirty or <tag>-<commit-id> or <commit-id>
execute_process
(
COMMAND
${
GIT_EXECUTABLE
}
describe --long --tags --dirty --always
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
RESULT_VARIABLE GIT_EXIT_STATUS
OUTPUT_VARIABLE SIMOX_PACKAGE_GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if
(
NOT GIT_EXIT_STATUS EQUAL 0
)
message
(
WARNING
"no git repository or unable to run git describe"
)
set
(
Project_WC_REVISION
"Unknown"
)
else
()
# string(REGEX REPLACE "\n" "" SIMOX_PACKAGE_GIT_VERSION ${SIMOX_PACKAGE_GIT_VERSION})
message
(
STATUS
"simox git version:
${
SIMOX_PACKAGE_GIT_VERSION
}
"
)
set
(
Project_WC_REVISION
${
SIMOX_PACKAGE_GIT_VERSION
}
)
endif
()
endif
()
#FIND_PACKAGE(Subversion QUIET)
#IF(Subversion_FOUND)
# Subversion_WC_INFO(${CMAKE_HOME_DIRECTORY} Project)
# MESSAGE("Current revision is ${Project_WC_REVISION}")
#ELSE()
# SET(Project_WC_REVISION "Unknown")
# MESSAGE("Could not determine current svn revision.")
#ENDIF()
IF
(
CMAKE_SYSTEM_PROCESSOR STREQUAL
"x86_64"
)
SET
(
CPACK_DEBIAN_ARCHITECTURE
"amd64"
)
...
...
@@ -153,7 +173,8 @@ SET(CPACK_PACKAGE_VENDOR "KIT")
SET
(
CPACK_PACKAGE_CONTACT
"Nikolaus Vahrenkamp <vahrenkamp@kit.edu>"
)
SET
(
CPACK_PACKAGE_VERSION_MAJOR
"
${
Simox_MAJOR_VERSION
}
"
)
SET
(
CPACK_PACKAGE_VERSION_MINOR
"
${
Simox_MINOR_VERSION
}
"
)
SET
(
CPACK_PACKAGE_VERSION_PATCH
"
${
Simox_PATCH_VERSION
}
-r
${
Project_WC_REVISION
}
"
)
#SET(CPACK_PACKAGE_VERSION_PATCH "${Simox_PATCH_VERSION}-r${Project_WC_REVISION}")
SET
(
CPACK_PACKAGE_VERSION_PATCH
"
${
Simox_PATCH_VERSION
}
"
)
SET
(
CPACK_PACKAGE_FILE_NAME
"simox_
${
Simox_MAJOR_VERSION
}
.
${
Simox_MINOR_VERSION
}
.
${
Simox_PATCH_VERSION
}
-r
${
Project_WC_REVISION
}
_
${
CPACK_DEBIAN_ARCHITECTURE
}
"
)
SET
(
CPACK_SOURCE_PACKAGE_FILE_NAME
"simox_
${
Simox_MAJOR_VERSION
}
.
${
Simox_MINOR_VERSION
}
.
${
Simox_PATCH_VERSION
}
-r
${
Project_WC_REVISION
}
"
)
set
(
CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment