-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update Makefile to use correct directory for cmake command
- Loading branch information
Showing
2 changed files
with
24 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,34 @@ | ||
CMAKELISTS_FILE := CMakeLists.txt | ||
|
||
# Determine if we are in the specific subdirectory | ||
ROOT_DIR := $(shell git rev-parse --show-toplevel) | ||
CURRENT_DIR := $(shell pwd) | ||
SUBDIR := specific-makefiles/build-in-libs | ||
|
||
# Path to the build directory should always be in the root | ||
BUILD_DIR := $(ROOT_DIR)/build | ||
CMAKELISTS_FILE := $(ROOT_DIR)/CMakeLists.txt | ||
|
||
# Command to use for cmake based on current directory | ||
CMAKE_COMMAND := cmake -S $(ROOT_DIR) -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release | ||
ifneq ($(findstring $(SUBDIR), $(CURRENT_DIR)),) | ||
CMAKE_COMMAND := $(CMAKE_COMMAND) -DUSE_CPM=1 | ||
endif | ||
|
||
srpm: | ||
dnf -y install cmake gcc-c++ make spdlog-devel fmt-devel cxxopts-devel json-devel git | ||
mkdir -p build | ||
pwd | ||
make | ||
@VERSION_STRING=$$(cat build/.version); \ | ||
mkdir -p $(BUILD_DIR) | ||
cd $(ROOT_DIR); make | ||
@VERSION_STRING=$$(cat $(BUILD_DIR)/.version); \ | ||
sed -i 's/\$${PROJECT_VERSION}/'$$VERSION_STRING'/g' $(CMAKELISTS_FILE); \ | ||
sed -i '/include(cmake\/DynamicVersion\.cmake)/d' $(CMAKELISTS_FILE); \ | ||
sed -i '/dynamic_version(PROJECT_PREFIX filestorm_)/d' $(CMAKELISTS_FILE); \ | ||
sed -i 's/cmake_minimum_required(VERSION 3.25)/cmake_minimum_required(VERSION 3.20)/g' $(CMAKELISTS_FILE) | ||
make clean | ||
mkdir -p build | ||
ifeq ($(wildcard USE_CPM),) | ||
echo RUNNING without CPM; \ | ||
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release | ||
else | ||
echo RUNNING with CPM; \ | ||
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DUSE_CPM=1 | ||
endif | ||
cpack -G RPM --config build/CPackSourceConfig.cmake | ||
echo `ls` | ||
for rpmfile in `ls filestorm-*.src.rpm`; do \ | ||
cd $(ROOT_DIR); make clean | ||
mkdir -p $(BUILD_DIR) | ||
$(CMAKE_COMMAND) | ||
cpack -G RPM --config $(BUILD_DIR)/CPackSourceConfig.cmake | ||
echo `ls $(BUILD_DIR)` | ||
for rpmfile in `ls $(CURRENT_DIR)/filestorm-*.src.rpm`; do \ | ||
echo $$rpmfile; \ | ||
cp $$rpmfile $(outdir); \ | ||
done |
This file was deleted.
Oops, something went wrong.