[Rtk-users] problem with cmake

Andreas Andersen andreasga22 at gmail.com
Mon May 25 02:47:07 EDT 2020


It should not be necessary to set `Gengetopt_DIR`

I think what you actually need is to have a `find_package(ITK REQUIRED)`
before your `find_package(Gengetopt REQUIRED)` (and you'll need ITK for RTK
anyway)

Reading "FindGengetopt.cmake" from ITK, I can see it defines the `WRAP_GGO`
macro. So we just want to trigger this Find script.
(I'm unsure if it's also necessary to have `include(${ITK_USE_FILE})`
before `find_package(Gengetopt REQUIRED)`, but it might be)

So I would recommend something like:
```
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)

project(rtkprojectgeometricphantom)

find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

find_package(Gengetopt REQUIRED)
```

/Andreas

__________________________________

Andreas Gravgaard Andersen

Danish Center for Particle Therapy,

Aarhus University Hospital

Palle Juul-Jensens Blvd. 99,

8200, Aarhus

Mail:     agravgaard at protonmail.com

Cell:      +45 3165 8140


On Mon, 25 May 2020 at 03:10, 나윤호 <yoonho94.na at gmail.com> wrote:

> Hi I'm trying to build just one cxx file
> specifically rtkprojectgeometricphantom.cxx
>
> I copied rtkprojectgeometricphantom.cxx, rtkprojectgeometricphantom.cxx,
> CMakeLists.txt to new directory.
>
> and in CMakeLists.txt,  I added three lines
>
> cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
>> find_package(Gengetopt REQUIRED)
>> project(rtkprojectgeometricphantom)
>
>
> here is an error message.
>
>  CMake Error at CMakeLists.txt:3 (find_package):
>
> By not providing "FindGengetopt.cmake" in CMAKE_MODULE_PATH this project
> has asked CMake to find a package configuration file provided by
> "Gengetopt", but CMake did not find one.
>
> Could not find a package configuration file provided by "Gengetopt" with
> any of the following names:
>
> GengetoptConfig.cmake
> gengetopt-config.cmake
>
> Add the installation prefix of "Gengetopt" to CMAKE_PREFIX_PATH or set
> "Gengetopt_DIR" to a directory containing one of the above files. If
> "Gengetopt" provides a separate development package or SDK, be sure it has
> been installed.
>
> Configuring incomplete, errors occurred!
>
>
> I need to set an Gengetopt_DIR.
>
>
> at first I set the directory where rtkprojectgeometricphantom.ggo is but
> It didn't work
>
> and than I set the directory where FindGengetopt.cmake is It still didn't
> work.
>
>
> I think I need to find the directory of GengetoptConfig.cmake or
> gengetopt-config.cmake
>
>
> how can I build only one cxx file?
> _______________________________________________
> Rtk-users mailing list
> Rtk-users at public.kitware.com
> https://public.kitware.com/mailman/listinfo/rtk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/rtk-users/attachments/20200525/61aa7967/attachment.htm>


More information about the Rtk-users mailing list