[CMake] CMake with cminpack, link libraries

Fabian Torres dae.wong at gmail.com
Fri Nov 25 11:02:46 EST 2011


Hi

I'm trying to use cminpack. I've downloaded cminpack 1.1.3 and configure it
with cmake to create a Xcode 3.2 project. After building the xcode project
successfully I found that it generates a debug directory which contains the
library or if the shared_libs option in cmake was on or off respectively.
The examples works fine.

Know I'm creating an Xcode project with Cmake in which I'm going to use the
cminpack function lmdif1 I attach the CMakelist.txt which I'm using. I have
no problems in generating the xcode project with CMake, but when I build
the project I get the next errors

"_dpmpar", referenced from _main ProbeClaibration.o
"_lmdif1", referenced from _main ProbeCalibration.o

Symbol(s) not found

After some research I found that it may be a problem linking the cminpack
library.I'm new using CMake and I'm not sure if I`m using the correct
method to link the cminpack libraries with
LINK_DIRECTORIES(/opt/cminpack-binary).

I wonder if you can help me figure it out. And also want to know which
library do you recomend mi to use, the static libcminpack.a lib or the
dynamic libcminpack.dlyb lib.

Thanks for your help. I`m really stuck on this and I need to solve my
problem as soon as possible.



Thanks again

-- 
Fabián Torres Robles
Maestria en Ciencias en Ingeniería Electrónica
Ingeniería en Sistemas Electrónicos
tel. 58081280, 0445534661338
e-mail fabian.trobles at gmail.com, dae.wong at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111125/52c75919/attachment.htm>
-------------- next part --------------
cmake_minimum_required(VERSION 2.6)
 
PROJECT(ProbeCalibration)
 
FIND_PACKAGE(VTK)

IF(VTK_FOUND)
	INCLUDE(${VTK_USE_FILE})
ELSE(VTK_FOUND)
	MESSAGE(FATAL_ERROR
		"VTK NOT FOUND. PLEASE SET VTK_DIR.")
ENDIF(VTK_FOUND)

FIND_PACKAGE(ITK)

IF(ITK_FOUND)
	INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
	MESSAGE(FATAL_ERROR
		"ITK NOT FOUND. PLEASE SET ITK_DIR.")
ENDIF(ITK_FOUND)

include_directories(/opt/cminpack-1.1.3 ${ProbeCalibration_SOURCE_DIR})
LINK_DIRECTORIES(/opt/cminpack-binary)
 
add_executable(ProbeCalibration ImageCrop.h itkImageToVTKImageFilter.h MyStyle.h PickPixel.h ProbeCalibration.cxx)
 
target_link_libraries(ProbeCalibration ${VTK_LIBRARIES} ${ITK_LIBRARIES})


More information about the CMake mailing list