Browse Source

- add $(PKG)_CMAKE_CMDS

master
vanhofen 3 years ago
parent
commit
ae727a9e22
  1. 28
      package/pkg-cmake.mk
  2. 11
      package/pkg-utils.mk

28
package/pkg-cmake.mk

@ -44,16 +44,18 @@ TARGET_CMAKE_OPTS += \
-DCMAKE_READELF="$(TARGET_READELF)" \ -DCMAKE_READELF="$(TARGET_READELF)" \
-DCMAKE_STRIP="$(TARGET_STRIP)" -DCMAKE_STRIP="$(TARGET_STRIP)"
define TARGET_CMAKE define TARGET_CMAKE_CMDS
@$(call MESSAGE,"Configuring")
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
rm -f CMakeCache.txt; \ rm -f CMakeCache.txt; \
$(TARGET_CMAKE_ENV) $($(PKG)_CONF_ENV) \ $(TARGET_CMAKE_ENV) $($(PKG)_CONF_ENV) \
$($(PKG)_CMAKE) \ $($(PKG)_CMAKE) \
$(TARGET_CMAKE_OPTS) $($(PKG)_CONF_OPTS); \ $(TARGET_CMAKE_OPTS) $($(PKG)_CONF_OPTS)
) endef
define TARGET_CMAKE
@$(call MESSAGE,"Configuring")
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
$(Q)$(call $(PKG)_CMAKE_CMDS)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
endef endef
@ -88,16 +90,18 @@ HOST_CMAKE_OPTS += \
-DCMAKE_INSTALL_PREFIX="$(HOST_DIR)" \ -DCMAKE_INSTALL_PREFIX="$(HOST_DIR)" \
-DCMAKE_PREFIX_PATH="$(HOST_DIR)" -DCMAKE_PREFIX_PATH="$(HOST_DIR)"
define HOST_CMAKE define HOST_CMAKE_CMDS
@$(call MESSAGE,"Configuring")
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
$(Q)( \
$(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \
rm -f CMakeCache.txt; \ rm -f CMakeCache.txt; \
$(HOST_CMAKE_ENV) $($(PKG)_CONF_ENV) \ $(HOST_CMAKE_ENV) $($(PKG)_CONF_ENV) \
$($(PKG)_CMAKE) \ $($(PKG)_CMAKE) \
$(HOST_CMAKE_OPTS) $($(PKG)_CONF_OPTS); \ $(HOST_CMAKE_OPTS) $($(PKG)_CONF_OPTS)
) endef
define HOST_CMAKE
@$(call MESSAGE,"Configuring")
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
$(Q)$(call $(PKG)_CMAKE_CMDS)
$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
endef endef

11
package/pkg-utils.mk

@ -43,10 +43,19 @@ ifndef $(PKG)_AUTORECONF_OPTS
$(PKG)_AUTORECONF_OPTS = $(PKG)_AUTORECONF_OPTS =
endif endif
# cmake / configure / meson # cmake
ifndef $(PKG)_CMAKE ifndef $(PKG)_CMAKE
$(PKG)_CMAKE = cmake $(PKG)_CMAKE = cmake
endif endif
ifndef $(PKG)_CMAKE_CMDS
ifeq ($(PKG_HOST_PACKAGE),YES)
$(PKG)_CMAKE_CMDS = $$(HOST_CMAKE_CMDS)
else
$(PKG)_CMAKE_CMDS = $$(TARGET_CMAKE_CMDS)
endif
endif
# configure
ifndef $(PKG)_CONFIGURE_CMD ifndef $(PKG)_CONFIGURE_CMD
$(PKG)_CONFIGURE_CMD = configure $(PKG)_CONFIGURE_CMD = configure
endif endif

Loading…
Cancel
Save