# How to include help files (HTMLDefines.h, MyApp.hhc, MyApp.hhk, MyApp.hhp) in the binary directory to get MyApp.chm help file in VS2013?

**URL:** <https://discourse.itk.org/t/how-to-include-help-files-htmldefines-h-myapp-hhc-myapp-hhk-myapp-hhp-in-the-binary-directory-to-get-myapp-chm-help-file-in-vs2013/2128>\
**Category:** Engineering\
**Tags:** vs2013, itk-4132, vtk-810, mfc, cmake\
**Created:** [August 7, 2019, 1:28pm UTC](https://discourse.itk.org/t/how-to-include-help-files-htmldefines-h-myapp-hhc-myapp-hhk-myapp-hhp-in-the-binary-directory-to-get-myapp-chm-help-file-in-vs2013/2128 "2019-08-07T13:28:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Armando](https://discourse.itk.org/user_avatar/discourse.itk.org/armando/32/449_2.png) [@Armando](https://discourse.itk.org/u/Armando)\
**Post date:** [August 7, 2019, 1:28pm UTC](https://discourse.itk.org/t/how-to-include-help-files-htmldefines-h-myapp-hhc-myapp-hhk-myapp-hhp-in-the-binary-directory-to-get-myapp-chm-help-file-in-vs2013/2128/1 "2019-08-07T13:28:53Z")

</div>

Hi.

I have a project in VS2013 and I want to include ITK and VTK libraries using CMake. I configured my CMakeList.txt to include the files of source code of my application. But, I do not know how to make compile the help file for the User Manual of my application.

First - this is my environment:

- OS: Windows 10 Pro x64
- IDE: Visual Studio 2013 Ultimate
- Cmake: 3.14.6 version x64
- ITK: 4.13.2 version
- VTK: 8.1.0 version
- MyApp: It is a MFC application

Second - [CMakeLists.txt](https://discourse.itk.org/uploads/short-url/oiUx7Msfl6YjbeMhvPMSJshDjxH.txt) (1.0 KB) my CMakeLists.txt

Third - this my problem:

- Configuration and Generation in CMake: No problem.
- Compiling my project in VS2013: No problem
- Compiling the help file (MyApp.chm): Not compiled \<== This is my problem

In the source directory the help file compile together with my application correctly. But, when I use CMake to include ITK and VTK libraries in my project and I compile it after in the binary directory, the help file is absent. I know this not an error of CMake, this is because I do not know how to make it. For that reason I ask you for some help.

Thanks in advanced.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [August 7, 2019, 1:44pm UTC](https://discourse.itk.org/t/how-to-include-help-files-htmldefines-h-myapp-hhc-myapp-hhk-myapp-hhp-in-the-binary-directory-to-get-myapp-chm-help-file-in-vs2013/2128/2 "2019-08-07T13:44:23Z")

</div>

Your top-level `CMakeLists.txt` is simple enough, but it says nothing about help file. If you share `CMakeLists.txt` from hlp folder, we might be able to offer more help.

But I expect that you will need to add a [custom build step](https://stackoverflow.com/questions/18427877/add-custom-build-step-in-cmake) to build your help file.

---

<div class="post-metadata">

**Author:** ![Armando](https://discourse.itk.org/user_avatar/discourse.itk.org/armando/32/449_2.png) [@Armando](https://discourse.itk.org/u/Armando)\
**Post date:** [August 7, 2019, 2:01pm UTC](https://discourse.itk.org/t/how-to-include-help-files-htmldefines-h-myapp-hhc-myapp-hhk-myapp-hhp-in-the-binary-directory-to-get-myapp-chm-help-file-in-vs2013/2128/3 "2019-08-07T14:01:25Z")

</div>

Hi Dženan.

This is my CMakeLists.txt file from hlp directory: [CMakeLists.txt](https://discourse.itk.org/uploads/short-url/pCZ1FfKJX2825xnX9KKrH8D8COD.txt) (99 Bytes)

I found it incomplete, but I do really do not know how make it.

Thanks

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [August 7, 2019, 2:05pm UTC](https://discourse.itk.org/t/how-to-include-help-files-htmldefines-h-myapp-hhc-myapp-hhk-myapp-hhp-in-the-binary-directory-to-get-myapp-chm-help-file-in-vs2013/2128/4 "2019-08-07T14:05:30Z")

</div>

What build steps does `MyApp.chm` has in regular Visual Studio project? That’s what we need to add as the custom build step in CMake.

---

<div class="post-metadata">

**Author:** ![Armando](https://discourse.itk.org/user_avatar/discourse.itk.org/armando/32/449_2.png) [@Armando](https://discourse.itk.org/u/Armando)\
**Post date:** [August 7, 2019, 6:53pm UTC](https://discourse.itk.org/t/how-to-include-help-files-htmldefines-h-myapp-hhc-myapp-hhk-myapp-hhp-in-the-binary-directory-to-get-myapp-chm-help-file-in-vs2013/2128/5 "2019-08-07T18:53:57Z")

</div>

Hi.

In the original MyApp.vcxproj appears the following:  
[MyApp.vcxproj.txt](https://discourse.itk.org/uploads/short-url/aaD5NO8mnPfrQTOPDadJGoJ5IZK.txt) (3.2 KB)

Then in MyApp.vcxproj generated with CMake does not appears nothing about.

How can I make it with CMakeLists.txt files?

Thanks

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [August 7, 2019, 9:28pm UTC](https://discourse.itk.org/t/how-to-include-help-files-htmldefines-h-myapp-hhc-myapp-hhk-myapp-hhp-in-the-binary-directory-to-get-myapp-chm-help-file-in-vs2013/2128/6 "2019-08-07T21:28:24Z")

</div>

So this is the build script which generates `hlp\HTMLDefines.h`:

```auto
echo // Generated Help Map file. Used by Stassis.HHP. > "hlp\HTMLDefines.h"
echo. > "hlp\HTMLDefines.h"
echo // Commands (ID_* and IDM_*) >> "hlp\HTMLDefines.h"
makehm /h ID_,HID_,0x10000 IDM_,HIDM_,0x10000 "$(InputFileName)" >> "hlp\HTMLDefines.h"
echo. >> "hlp\HTMLDefines.h"
echo // Prompts (IDP_*) >> "hlp\HTMLDefines.h"
makehm /h IDP_,HIDP_,0x30000 "$(InputFileName)" >> "hlp\HTMLDefines.h"
echo. >> "hlp\HTMLDefines.h"
echo // Resources (IDR_*) >> "hlp\HTMLDefines.h"
makehm /h IDR_,HIDR_,0x20000 "$(InputFileName)" >> "hlp\HTMLDefines.h"
echo. >> "hlp\HTMLDefines.h"
echo // Dialogs (IDD_*) >> "hlp\HTMLDefines.h"
makehm /h IDD_,HIDD_,0x20000 "$(InputFileName)" >> "hlp\HTMLDefines.h"
echo. >> "hlp\HTMLDefines.h"
echo // Frame Controls (IDW_*) >> "hlp\HTMLDefines.h"
makehm /h /a afxhh.h IDW_,HIDW_,0x50000 "$(InputFileName)" >> "hlp\HTMLDefines.h"

```

What is the `$(InputFileName)` for this script? This could be turned into a batch file to be invoked by CMake via custom build step.

Also, there should be additional steps to process files from `Help_SRCS` list (HTMLDefines.h, Stassis.hhc, Stassis.hhk, Stassis.hhp) and produce `MyApp.chm`. I don’t know what those steps should be, as I have not created `.chm` help files.

And this is more of a question for [CMake mailing list](https://cmake.org/mailing-lists/), as it has very little to do with ITK.
