-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do initial "full" and "standard" build system I have too little experience with cmake and so for sure other improvements are possible I updated also README, github workflow and gitignore I also improved the debian packaging to make more standard thank to the "complete" build system I also did a fix to lib/blksnap/Session.cpp and tools/blksnap/main.cpp for build failed spotted creating deb packages with all hardening enabled, I not sure that file permission setted are correct/optimal Need also to have better build of only part and not all (blksnap-dev and/or blksnap-tools and/or blksnap-tests) for now is possible with blksnap-dev and blksnap-tools targets but don't seems optimal On circleci tests cmake uninstall file was not found even if I not understand why, manually with only "cmake ." and also generating debian packages (same of circleci tests) is ok. I did some try without find a solution so I added an exists check for don't fail in similar case Make install and uninstall print wrong text related to tests files don't installed or uninstalled as not found but checking them was installed and uninstalled correctly, also for this I didn't found a solution
- Loading branch information
Showing
14 changed files
with
140 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SPDX-License-Identifier: GPL-2.0+ | ||
|
||
cmake_minimum_required(VERSION 3.5) | ||
project(blksnap) | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
|
||
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/blksnap) | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/tools/blksnap) | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/tests/cpp) | ||
|
||
if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in) | ||
configure_file(${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in | ||
${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake @ONLY | ||
) | ||
add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") | ||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") | ||
endif() | ||
|
||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) | ||
string(REPLACE "\n" ";" files "${files}") | ||
foreach(file ${files}) | ||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") | ||
if(EXISTS "$ENV{DESTDIR}${file}") | ||
exec_program( | ||
"@CMAKE_COMMAND@" ARGS "-E rm -f \"$ENV{DESTDIR}${file}\"" | ||
OUTPUT_VARIABLE rm_out | ||
RETURN_VALUE rm_retval | ||
) | ||
if("${rm_retval}" STREQUAL 0) | ||
else() | ||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") | ||
endif() | ||
else() | ||
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") | ||
endif() | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
opt | ||
opt/blksnap/tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
#!/usr/bin/make -f | ||
# -*- makefile -*- | ||
include /usr/share/dpkg/pkg-info.mk | ||
include /usr/share/dpkg/default.mk | ||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all | ||
DPKG_EXPORT_BUILDFLAGS = 1 | ||
CFLAGS+=$(CPPFLAGS) | ||
CXXFLAGS+=$(CPPFLAGS) | ||
|
||
|
||
DEB_CMAKE_EXTRA_FLAGS = \ | ||
-DCMAKE_INSTALL_PREFIX=/usr \ | ||
-DCMAKE_BUILD_TYPE=RelWithDebInfo | ||
|
||
%: | ||
dh $@ | ||
|
||
override_dh_auto_configure: | ||
dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.