[CMake] Out-of-source build - missing something simple?

Mitchell, JA John at IS JACK.MITCHELL at L-3Com.com
Wed Jan 12 13:01:16 EST 2005


Greetings;

            Well, y'know I had one problem, but I figured out what was wrong
in the middle of writing this e-mail.  So now this becomes about what I
found.

 

            I have a fairly simple project (I'm experimenting with CMake,
and trying to become proficient in order to "sell" it to the other
developers).  I'm using STATIC libs that I've already built.  The executable
is composed of only two files.  But for some reason, CMake was treating
MyProgram_SRC_OBJS and MyProgram_EXTERNAL_OBJS as if they were shared (by
putting -fPIC in there, as shown below (from CMake's resulting Makefile):

 

 

/home/jackm/My_Documents/Devel/GeoLocation/CMake/MyProgram:
$(MyProgram_SRC_OBJS) $(MyProgram_EXTERNAL_OBJS) $(MyProgram_DEPEND_LIBS)

            @echo "Building executable
/home/jackm/My_Documents/Devel/GeoLocation/CMake/MyProgram..."

            c++      -g -Wall -Wno-deprecated -Wno-trigraphs -fPIC
$(MyProgram_SRC_OBJS) $(MyProgram_EXTERNAL_OBJS)   -o
/home/jackm/My_Documents/Devel/GeoLocation/CMake/MyProgram -rdynamic
-L/home/jackm/Drive_hdb/My_Documents/Devel/CommonLib/AnyFile
-L/home/jackm/Drive_hdb/My_Documents/Devel/CommonLib/Topo
-L/home/jackm/Drive_hdb/My_Documents/Devel/CommonLib/NamedGeoid
-L/home/jackm/Drive_hdb/My_Documents/Devel/CommonLib/PMV
-L/home/jackm/My_Documents/Devel/GeoLocation/CMake -lAnyFile -lTopo
-lNamedGeoid -lPMV
-Wl,-rpath,/home/jackm/Drive_hdb/My_Documents/Devel/CommonLib/AnyFile:/home/
jackm/Drive_hdb/My_Documents/Devel/CommonLib/Topo:/home/jackm/Drive_hdb/My_D
ocuments/Devel/CommonLib/NamedGeoid:/home/jackm/Drive_hdb/My_Documents/Devel
/CommonLib/PMV:/home/jackm/My_Documents/Devel/GeoLocation/CMake 

 

 

Why would it do that?

 

 

Y'know, CMakeList.txt examples are extremely hard to come by, I've been
googling for hours (unless I were to download an unpack all of VTK or ITK).
Any chance of opening up a directory of well-annotated example CMakeList.txt
files?  

 

Best Regards;

Jack

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20050112/199a9e42/attachment.html


More information about the CMake mailing list