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 03-24-2011, 08:50 AM   #1
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
CMake Question


I have a CMake project with two subdirectories: one with the sources for a shared lib and the other with sources for an executable (which depends on the shared lib).

The problem is that the shared lib has a file called "common.h.in", which is converted to "common.h" in the build directory by CMake. This is fine, but when the executable includes a header file from the shared lib that includes common.h, it fails to compile because common.h isn't there.

What should I do?

Form the shared lib's CMakeLists.txt:
Code:
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/common.h.in
	${CMAKE_CURRENT_BINARY_DIR}/common.h)
include_directories ("${CMAKE_CURRENT_BINARY_DIR}")
 
Old 03-25-2011, 10:11 AM   #2
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
Do you see any path setting for the libraries when executing:
Code:
$ ccmake .
 
Old 03-25-2011, 12:51 PM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by Reuti View Post
Do you see any path setting for the libraries when executing:
Code:
$ ccmake .
I don't understand.
 
Old 03-25-2011, 12:56 PM   #4
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
ccmake (double c is not a typo) should open a configuration window, where you can setup some things like the final path of the build and so on. Maybe a path to a library is also provided there by the source in question.
 
Old 03-25-2011, 01:22 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The manual : man ccmake


http://linux.die.net/man/1/ccmake
 
  


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
CMake Question MTK358 Programming 7 01-15-2011 10:27 AM
cmake: Using find_package(Boost) when FindBoost.cmake is not in the default location damien_d Programming 3 10-27-2010 03:40 PM
[SOLVED] Cmake error ~sHyLoCk~ Slackware 10 12-07-2009 01:00 PM
KDE, Phonon, and CMake ryerke Slackware 11 11-18-2009 08:42 PM
cmake question yfaye Programming 3 04-09-2009 09:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:00 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration