Skip to content

Commit

Permalink
Merge pull request intel#691 from jiazhang0/master
Browse files Browse the repository at this point in the history
Fix cmake3 version check
  • Loading branch information
llly authored Apr 14, 2021
2 parents 71747ab + b57accd commit fbd8164
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions psw/ae/aesm_service/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@ $(APPNAME): $(CPPMICROSERVICES) source/build/CMakeCache.txt urts RDRAND
$(CP) $(CPPMICROSERVICES) source/build/bin/

CMAKE_VERSION_MAJOR=$(shell cmake --version | head -n 1 | cut -d \ -f 3 | cut -d . -f 1)
CMAKE_VERSION_MINOR=$(shell cmake --version | head -n 1 | cut -d \ -f 3 | cut -d . -f 2)
CMAKE_VERSION_MINOR=$(shell cmake --version | head -n 1 | cut -d \ -f 3 | cut -d . -f 2 | xargs printf '%02d')
CMAKE_VERSION=$(CMAKE_VERSION_MAJOR)$(CMAKE_VERSION_MINOR)
CMAKE := $(HOME)/cache/bin/cmake

.PHONY: CPPMICROSERVICES
$(CPPMICROSERVICES):
mkdir -p $(CPPMICROSERVICES_DIR)/build
ifeq ($(shell test $(CMAKE_VERSION) -lt 32 && echo 1), 1)
ifeq ($(shell test $(CMAKE_VERSION) -lt 302 && echo 1), 1)
$(CPPMICROSERVICES_DIR)/install_cmake.sh
cd $(CPPMICROSERVICES_DIR)/build && $(CMAKE) -DCMAKE_COMMAND=$(CMAKE) $(CPPMICROSERVICES_CONFIG) ../ && $(MAKE) && $(MAKE) install
else
cd $(CPPMICROSERVICES_DIR)/build && cmake $(CPPMICROSERVICES_CONFIG) ../ && $(MAKE) && $(MAKE) install
endif

source/build/CMakeCache.txt: $(CPPMICROSERVICES)
ifeq ($(shell test $(CMAKE_VERSION) -lt 30 && echo 1), 1)
ifeq ($(shell test $(CMAKE_VERSION) -lt 300 && echo 1), 1)
mkdir -p source/build && cd source/build && $(CMAKE) -DCMAKE_COMMAND=$(CMAKE) $(AESM_CONFIG) ../
else
mkdir -p source/build && cd source/build && cmake $(AESM_CONFIG) ../
Expand Down

0 comments on commit fbd8164

Please sign in to comment.