# Error while configuring itk example with vcpkg

**URL:** https://discourse.itk.org/t/error-while-configuring-itk-example-with-vcpkg/4672
**Category:** Uncategorized
**Tags:** itk, vcpkg, configure
**Created:** [December 14, 2021, 5:17pm UTC](https://discourse.itk.org/t/error-while-configuring-itk-example-with-vcpkg/4672 "2021-12-14T17:17:39Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![priyanka](https://discourse.itk.org/user_avatar/discourse.itk.org/priyanka/32/2399_2.png) [@priyanka](https://discourse.itk.org/u/priyanka)
#### Post date: [December 14, 2021, 5:17pm UTC](https://discourse.itk.org/t/error-while-configuring-itk-example-with-vcpkg/4672/1 "2021-12-14T17:17:39Z")

</div>

Please see the image below for the error I’m facing.

 ![image](https://discourse.itk.org/uploads/default/original/2X/8/80a1df37beadb4d4c5d5fa95d76c5ee9b23a0b90.png)

---

<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: [December 14, 2021, 7:30pm UTC](https://discourse.itk.org/t/error-while-configuring-itk-example-with-vcpkg/4672/2 "2021-12-14T19:30:20Z")

</div>

What is the content of `ITKDoubleConversion.cmake`?

And what are you trying to do? Configure your own project by pointing it at ITK in `vcpkg` or something else?

Also, in the future please copy-paste the text using [preformatted text](https://meta.discourse.org/t/how-to-post-code-or-preformatted-text/188910) instead of a screenshot. Text can be searched and copy-pasted easily.

---

<div class="post-metadata">

### Author: ![priyanka](https://discourse.itk.org/user_avatar/discourse.itk.org/priyanka/32/2399_2.png) [@priyanka](https://discourse.itk.org/u/priyanka)
#### Post date: [December 15, 2021, 6:13am UTC](https://discourse.itk.org/t/error-while-configuring-itk-example-with-vcpkg/4672/3 "2021-12-15T06:13:45Z")

</div>

```auto
CMake Error at /home/devops/PackageManager/vcpkg/installed/x64-linux/share/itk/Modules/ITKDoubleConversion.cmake:1:
  Parse error. Expected a newline, got identifier with text "set".
Call Stack (most recent call first):
  /home/devops/PackageManager/vcpkg/installed/x64-linux/share/itk/ITKModuleAPI.cmake:76 (include)
  /home/devops/PackageManager/vcpkg/installed/x64-linux/share/itk/ITKModuleAPI.cmake:31 (itk_module_load)
  /home/devops/PackageManager/vcpkg/installed/x64-linux/share/itk/ITKModuleAPI.cmake:129 (_itk_module_config_recurse)
  /home/devops/PackageManager/vcpkg/installed/x64-linux/share/itk/ITKConfig.cmake:81 (itk_module_config)
  /home/devops/PackageManager/vcpkg/scripts/buildsystems/vcpkg.cmake:788 (_find_package)
  CMakeLists.txt:5 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/devops/Example/circle/build/CMakeFiles/CMakeOutput.log".`Preformatted text`

```

While trying to configure an itk example using vcpkg, I’m getting this error in Linux.

---

<div class="post-metadata">

### Author: ![priyanka](https://discourse.itk.org/user_avatar/discourse.itk.org/priyanka/32/2399_2.png) [@priyanka](https://discourse.itk.org/u/priyanka)
#### Post date: [December 15, 2021, 6:16am UTC](https://discourse.itk.org/t/error-while-configuring-itk-example-with-vcpkg/4672/4 "2021-12-15T06:16:28Z")

</div>

```auto
get_filename_component(VCPKG_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)set(ITKDoubleConversion_LOADED 1)
set(ITKDoubleConversion_ENABLE_SHARED "0")
set(ITKDoubleConversion_DEPENDS "")
set(ITKDoubleConversion_PUBLIC_DEPENDS "")
set(ITKDoubleConversion_TRANSITIVE_DEPENDS "")
set(ITKDoubleConversion_PRIVATE_DEPENDS "")
set(ITKDoubleConversion_LIBRARIES "optimized;${VCPKG_IMPORT_PREFIX}/lib/libdouble-conversion.a;debug;${VCPKG_IMPORT_PREFIX}/debug/lib/libdouble-conversion.a")
set(ITKDoubleConversion_INCLUDE_DIRS "${ITK_INSTALL_PREFIX}/include/ITK-5.1")
set(ITKDoubleConversion_LIBRARY_DIRS "")
set(ITKDoubleConversion_RUNTIME_LIBRARY_DIRS "${ITK_INSTALL_PREFIX}/lib")
set(ITKDoubleConversion_TARGETS_FILE "")
set(ITKDoubleConversion_FACTORY_NAMES "")

```

It is the content of ITKDoubleConversion.cmake

---

<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: [December 15, 2021, 2:45pm UTC](https://discourse.itk.org/t/error-while-configuring-itk-example-with-vcpkg/4672/5 "2021-12-15T14:45:39Z")

</div>

Something went wrong when generating `ITKDoubleConversion.cmake`. There should have been a new line before the second command in the first line (`set(ITKDoubleConversion_LOADED 1`). This is one of my local `ITKDoubleConversion.cmake`:

```auto
set(ITKDoubleConversion_LOADED 1)
set(ITKDoubleConversion_ENABLE_SHARED "0")
set(ITKDoubleConversion_DEPENDS "")
set(ITKDoubleConversion_PUBLIC_DEPENDS "")
set(ITKDoubleConversion_TRANSITIVE_DEPENDS "")
set(ITKDoubleConversion_PRIVATE_DEPENDS "")
set(ITKDoubleConversion_LIBRARIES "itkdouble-conversion")
set(ITKDoubleConversion_INCLUDE_DIRS "C:/Dev/ITK-git/Modules/ThirdParty/DoubleConversion/src;C:/Dev/ITK-vs19/Modules/ThirdParty/DoubleConversion/src/double-conversion")
set(ITKDoubleConversion_LIBRARY_DIRS "")
set(ITKDoubleConversion_RUNTIME_LIBRARY_DIRS "C:/Dev/ITK-vs19/bin")
set(ITKDoubleConversion_TARGETS_FILE "")
set(ITKDoubleConversion_FACTORY_NAMES "")

```

I guess [`vcpkg`'s port of ITK](https://github.com/microsoft/vcpkg/tree/master/ports/itk) is the source of the problem.

First, try updating vcpkg, then update the ports. If that does not resolve the problem, submit an issue at vcpkg, as this one is [not listed yet](https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+itk).

---

<div class="post-metadata">

### Author: ![priyanka](https://discourse.itk.org/user_avatar/discourse.itk.org/priyanka/32/2399_2.png) [@priyanka](https://discourse.itk.org/u/priyanka)
#### Post date: [December 17, 2021, 6:54am UTC](https://discourse.itk.org/t/error-while-configuring-itk-example-with-vcpkg/4672/6 "2021-12-17T06:54:32Z")

</div>

Thank you for the reply.  
It worked when I changed this ‘ITKDoubleConversion.cmake’ file.
