Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 9th, 2012, 8:44 AM   #1
danny2000
Programmer
 
Join Date: May 2009
Posts: 85
Rep Power: 9 danny2000 is on a distinguished road
Creating a Makefile in CMAKE??

When creating a Makefile in CMAKE, where should the binaries (output) be placed?
I'm using MingW and trying to create a makefile for PODOFO (A PDF Library).

Thanks
danny2000 is offline   Reply With Quote
Old Oct 9th, 2012, 9:28 AM   #2
Ancient Dragon
Achieved Level 70

 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 4,345
Rep Power: 10 Ancient Dragon will become famous soon enoughAncient Dragon will become famous soon enough
Re: Creating a Makefile in CMAKE??

put them in the same folder as the source code for easy testing. When finished you can mode the binaries anywhere you want to as long as they are in one of the folders listed in your PATH environment variables. You could put them into a new folder and add its path to the PATH environment variable. General rule of the thumb not to put them in c:\windows or your compiler's bin folder.
__________________
PFO's FAQ is here
Forum Rules

There is no cow level (Diablo III)
If you never push yourself you will never improve (Diablo III)
Ancient Dragon is offline   Reply With Quote
Old Oct 9th, 2012, 2:40 PM   #3
sixstringartist
Programming Guru

 
Join Date: Jun 2005
Posts: 1,333
Rep Power: 14 sixstringartist will become famous soon enough
Re: Creating a Makefile in CMAKE??

typically you will create a separate directory for the build to take place and call cmake from there. e.i.

Project Dir Tree:

+project_name
    - CMakeFiles
    - include
    - lib
    - src
$ cd path/to/project_name
$ mkdir build
$ cd build
$ cmake ../
$ make -j4

I dont recommend building in the same folder as your source.
sixstringartist is offline   Reply With Quote
Old Oct 11th, 2012, 10:03 PM   #4
danny2000
Programmer
 
Join Date: May 2009
Posts: 85
Rep Power: 9 danny2000 is on a distinguished road
Re: Creating a Makefile in CMAKE??

Thanks for coming back.
I'm trying to create a makefile in CMAKE for PODOFO (PDF Library). It uses the built zlib of which I have built in a separate directory.

I get the below errors.

ZLIB_LIBRARY_DEBUG-NOTFOUND
ZLIB_LIBRARY_RELEASE-NOTFOUND

I have then tried to build a debug and release version of zlib by changing the directory to the zlib directory and running both the blow commands. The build completes without error (at least in the dos screen), but I can't see separate debug and release directories created anywhere?

I originally entered mingw32-make -f win32\Makefile.gcc into the cmd prompt and it build zlib but due to the errors I was getting I entered the below.

mingw32-make -f win32\Makefile.gcc BUILD=debug
mingw32-make -f win32\Makefile.gcc BUILD=release



Then I try to create a makefile again in CMAKE and the previous errors come back.

ZLIB_LIBRARY_DEBUG-NOTFOUND
ZLIB_LIBRARY_RELEASE-NOTFOUND


I know you can specify the directory containing the library file in the zlib directory but I'm not sure what I'm pointing at. I see a zlib1.dll. No matter which directory I point to I get the same errors. Can't see any .lib files in any zlib directory or sub directory??

Where am I going wrong here? I've downloaded and used the zlib for windows source from here.
http://gnuwin32.sourceforge.net/packages/zlib.htm

I've also attached a screenshot of my CMAKE screen. There's allot of info out there on different commands to enter into CMAKE but I can't see anywhere you can do that in this version of CMAKE. (See attachement).

Can anyone tell me where I'm going wrong. Thanks so much.
Attached Images
File Type: png CMAKE GUI...PNG (38.9 KB, 6 views)
danny2000 is offline   Reply With Quote
Old Oct 11th, 2012, 11:48 PM   #5
sixstringartist
Programming Guru

 
Join Date: Jun 2005
Posts: 1,333
Rep Power: 14 sixstringartist will become famous soon enough
Re: Creating a Makefile in CMAKE??

CMake can't find your built zlib libraries. Its possible that the cmakelists.txt of PODOFO expects zlib to be in a specific subdirectory. Also, for clarity, cmake generates the makefile, and make consumes it. If cmake fails, there's no point in calling make. See what you can find by looking at the cmakelists.txt in podofo and if I have time I'll take a look at it.
sixstringartist is offline   Reply With Quote
Old Oct 12th, 2012, 1:13 AM   #6
danny2000
Programmer
 
Join Date: May 2009
Posts: 85
Rep Power: 9 danny2000 is on a distinguished road
Re: Creating a Makefile in CMAKE??

Thanks for that.. I'm still looking myself. I'm thinking I've done something wrong in the build process. In the Podofo CmakeFind file cmake will look for a zlib1 file but I'm not sure if it should read zlib.dll file or something like that. I've provided a screenshop of my zlib directory if that helps. Maybe it will show the world what I've failed to do.. or the dumb thing I have done.

Thanks for coming back.
Attached Images
File Type: png Zlib Directory.PNG (45.8 KB, 5 views)
danny2000 is offline   Reply With Quote
Old Oct 12th, 2012, 4:23 AM   #7
danny2000
Programmer
 
Join Date: May 2009
Posts: 85
Rep Power: 9 danny2000 is on a distinguished road
Re: Creating a Makefile in CMAKE??

Well, after all that, CMAKE has generaged the makefile correctly. I had at some stage incorrectly entered a global variable for Zlib. I don't know why I did that but as soon as I deleted it the makefile built correctly.

That took forever.

Thanks for the response anyway.. that ultimately set me on the right path.

Cheers
danny2000 is offline   Reply With Quote
Old Oct 12th, 2012, 10:42 AM   #8
sixstringartist
Programming Guru

 
Join Date: Jun 2005
Posts: 1,333
Rep Power: 14 sixstringartist will become famous soon enough
Re: Creating a Makefile in CMAKE??

Glad to hear you figured it out.
sixstringartist is offline   Reply With Quote
Old Oct 17th, 2012, 9:10 AM   #9
danny2000
Programmer
 
Join Date: May 2009
Posts: 85
Rep Power: 9 danny2000 is on a distinguished road
Re: Creating a Makefile in CMAKE??

False alarm. Sorry about that.

The title of my post is wrong anyway.. I'm really trying to build a PODOFO library where zlib is one of the dependencies.

CMAKE can't find the ZLIB_LIBRARY which is really frustrating. Anyone done this before and what was the solution?

You can see all the contents of my zlib directory above if that helps.

Thanks
danny2000 is offline   Reply With Quote
Old Oct 17th, 2012, 10:03 PM   #10
sixstringartist
Programming Guru

 
Join Date: Jun 2005
Posts: 1,333
Rep Power: 14 sixstringartist will become famous soon enough
Re: Creating a Makefile in CMAKE??

Can you dump the actual build log. I dont know how to help you through a GUI. I need to see what make is actually trying to do.
sixstringartist is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with a makefile please sqrrr C++ 5 Sep 29th, 2011 6:20 PM
A Guide To GM & Creating Games Lesson 2 Trenton Other Tutorials and Articles 0 Aug 22nd, 2011 12:44 PM
makefile newbie ghostrider08 C 0 May 11th, 2011 1:40 PM
C Makefile MiniGW GTK HELP PLZ!! tomhangler C 5 Feb 2nd, 2011 9:14 PM
How do you create a project from a makefile? Duck C++ 5 Aug 24th, 2006 6:34 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:05 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC