Sfoglia il codice sorgente

fixes gh-2459 Added target properties for includer files and images.

Signed-off-by: Philip Schwartz <philip.schwartz@lexisnexis.com>
Philip Schwartz 13 anni fa
parent
commit
c874c17940

+ 21 - 4
cmake_modules/docMacros.cmake

@@ -1,12 +1,27 @@
 
 MACRO(RUN_XSLTPROC _xsl _file _out _in_dir _out_dir )
+	PARSE_ARGUMENTS(_XSLT "" "" ${ARGN})
+	LIST(LENGTH _XSLT_DEFAULT_ARGS _XSLT_LEN)
+	if( _XSLT_LEN )
+		LIST(GET _XSLT_DEFAULT_ARGS 0 TARG)
+		set(DIRS ${_XSLT_DEFAULT_ARGS})
+		LIST(REMOVE_AT DIRS 0)
+		LIST(LENGTH DIRS length)
+		set(FILES "")
+        	if ( length )
+	                foreach( D ${DIRS} )
+        	                file(GLOB_RECURSE _DB_INCLUDES ${D}/*.xml)
+            	        	set(FILES ${FILES} ${_DB_INCLUDES})
+	                endforeach()
+        	endif()
+	endif()
 	STRING(REGEX REPLACE "([0-9a-z_-]*).xml" "\\1" _file_base "${_file}")
 	SET(_xsl ${_xsl})
 	SET(_file ${_file})
 	SET(_out ${_out})
 	SET(_in_dir ${_in_dir})
 	SET(_out_dir ${_out_dir})
-	IF( ${ARGC} EQUAL 6 )
+	IF( TARG )
 		SET(_xslt_target ${ARGN})
 		SET(xinclude "-xinclude")
 	ELSE()
@@ -17,7 +32,7 @@ MACRO(RUN_XSLTPROC _xsl _file _out _in_dir _out_dir )
 	ADD_CUSTOM_COMMAND(
 		COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/${_out}.cmake
 		OUTPUT ${_out_dir}/${_out}
-		DEPENDS docbook-expand ${_xsl} ${_in_dir}/${_file} ${_xslt_target}
+		DEPENDS docbook-expand ${_xsl} ${_in_dir}/${_file} ${_xslt_target} ${FILES} ${DOC_IMAGE_LIST}
 		)
 	set_source_files_properties(${_out_dir}/${_out} PROPERTIES GENERATED TRUE)
 	ADD_CUSTOM_TARGET(${_out} DEPENDS ${_out_dir}/${_out} )
@@ -57,6 +72,8 @@ MACRO(CLEAN_REL_SET _file _version_dir _doc_dir _in_dir _out_dir)
 ENDMACRO(CLEAN_REL_SET)
 
 MACRO(DOCBOOK_TO_PDF _xsl _file _name)
+	PARSE_ARGUMENTS(_DB "" "" ${ARGN})
+	LIST(LENGTH _DB_DEFAULT_ARGS length)
 	IF(MAKE_DOCS)
 		STRING(REGEX REPLACE "([0-9a-z_-]*).xml" "\\1" _file_base "${_file}")
 		SET(_fo_file ${_file_base}.fo)
@@ -64,11 +81,11 @@ MACRO(DOCBOOK_TO_PDF _xsl _file _name)
 		SET( _docs_target "doc_${_pdf_file}")  # File to Name of type.
 		CLEAN_REL_BOOK(${_file} ${VERSION_DIR} ${DOC_IMAGES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
 		set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_file_base}.xsl  PROPERTIES GENERATED TRUE)
-		RUN_XSLTPROC(${_xsl} ${_file} ${_fo_file} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} "clean_${_file}")
+		RUN_XSLTPROC(${_xsl} ${_file} ${_fo_file} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} "clean_${_file}" ${_DB_DEFAULT_ARGS})
 		RUN_FOP(${_fo_file} ${_pdf_file})
 		set_source_files_properties(${_pdf_file} PROPERTIES GENERATED TRUE)
 		MESSAGE("-- Adding document: ${_pdf_file} -  target: ${_docs_target}")
-		ADD_CUSTOM_TARGET(${_docs_target} ALL DEPENDS ${_pdf_file} ) 
+		ADD_CUSTOM_TARGET(${_docs_target} ALL DEPENDS ${_pdf_file})
 		set_property(GLOBAL APPEND PROPERTY DOC_TARGETS "${_docs_target}")
 	ENDIF(MAKE_DOCS)
 ENDMACRO(DOCBOOK_TO_PDF targetname_suffix srcfile outfile targetdir deps_list)

+ 2 - 0
docs/CMakeLists.txt

@@ -38,6 +38,8 @@ else()
 	set (DOC_VERSION "${DOC_VERSION}.${HPCC_SEQUENCE}${HPCC_MATURITY}")
 endif()
 
+# Build image file list to add to source watch.
+file(GLOB_RECURSE DOC_IMAGES_LIST images/*)
 
 # Required directories to add.
 add_subdirectory(common)

+ 1 - 1
docs/ECLLanguageReference/CMakeLists.txt

@@ -15,5 +15,5 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
-DOCBOOK_TO_PDF( ${FO_XSL} ECLR-includer.xml "ECLLanguageReference")
+DOCBOOK_TO_PDF( ${FO_XSL} ECLR-includer.xml "ECLLanguageReference" "ECLR_mods")
 

+ 1 - 1
docs/ECLPlayground/CMakeLists.txt

@@ -15,5 +15,5 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
-DOCBOOK_TO_PDF( ${FO_XSL} ECLPlayground-includer.xml "ECL_Playground")
+DOCBOOK_TO_PDF( ${FO_XSL} ECLPlayground-includer.xml "ECL_Playground" "ECLPlay-Mods")
 

+ 1 - 1
docs/ECLProgrammersGuide/CMakeLists.txt

@@ -16,5 +16,5 @@
 ################################################################################
 
 
-DOCBOOK_TO_PDF( ${FO_XSL} PrGd-Includer.xml "ECLProgrammersGuide")
+DOCBOOK_TO_PDF( ${FO_XSL} PrGd-Includer.xml "ECLProgrammersGuide" "PRG_Mods")
 

+ 1 - 1
docs/ECLStandardLibraryReference/CMakeLists.txt

@@ -15,4 +15,4 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
-DOCBOOK_TO_PDF( ${FO_XSL} SLR-includer.xml "ECLStandardLibraryReference")
+DOCBOOK_TO_PDF( ${FO_XSL} SLR-includer.xml "ECLStandardLibraryReference" "SLR-Mods")

+ 1 - 1
docs/HDFSConnector/CMakeLists.txt

@@ -15,5 +15,5 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
-DOCBOOK_TO_PDF( ${FO_XSL} HDFS_to_HPCC_ConnectorIncluder.xml "HDFS_to_HPCC_Connector")
+DOCBOOK_TO_PDF( ${FO_XSL} HDFS_to_HPCC_ConnectorIncluder.xml "HDFS_to_HPCC_Connector" "HDFS_Mods")
 

+ 1 - 1
docs/HPCCClientTools/CMakeLists.txt

@@ -15,5 +15,5 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
-DOCBOOK_TO_PDF( ${FO_XSL} ClientTools.xml "HPCCClientTools")
+DOCBOOK_TO_PDF( ${FO_XSL} ClientTools.xml "HPCCClientTools" "CT_Mods")