LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-07-2009, 08:53 AM   #1
yfaye
LQ Newbie
 
Registered: Apr 2009
Posts: 12

Rep: Reputation: 0
Cmake, linking libraries


Hi, here are the details of my problem. There is a project A I try to build, using the libraries of another project B. Both A and B will use boost.

Previously I use command line: gcc xx.c ... -L/path/B/lib/ -lB -ldl, which runs fine. Now I need to use cmake to compile A. How should I do it?

Thanks
 
Old 04-08-2009, 06:13 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

With a "makefile", you use "make" syntax to generate a gcc command line.

With "CMake", you'll need to re-write your script to use "CMake" syntax instead.

The "gcc" and link syntax (the "gcc -o myprog -Lmylib" stuff: the final output) remains unchanged.

Here are some resources:

http://www.cmake.org/cmake/help/examples.html
http://www.cmake.org/Wiki/CMake
http://www.vtk.org/Wiki/CMake_FAQ

Good luck .. PSM
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking libraries. Gamma_User Linux - Newbie 1 01-19-2009 05:24 PM
linking X11 libraries samqazi1 Linux - Software 2 01-04-2006 01:14 AM
Linking old libraries to new one? winterhunter Linux - Software 7 10-24-2005 04:37 AM
Linking Libraries, Dependencies Killbot_5000 Linux - Software 4 09-28-2004 08:59 AM
Shared libraries and linking., devin Programming 3 04-08-2003 03:18 PM


All times are GMT -5. The time now is 11:03 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration