[ITK-users] Pointing CMake to Updated ITK Library
Matt McCormick
matt.mccormick at kitware.com
Tue Dec 2 16:20:21 EST 2014
Hi Davis,
The ITK build to use is usually selected in the CMake build
configuration (not in the source file CMakeLists.txt), by setting the
"ITK_DIR" variable. This should point to the path that has the
desired ITKConfig.cmake file.
HTH,
Matt
On Tue, Dec 2, 2014 at 3:56 PM, DVigneault <davis.vigneault at gmail.com> wrote:
> All--
>
> I'm wondering how I need to update my CMakeLists.txt file to point it to a
> particular version of ITK. I'm working on OsX. I previously had version
> 4.4.2 installed, and have recently installed 4.6.1. However, when I run
> this code...
>
> itk::Version::Pointer version = itk::Version::New();
> std::cout << version->GetITKVersion() << std::endl;
>
> ...it outputs 4.4.2. I've copied my CMakeLists.txt file below. I have
> tried changing this line...
>
> find_package(ITK REQUIRED)
>
> ...to...
>
> find_package(ITK 4.6.1 REQUIRED)
>
> ...but when I do, I get the following error:
>
> dyld: Library not loaded: /Applications/ITK/build/fftw/lib/libfftw3.3.dylib
> Referenced from: /Volumes/NO
> NAME/Chicago/example_for_jack_yao/bin/./dv-simulated_phase
> Reason: image not found
> Trace/BPT trap: 5
>
> Thanks in advance for your help!
>
> Best,
>
> --Davis
>
> # This is the root ITK CMakeLists file.
> cmake_minimum_required(VERSION 2.4)
> if(COMMAND CMAKE_POLICY)
> cmake_policy(SET CMP0003 NEW)
> endif()
>
> # This project is designed to be built outside the Insight source tree.
> project(dv-simulated_phase)
>
> # Find ITK.
> find_package(ITK REQUIRED)
> include(${ITK_USE_FILE})
>
> add_executable(dv-simulated_phase dv-simulated_phase.cxx )
>
> target_link_libraries(dv-simulated_phase ${ITK_LIBRARIES})
>
>
>
> --
> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Pointing-CMake-to-Updated-ITK-Library-tp7586653.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
More information about the Insight-users
mailing list