Skip to content

Commit

Permalink
Re #6101. QTassistant finally building out of source.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Feb 27, 2013
1 parent fce7561 commit 0df79b5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 18 deletions.
27 changes: 17 additions & 10 deletions Code/Mantid/docs/qtassistant/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,46 @@
if (QT_QCOLLECTIONGENERATOR_EXECUTABLE)
message (STATUS "Adding information for qtassistant: mantid.qhc")
set (HELP_QHCP_SOURCE
mantid.qhcp
${CMAKE_BINARY_DIR}/qtassistant/mantid.qhcp
img/Mantid_Logo_Transparent.png
img/MantidPlot_Icon_32offset.png
src/about.txt
src/mantidgeneral.qhp
)

configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/mantid.qhcp.template
${CMAKE_BINARY_DIR}/qtassistant/mantid.qhcp )

set ( HELP_ALGO_OUT
generated/algorithms.qhp
generated/algorithms_index.html )
${CMAKE_BINARY_DIR}/qtassistant/generated/algorithms.qhp
${CMAKE_BINARY_DIR}/qtassistant/generated/algorithms_index.html )

set ( HELP_FIT_OUT
generated/fitfunctions.qhp
generated/fitfunctions_index.html )

${CMAKE_BINARY_DIR}/qtassistant/generated/fitfunctions.qhp
${CMAKE_BINARY_DIR}/qtassistant/generated/fitfunctions_index.html )

add_custom_command(OUTPUT ${HELP_ALGO_OUT}
DEPENDS make_algorithms_help.py qhpfile.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/make_algorithms_help.py -m ${CMAKE_BINARY_DIR}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/make_algorithms_help.py
-m ${CMAKE_BINARY_DIR} -o ${CMAKE_BINARY_DIR}/qtassistant/generated
)

add_custom_command(OUTPUT ${HELP_FIT_OUT}
DEPENDS make_fitfunctions_help.py qhpfile.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/make_fitfunctions_help.py -m ${CMAKE_BINARY_DIR}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/make_fitfunctions_help.py
-m ${CMAKE_BINARY_DIR} -o ${CMAKE_BINARY_DIR}/qtassistant/generated
)

add_custom_command(OUTPUT mantid.qhc algorithms.qch mantidgeneral.qch
DEPENDS ${HELP_ALGO_OUT} ${HELP_FIT_OUT} ${HELP_QHCP_SOURCE}
COMMAND ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/mantid.qhcp
COMMAND ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} ${CMAKE_BINARY_DIR}/qtassistant/mantid.qhcp
)

add_custom_target ( qtassistant
DEPENDS MantidPlot generated/algorithms.qhp generated/fitfunctions.qhp mantid.qhc
DEPENDS MantidPlot
${CMAKE_BINARY_DIR}/qtassistant/generated/algorithms.qhp
${CMAKE_BINARY_DIR}/qtassistant/generated/fitfunctions.qhp
mantid.qhc
)

# install ( FILES mantid.qhc algorithms.qch mantidgeneral.qch
Expand Down
9 changes: 7 additions & 2 deletions Code/Mantid/docs/qtassistant/make_algorithms_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,18 @@ def process(algos, qhp, outputdir):
parser.add_argument('-m', '--mantidpath', dest='mantidpath',
default=defaultmantidpath,
help="Full path to the Mantid compiled binary folder. Default: '%s'. This will be saved to an .ini file" % defaultmantidpath)
parser.add_argument('-o', '--output', dest='helpoutdir',
help="Full path to where the output files should go.")

args = parser.parse_args()

# where to put the generated files
helpsrcdir = os.path.dirname(os.path.abspath(__file__))
helpoutdir = os.path.join(helpsrcdir, OUTPUTDIR)
print "Writing results to '%s'" % helpsrcdir
if args.helpoutdir is not None:
helpoutdir = os.path.abspath(args.helpoutdir)
else:
helpoutdir = os.path.join(helpsrcdir, OUTPUTDIR)
print "Writing algorithm web pages to '%s'" % helpoutdir
if not os.path.exists(helpoutdir):
os.makedirs(helpoutdir)
addWikiDir(helpsrcdir)
Expand Down
11 changes: 9 additions & 2 deletions Code/Mantid/docs/qtassistant/make_fitfunctions_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,20 @@ def process(functionsalgos, qhp, outputdir):
parser.add_argument('-m', '--mantidpath', dest='mantidpath',
default=defaultmantidpath,
help="Full path to the Mantid compiled binary folder. Default: '%s'. This will be saved to an .ini file" % defaultmantidpath)
parser.add_argument('-o', '--output', dest='helpoutdir',
help="Full path to where the output files should go.")

args = parser.parse_args()

# where to put the generated files
helpsrcdir = os.path.dirname(os.path.abspath(__file__))
helpoutdir = os.path.join(helpsrcdir, OUTPUTDIR)
print helpoutdir
if args.helpoutdir is not None:
helpoutdir = os.path.abspath(args.helpoutdir)
else:
helpoutdir = os.path.join(helpsrcdir, OUTPUTDIR)
print "Writing fit function web pages to '%s'" % helpoutdir
if not os.path.exists(helpoutdir):
os.makedirs(helpoutdir)
addWikiDir(helpsrcdir)

# initialize mantid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<assistant>
<title>Mantid Help</title>
<startPage>qthelp://org.mantidproject/doc/index.html</startPage>
<applicationIcon>img/MantidPlot_Icon_32offset.png</applicationIcon>
<applicationIcon>@CMAKE_CURRENT_SOURCE_DIR@/img/MantidPlot_Icon_32offset.png</applicationIcon>
<enableFilterFunctionality>false</enableFilterFunctionality>
<enableDocumentationManager>true</enableDocumentationManager>
<enableAddressBar visible="true">false</enableAddressBar>
Expand All @@ -12,14 +12,14 @@
<text>About Mantid</text>
</aboutMenuText>
<aboutDialog>
<file>src/about.txt</file>
<icon>img/Mantid_Logo_Transparent.png</icon>
<file>@CMAKE_CURRENT_SOURCE_DIR@/src/about.txt</file>
<icon>@CMAKE_CURRENT_SOURCE_DIR@/img/Mantid_Logo_Transparent.png</icon>
</aboutDialog>
</assistant>
<docFiles>
<generate>
<file>
<input>src/mantidgeneral.qhp</input>
<input>@CMAKE_CURRENT_SOURCE_DIR@/src/mantidgeneral.qhp</input>
<output>mantidgeneral.qch</output>
</file>
<file>
Expand Down

0 comments on commit 0df79b5

Please sign in to comment.