Use less error-prone way of setting build flags.

ci/unstable
Modestas Vainius 14 years ago
parent 735ba71997
commit 42d7957a6a

1
debian/changelog vendored

@ -22,6 +22,7 @@ cmake (2.8.4-1) UNRELEASED; urgency=low
[ Modestas Vainius ]
* Disable git-import-orig in debian/watch. One extra command is not a good
enough reason to lose control of packaging to non-trivial black-box tools.
* Use less error-prone way of setting build flags.
-- Kai Wasserbäch <debian@carbon-project.org> Sun, 16 Jan 2011 11:40:34 +0100

37
debian/rules vendored

@ -1,25 +1,30 @@
#!/usr/bin/make -f
BUILD_FLAGS_FILE = build-flags.cmake
set_build_flag = echo 'set($(1) $(2) CACHE \
$(if $(filter $(2),YES ON TRUE NO OFF FALSE),BOOL,STRING) \
$(or $(3),"") FORCE)' >> $(BUILD_FLAGS_FILE)
$(BUILD_FLAGS_FILE):
touch $@
echo 'set(CMAKE_SKIP_RPATH YES CACHE BOOL "Skip rpath" FORCE)' >> $@
echo 'set(CMAKE_USE_RELATIVE_PATHS YES CACHE BOOL "Use relative paths" FORCE)' >> $@
echo 'set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Verbose build" FORCE)' >> $@
echo 'set(CMAKE_C_FLAGS "$(CFLAGS)" CACHE STRING "C flags" FORCE)' >> $@
echo 'set(CMAKE_CXX_FLAGS "$(CFLAGS)" CACHE STRING "C++ flags" FORCE)' >> $@
echo 'set(CMAKE_SKIP_BOOTSTRAP_TEST ON CACHE BOOL "Skip BootstrapTest" FORCE)' >> $@
# echo 'set(BUILD_WXDialog ON CACHE STRING "Build WXDialog" FORCE)' >> $@
echo 'set(BUILD_CursesDialog TRUE CACHE BOOL "Build curses GUI" FORCE)' >> $@
echo 'set(BUILD_QtDialog TRUE CACHE BOOL "Build Qt4 GUI" FORCE)' >> $@
echo 'set(MINGW_CC_LINUX2WIN_EXECUTABLE "" CACHE FILEPATH "Never detect mingw" FORCE)' >> $@
# echo 'set(TARGET_VERSION CACHE STRING ""FORCE)' >> $@
# echo 'set(TARGET_SOVERSION CACHE STRING "" FORCE)' >> $@
# echo 'set(BUILD_DOCUMENTATION ON CACHE BOOL "" FORCE)' >> $@
# echo 'set(BUILD_DOXYGEN ON CACHE BOOL "" FORCE)' >> $@
echo 'set(CMAKE_USE_SYSTEM_LIBARCHIVE YES CACHE BOOL "" FORCE)' >> $@
echo 'set(CTEST_USE_XMLRPC YES CACHE BOOL "" FORCE)' >> $@
$(call $(flag_action),CMAKE_SKIP_RPATH,ON,"Skip rpath")
$(call $(flag_action),CMAKE_USE_RELATIVE_PATHS,ON,"Use relative paths")
$(call $(flag_action),CMAKE_VERBOSE_MAKEFILE,ON,"Verbose build")
$(call $(flag_action),CMAKE_C_FLAGS,"$(CFLAGS)","C flags")
$(call $(flag_action),CMAKE_CXX_FLAGS,"$(CFLAGS)","C++ flags")
$(call $(flag_action),CMAKE_SKIP_BOOTSTRAP_TEST,ON,"Skip BootstrapTest")
$(call $(flag_action),BUILD_WXDialog,ON,"Build WXDialog")
$(call $(flag_action),BUILD_CursesDialog,ON,"Build curses GUI")
$(call $(flag_action),BUILD_QtDialog,ON,"Build Qt4 GUI")
$(call $(flag_action),MINGW_CC_LINUX2WIN_EXECUTABLE,"","Never detect mingw")
# $(call $(flag_action),TARGET_VERSION)
# $(call $(flag_action),TARGET_SOVERSION)
# $(call $(flag_action),BUILD_DOCUMENTATION,ON)
# $(call $(flag_action),BUILD_DOXYGEN,ON)
$(call $(flag_action),CMAKE_USE_SYSTEM_LIBARCHIVE,ON)
$(call $(flag_action),CTEST_USE_XMLRPC,ON)
$(BUILD_FLAGS_FILE): flag_action := set_build_flag
override_dh_auto_configure: $(BUILD_FLAGS_FILE)
rm -rf Build && mkdir -p Build

Loading…
Cancel
Save