Discussion:
[mitk-users] Linking MITK in Qt
K O ranjith
2017-04-25 11:34:59 UTC
Permalink
Hello,
I'm trying to link MITK library to my Qt (5.7.1) based project in windows.
But while building the project showing the error:

*By not providing "FindMITK.cmake" in CMAKE_MODULE_PATH this project has*

*asked CMake to find a package configuration file provided by "MITK", but*

*CMake did not find one.*

*Could not find a package configuration file provided by "MITK" (requested*

*version 2016.11) with any of the following names:*

*MITKConfig.cmake*

*mitk-config.cmake*

*Add the installation prefix of "MITK" to CMAKE_PREFIX_PATH or set*

*"MITK_DIR" to a directory containing one of the above files. If "MITK"*

*provides a separate development package or SDK, be sure it has been*

*installed.*


I have built the MITK superbuild using VS2015. Also have installed the
MITK in program files using building INSTALL project in VS2015 (But
*MITKConfig.cmake *not found in Install directory)
In the build directory *MITKConfig.cmake *file is present, so have set
the *CMAKE_PREFIX_PATH
*to the build directory.
But again the same error occurring.
CmakeList.txt file :

*cmake_minimum_required**(**VERSION* *2.8)*



*project**(untitled)*

*add_executable**(${PROJECT_NAME} "main.cpp")*

*#* *Find* *includes* *in* *corresponding* *build* *directories*

*set**(CMAKE_INCLUDE_CURRENT_DIR **ON**)*

*#* *Instruct* *CMake* *to* *run* *moc* *automatically* *when* *needed.*

*set**(CMAKE_AUTOMOC **ON**)*



*#* *Find* *the* *QtWidgets* *library*

*find_package**(Qt5Widgets)*





*find_package**(MITK 2016.11 **REQUIRED**)*


I'm new to MITK, please help to figure out the issue.
Dinkelacker, Stefan
2017-04-26 16:23:20 UTC
Permalink
Hi,


the installed MITK doesn't have this file. You need to specify the build directory instead of the install directory. There you will find this file along with all the libs and headers. Also make sure to use CMake >= 3.5.


Best,
Stefan

________________________________
Von: K O ranjith <***@gmail.com>
Gesendet: Dienstag, 25. April 2017 13:34
An: mitk-***@lists.sourceforge.net
Betreff: [mitk-users] Linking MITK in Qt

Hello,
I'm trying to link MITK library to my Qt (5.7.1) based project in windows.
But while building the project showing the error:

By not providing "FindMITK.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "MITK", but
CMake did not find one.
Could not find a package configuration file provided by "MITK" (requested
version 2016.11) with any of the following names:
MITKConfig.cmake
mitk-config.cmake
Add the installation prefix of "MITK" to CMAKE_PREFIX_PATH or set
"MITK_DIR" to a directory containing one of the above files. If "MITK"
provides a separate development package or SDK, be sure it has been
installed.

I have built the MITK superbuild using VS2015. Also have installed the MITK in program files using building INSTALL project in VS2015 (But MITKConfig.cmake not found in Install directory)
In the build directory MITKConfig.cmake file is present, so have set the CMAKE_PREFIX_PATH to the build directory.
But again the same error occurring.
CmakeList.txt file :

cmake_minimum_required(VERSION 2.8)

project(untitled)
add_executable(${PROJECT_NAME} "main.cpp")
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)

# Find the QtWidgets library
find_package(Qt5Widgets)


find_package(MITK 2016.11 REQUIRED)

I'm new to MITK, please help to figure out the issue.

Loading...