cmake trouble

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

cmake trouble

张峰
Hello:
      I am using cmake for three months now.
but was trouble in a situation 。for details bellow: (in Windows)
 
ADD_LIBRARY(test SHARED  ${LIBTEST_SRC} ${LIBHELLO_SRC})
#ADD_LIBRARY(test STATIC ${LIBTEST_SRC} ${LIBHELLO_SRC})

#add executable
AUX_SOURCE_DIRECTORY(. FAN_SRC)
TARGET_LINK_LIBRARIES(fan test)
ADD_EXECUTABLE(fan ${FAN_SRC})
 
1.if i put "TARGET_LINK_LIBRARIES(fan test)" before ADD_EXECUTABLE command,this does not work ,why??
 
2. but if i  ADD_LIBRARY(test STATIC ${LIBTEST_SRC} ${LIBHELLO_SRC}) ,it is  ok,why ??
 
3.if i put "TARGET_LINK_LIBRARIES(fan test)" after ADD_EXECUTABLE command,it works ,why ??
 
I am waiting for your help !!
 
<a href="app:lj:%E6%AD%A4%E8%87%B4%E6%95%AC%E7%A4%BC?ljtype=blng&amp;ljblngcont=0&amp;ljtran=With best wishes." target="_self">With best wishes.
 
 
 



--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake trouble

Eric Clark

Hello,

 

First off, you cannot call both add_executable and add_library in the same CMakeLists file. Here is what I can say about your other questions:

 

1.       All commands that require a target have to come after you have created the target via add_executable or add_library. This is simply because you need to have a target before you can adds things to it.

2.       I am not real sure why this would work. But, for common practices, you should always call target_link_libraries after your call to add_library or add_executable for the reason stated above.

3.       Again, this is the same answer. It will work as long as you make the call to the command after add_library or add_executable.

 

Hope this helps.

Eric

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of ??
Sent: Monday, October 22, 2012 10:25 AM
To: [hidden email]
Subject: [CMake] cmake trouble

 

Hello:

      I am using cmake for three months now.

but was trouble in a situation for details bellow: (in Windows)

 

ADD_LIBRARY(test SHARED  ${LIBTEST_SRC} ${LIBHELLO_SRC})
#ADD_LIBRARY(test STATIC ${LIBTEST_SRC} ${LIBHELLO_SRC})


#add executable
AUX_SOURCE_DIRECTORY(. FAN_SRC)

TARGET_LINK_LIBRARIES(fan test)
ADD_EXECUTABLE(fan ${FAN_SRC})

 

1.if i put "TARGET_LINK_LIBRARIES(fan test)" before ADD_EXECUTABLE command,this does not work ,why??

 

2. but if i  ADD_LIBRARY(test STATIC ${LIBTEST_SRC} ${LIBHELLO_SRC}) it is  okwhy ??

 

3.if i put "TARGET_LINK_LIBRARIES(fan test)" after ADD_EXECUTABLE commandit works ,why ??

 

I am waiting for your help !!

 

<a href="app:lj:%E6%AD%A4%E8%87%B4%E6%95%AC%E7%A4%BC?ljtype=blng&amp;ljblngcont=0&amp;ljtran=With%20best%20%20wishes." target="_self">With best wishes.

 

 

 

 


--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake trouble

Rolf Eike Beer
Eric Clark wrote:
> Hello,
>
> First off, you cannot call both add_executable and add_library in the same
> CMakeLists file. Here is what I can say about your other questions:

Of course you can.

> 1.       All commands that require a target have to come after you have
> created the target via add_executable or add_library. This is simply
> because you need to have a target before you can adds things to it.
 
That is indeed correct.

Eike

--

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: cmake trouble

Andreas Pakulat-2
In reply to this post by Eric Clark
Hi,

On Mon, Oct 22, 2012 at 6:04 PM, Eric Clark <[hidden email]> wrote:
>
> First off, you cannot call both add_executable and add_library in the same
> CMakeLists file.

I think there's something missing here, but its perfectly possible to
have one or more library and executable targets specified in the same
cmake file. So this works just fine:

add_library(foo bar.cpp)
add_executable(bar foo.cpp)

There are build-systems that have such limitations, but cmake is not one.

Andreas
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake trouble

Eric Clark
In reply to this post by Rolf Eike Beer
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Rolf Eike Beer
> Sent: Monday, October 22, 2012 12:11 PM
> To: [hidden email]
> Subject: Re: [CMake] cmake trouble
>
> Eric Clark wrote:
> > Hello,
> >
> > First off, you cannot call both add_executable and add_library in the
> > same CMakeLists file. Here is what I can say about your other questions:
>
> Of course you can.

Yes, but only if you call project() twice, correct? Maybe I should have been more specific. What I meant was that you cannot create two targets for the same project (i.e you cannot build an executable and a dll in the same project). In the code that was posted, there was no call to project between the call to add_library and add_executable. Certainly there is nothing wrong with calling project more than once in a list file, but I have found that it is a rare case that you want to do this... This could be just my experience, but I can only speak for what I know.

I should have been more specific, but if you are going to say "of course you can", you should probably also explain that this means you need two calls to project() as well because the code that was posted did not have two calls to project as far as what he posted...

Please, feel free to correct me if I am wrong here... But, I tried this once and it did not work and after seeing what I had done, it didn't make sense either...

Thanks,
Eric

>
> > 1.       All commands that require a target have to come after you have
> > created the target via add_executable or add_library. This is simply
> > because you need to have a target before you can adds things to it.
>
> That is indeed correct.
>
> Eike
>
> --
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake trouble

Eric Clark
In reply to this post by Andreas Pakulat-2
Andreas,

I just replied to a message from another gentleman on here and I may be way off base. But, I tried to do this once and it did not work. The only way that I could get it to work was to add another project() call between the two... I could have had some other issues because it has been quite a while since I had this problem and I do not remember the specific error that I got, so I am by no means saying anyone is wrong because I am sure that many of you are way more familiar with CMake than I am, this is a learning experience for me as well. I was just trying to help the guy out and when I looked at his original posting I saw "test" as the same name being passed to add_executable and add_library... I went back to look at the code again and he did have one called "test" and the other called "fan" that was my mistake and my misreading it.

My apologies for saying the wrong thing, I was only trying to help...

Eric

> -----Original Message-----
> From: Andreas Pakulat [mailto:[hidden email]]
> Sent: Monday, October 22, 2012 12:17 PM
> To: Eric Clark
> Cc: 张峰; [hidden email]
> Subject: Re: [CMake] cmake trouble
>
> Hi,
>
> On Mon, Oct 22, 2012 at 6:04 PM, Eric Clark <[hidden email]> wrote:
> >
> > First off, you cannot call both add_executable and add_library in the
> > same CMakeLists file.
>
> I think there's something missing here, but its perfectly possible to have one
> or more library and executable targets specified in the same cmake file. So
> this works just fine:
>
> add_library(foo bar.cpp)
> add_executable(bar foo.cpp)
>
> There are build-systems that have such limitations, but cmake is not one.
>
> Andreas
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake trouble

Eric Clark
In reply to this post by Andreas Pakulat-2
> -----Original Message-----
> From: Andreas Pakulat [mailto:[hidden email]]
> Sent: Monday, October 22, 2012 12:17 PM
> To: Eric Clark
> Cc: 张峰; [hidden email]
> Subject: Re: [CMake] cmake trouble
>
> Hi,
>
> On Mon, Oct 22, 2012 at 6:04 PM, Eric Clark <[hidden email]> wrote:
> >
> > First off, you cannot call both add_executable and add_library in the
> > same CMakeLists file.
>
> I think there's something missing here, but its perfectly possible to have one
> or more library and executable targets specified in the same cmake file. So
> this works just fine:
>
> add_library(foo bar.cpp)
> add_executable(bar foo.cpp)

Sorry, me again, but I have a question... If I do use the above code using a Visual Studio generator, will this create to separate projects in Visual Studio?

>
> There are build-systems that have such limitations, but cmake is not one.

>
> Andreas
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake trouble

Rolf Eike Beer
Eric Clark wrote:
> > From: Andreas Pakulat [mailto:[hidden email]]
> > On Mon, Oct 22, 2012 at 6:04 PM, Eric Clark <[hidden email]> wrote:

> > > First off, you cannot call both add_executable and add_library in the
> > > same CMakeLists file.
> >
> > I think there's something missing here, but its perfectly possible to have
> > one or more library and executable targets specified in the same cmake
> > file. So this works just fine:
> >
> > add_library(foo bar.cpp)
> > add_executable(bar foo.cpp)
>
>
> Sorry, me again, but I have a question... If I do use the above code using a
> Visual Studio generator, will this create to separate projects in Visual
> Studio?
You will have one solution file, but 2 projects in it.

Eike
--

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: cmake trouble

Rolf Eike Beer
In reply to this post by Eric Clark
Eric Clark wrote:
> > Eric Clark wrote:
> > > Hello,
> > >
> > > First off, you cannot call both add_executable and add_library in the
> >
> > > same CMakeLists file. Here is what I can say about your other questions:
> > Of course you can.
>
> Yes, but only if you call project() twice, correct?

No, even if you don't call project at all (but you need to call project() in a
higher level CMakeLists.txt then).

> Maybe I should have been
> more specific. What I meant was that you cannot create two targets for the
> same project (i.e you cannot build an executable and a dll in the same
> project). In the code that was posted, there was no call to project between
> the call to add_library and add_executable. Certainly there is nothing
> wrong with calling project more than once in a list file, but I have found
> that it is a rare case that you want to do this... This could be just my
> experience, but I can only speak for what I know.

The only thing that does not work then is the projectname_SOURCE_DIR variable
that is set by CMake when you call project(). But otherwise everything is
fine.

Eike
--

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: cmake trouble

Eric Clark
In reply to this post by Rolf Eike Beer
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Rolf Eike Beer
> Sent: Monday, October 22, 2012 12:48 PM
> To: [hidden email]
> Subject: Re: [CMake] cmake trouble
>
> Eric Clark wrote:
> > > From: Andreas Pakulat [mailto:[hidden email]] On Mon, Oct 22, 2012 at
> > > 6:04 PM, Eric Clark <[hidden email]> wrote:
>
> > > > First off, you cannot call both add_executable and add_library in
> > > > the same CMakeLists file.
> > >
> > > I think there's something missing here, but its perfectly possible
> > > to have one or more library and executable targets specified in the
> > > same cmake file. So this works just fine:
> > >
> > > add_library(foo bar.cpp)
> > > add_executable(bar foo.cpp)
> >
> >
> > Sorry, me again, but I have a question... If I do use the above code
> > using a Visual Studio generator, will this create to separate projects
> > in Visual Studio?
>
> You will have one solution file, but 2 projects in it.

Thank you Eike! Forgive my ignorance here... but what will it use to name the two projects?

>
> Eike
> --
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: cmake trouble

Rolf Eike Beer
Eric Clark wrote:

> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]] On
> > Behalf Of Rolf Eike Beer
> > Sent: Monday, October 22, 2012 12:48 PM
> > To: [hidden email]
> > Subject: Re: [CMake] cmake trouble
> >
> > Eric Clark wrote:
> > > > From: Andreas Pakulat [mailto:[hidden email]] On Mon, Oct 22, 2012 at
> > > >
> > > > 6:04 PM, Eric Clark <[hidden email]> wrote:
> > > > > First off, you cannot call both add_executable and add_library in
> > > > > the same CMakeLists file.
> > > >
> > > > I think there's something missing here, but its perfectly possible
> > > > to have one or more library and executable targets specified in the
> > > > same cmake file. So this works just fine:
> > > >
> > > > add_library(foo bar.cpp)
> > > > add_executable(bar foo.cpp)
> > >
> > > Sorry, me again, but I have a question... If I do use the above code
> > > using a Visual Studio generator, will this create to separate projects
> > > in Visual Studio?
> >
> > You will have one solution file, but 2 projects in it.
>
> Thank you Eike! Forgive my ignorance here... but what will it use to name
> the two projects?
The name of the target, i.e. the first argument to add_library() and
add_executable().

Eike
--

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: cmake trouble

Eric Clark
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Rolf Eike Beer
> Sent: Monday, October 22, 2012 12:51 PM
> To: [hidden email]
> Subject: Re: [CMake] cmake trouble
>
> Eric Clark wrote:
> > > -----Original Message-----
> > > From: [hidden email] [mailto:[hidden email]]
> On
> > > Behalf Of Rolf Eike Beer
> > > Sent: Monday, October 22, 2012 12:48 PM
> > > To: [hidden email]
> > > Subject: Re: [CMake] cmake trouble
> > >
> > > Eric Clark wrote:
> > > > > From: Andreas Pakulat [mailto:[hidden email]] On Mon, Oct 22, 2012
> > > > > at
> > > > >
> > > > > 6:04 PM, Eric Clark <[hidden email]> wrote:
> > > > > > First off, you cannot call both add_executable and add_library
> > > > > > in the same CMakeLists file.
> > > > >
> > > > > I think there's something missing here, but its perfectly
> > > > > possible to have one or more library and executable targets
> > > > > specified in the same cmake file. So this works just fine:
> > > > >
> > > > > add_library(foo bar.cpp)
> > > > > add_executable(bar foo.cpp)
> > > >
> > > > Sorry, me again, but I have a question... If I do use the above
> > > > code using a Visual Studio generator, will this create to separate
> > > > projects in Visual Studio?
> > >
> > > You will have one solution file, but 2 projects in it.
> >
> > Thank you Eike! Forgive my ignorance here... but what will it use to
> > name the two projects?
>
> The name of the target, i.e. the first argument to add_library() and
> add_executable().

Awesome! Thank you for the answers and the quick reply! I have only been using CMake for a little over a year and again I am sorry for posting an incorrect answer. I always thought that I had to have one project() call for each add_executable and/or add_library. It is very good to know that that is not the case. However, I am curious if you think it is good practice to do such a thing?

>
> Eike
> --
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

CMake-based build systems that are useful for study purposes?

Alan W. Irwin
On 2012-10-22 17:55-0000 Eric Clark wrote:

> Awesome! Thank you for the answers and the quick reply! I have only
been using CMake for a little over a year and again I am sorry for
posting an incorrect answer. I always thought that I had to have one
project() call for each add_executable and/or add_library. It is very
good to know that that is not the case. However, I am curious if you
think it is good practice to do such a thing?

To join this conversation late, but to give it a new twist with a new
subject line it is typical practice to have one project() call (done
in the top-level CMakeLists.txt file) for each software project (e.g.,
a complete source tree that is typically distributed as an independent
tarball) no matter how many libraries and executables are built for
that project.

When I first learned CMake years ago I looked at a number of projects
with CMake-based build systems to see what was typical usage, and I
suggest you might want to do the same.

I used to advocate studying the CMake-based build system for PLplot
that I helped to implement, but that was essentially done so many
years ago (although it is still maintained extensively) that I am sure
there are much better best practices out there now especially
considering all the additional useful CMake features that have been
introduced over the years.

I initially did a lot of my learning based on the CMake-based build
systems for CMake itself and also for KDE so one of those might be
worthy studying now, but they also might have the same problem (too
many years of history without necessarily keeping up with best
practices) that PLplot does.

Are the CMake and KDE build systems still the best paradigms for study
or are there better ones for study that can be recommended now?

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMake-based build systems that are useful for study purposes?

Eric Clark
Alan,

Thank you for such a detailed response. I am pretty new to this mailing list and have only responded to a few questions on here, but I have really thought the responsiveness on here is the best of any of the message boards that I belong to and I really appreciate it, so I like to give back as well.

Anyway, the project that I work on is not your typical application.  It is a framework and a couple of applications built off of the framework. Each of the applications have a pluggable interface that outside organizations use to build their own plugins/modules that work together to form the End-User Application. We do not actually develop for users, we develop for developers. So, I may be way off base, but when developing this I decided to follow a structure like below:

------------  src/CMakeLists.txt

project(OurFramework)

add_subdirectory(CoreModule1)
add_subdirectory(CoreModule2)
add_subdirectory(CoreModule3)
add_subdirectory(CoreModule4)

------------- End File

And then in each of the core module's directory, they would have their own list file like so:

-------------  src/CoreModule1/CMakeLists.txt

project(CoreModule1)

include(CommonConfigurationFile)

... # Add the files here and the stuff specific to this module.

-------------- End File

The above is how the core framework is structured. The pluggable applications have a similar structure except that the top-level is not necessarily all of the plugins/modules for the entire application, it may be just a subset. There are ~100 plugins that we develop internally and who knows how many externally.

I would love your opinion on what I have done here. Since this being developed for developers, it is always nice to get the developer's (our end-user's) perspective. Do you think I am missing the purpose of the project() command all together?

Thanks,
Eric

> -----Original Message-----
> From: Alan W. Irwin [mailto:[hidden email]]
> Sent: Monday, October 22, 2012 1:58 PM
> To: Eric Clark
> Cc: Rolf Eike Beer; [hidden email]
> Subject: CMake-based build systems that are useful for study purposes?
>
> On 2012-10-22 17:55-0000 Eric Clark wrote:
>
> > Awesome! Thank you for the answers and the quick reply! I have only
> been using CMake for a little over a year and again I am sorry for posting an
> incorrect answer. I always thought that I had to have one
> project() call for each add_executable and/or add_library. It is very good to
> know that that is not the case. However, I am curious if you think it is good
> practice to do such a thing?
>
> To join this conversation late, but to give it a new twist with a new subject
> line it is typical practice to have one project() call (done in the top-level
> CMakeLists.txt file) for each software project (e.g., a complete source tree
> that is typically distributed as an independent
> tarball) no matter how many libraries and executables are built for that
> project.
>
> When I first learned CMake years ago I looked at a number of projects with
> CMake-based build systems to see what was typical usage, and I suggest you
> might want to do the same.
>
> I used to advocate studying the CMake-based build system for PLplot that I
> helped to implement, but that was essentially done so many years ago
> (although it is still maintained extensively) that I am sure there are much
> better best practices out there now especially considering all the additional
> useful CMake features that have been introduced over the years.
>
> I initially did a lot of my learning based on the CMake-based build systems for
> CMake itself and also for KDE so one of those might be worthy studying now,
> but they also might have the same problem (too many years of history
> without necessarily keeping up with best
> practices) that PLplot does.
>
> Are the CMake and KDE build systems still the best paradigms for study or
> are there better ones for study that can be recommended now?
>
> Alan
> __________________________
> Alan W. Irwin
>
> Astronomical research affiliation with Department of Physics and Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
>
> Programming affiliations with the FreeEOS equation-of-state implementation
> for stellar interiors (freeeos.sf.net); the Time Ephemerides project
> (timeephem.sf.net); PLplot scientific plotting software package
> (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links
> project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net).
> __________________________
>
> Linux-powered Science
> __________________________
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMake-based build systems that are useful for study purposes?

Alan W. Irwin
On 2012-10-22 20:25-0000 Eric Clark wrote:

> I would love your opinion on what I have done here. Since this being
developed for developers, it is always nice to get the developer's
(our end-user's) perspective. Do you think I am missing the purpose of
the project() command all together?

I am out of my depth here because I have never worked with such a
complex collection of projects such as yours.  As a general rule,
though (as others have said previously) there are no limits to the
amount and kind of software you can build and test under one project
command.  That said, when a project gets too big, it might be useful
to split it up into semi-independent units (with one project command
each) that can be built separately.  I do that myself for two separate
software projects that are part of the overall Time Ephemerides
project.  The first one of those (ephcom) can stand on its own.  It
builds several different C libraries, utilities that depend on those
libraries, and both Fortran and Python bindings for those C libraries
(all under on project command). The second one of those projects
(te_gen) builds a te_gen Fortran library that depends on the ephcom
Fortran bindings library.  It also builds quite a few Fortran
applications that depend on the te_gen Fortran library.  All this is
under a second project command.

So right now I build, test, and install ephcom by hand then do the
same thing for te_gen by hand (with an automatic check in that build
system that the installed ephcom can be found).  I know there is a way
under CMake to automate the build of both the ephcom and te_gen
projects from one overall hypothetical "Time Ephemerides" parent
project.  I haven't looked further into such a possibility because
only two projects are involved, but if you have a lot of different
projects with an "interesting" dependency graph between them, I think
automation of the build of each of your projects would be essential.

I hope those general ideas help, but I also hope others with more
expertise at multi-project software will comment further if I have
made some mistakes describing what is possible with the project
command.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake