Re: [CMake] build order

2015-12-19 Thread Owen Hogarth II
Hi David

Thank you for the response, I thought that I was doing something wrong. I
mean it's documented and I followed the docs as close as possible to write
my scripts but there's literally no mention about how to solve this
external/ internal project setup in the official docs.

I saw some things online but I honestly it seemed overly complicated and
really prone to breaking.

I'll edit my project to make them all external projects and work from that
angle.

Thanks

On Sat, Dec 19, 2015 at 9:18 PM, David Cole  wrote:

> Build the second thing as an ExternalProject, too, and use the DEPENDS
> keyword to make it build after the first thing.
>
> Don't try to mix-and-match external projects and non-external projects in
> the same CMake configure... It's just too much work to get things working
> in a reasonable cross-platform way. It's possible, but certainly not easy.
>
>
> David
>
>
> > On Dec 18, 2015, at 3:29 PM, Owen Hogarth II 
> wrote:
> >
> > If you download, compile and install a cmake project through external
> project
> >
> > How can I make sure that the external project is built before something
> that depends on that external project?
> > --
> >
> > Powered by www.kitware.com
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
> >
> > CMake Support: http://cmake.org/cmake/help/support.html
> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
> > CMake Training Courses: http://cmake.org/cmake/help/training.html
> >
> > Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] build order

2015-12-19 Thread David Cole via CMake
Build the second thing as an ExternalProject, too, and use the DEPENDS keyword 
to make it build after the first thing.

Don't try to mix-and-match external projects and non-external projects in the 
same CMake configure... It's just too much work to get things working in a 
reasonable cross-platform way. It's possible, but certainly not easy.


David


> On Dec 18, 2015, at 3:29 PM, Owen Hogarth II  wrote:
> 
> If you download, compile and install a cmake project through external project
> 
> How can I make sure that the external project is built before something that 
> depends on that external project?
> -- 
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[CMake] build order

2015-12-18 Thread Owen Hogarth II
If you download, compile and install a cmake project through external
project

How can I make sure that the external project is built before something
that depends on that external project?
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] Build order

2011-06-27 Thread Maxime Lecourt
Hello,

I'm using CMake to build OCaml libraries.
For that, I use a macro that I call in my CMakeLists.txt

As I have dependencies between my different libraries, I wrote my
CMakeLists.txt so the build happens in the right order, but when building,
libraries are built depending on alphabetical order.

add_ocaml_library(cabs SOURCES cabs.ml)
add_ocaml_library(algo SOURCES algo.ml)

(algo depends on cabs being already built)

How can I create a add_ocaml_dependencies macro ?
Or is there a way to force CMake to follow the build order in the
CMakeLists.txt ?

Regards

Maxime Lecourt
___
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

Re: [CMake] Build order

2011-06-27 Thread Michael Wild
On 06/27/2011 11:31 AM, Maxime Lecourt wrote:
 Hello,
 
 I'm using CMake to build OCaml libraries.
 For that, I use a macro that I call in my CMakeLists.txt
 
 As I have dependencies between my different libraries, I wrote my
 CMakeLists.txt so the build happens in the right order, but when
 building, libraries are built depending on alphabetical order.
 
 add_ocaml_library(cabs SOURCES cabs.ml http://cabs.ml)
 add_ocaml_library(algo SOURCES algo.ml http://algo.ml)
 
 (algo depends on cabs being already built)
 
 How can I create a add_ocaml_dependencies macro ?
 Or is there a way to force CMake to follow the build order in the
 CMakeLists.txt ?
 
 Regards
 
 Maxime Lecourt
 

Well, if cabs and algo are top-level targets (i.e. created via
add_library(), add_executable() or add_custom_target()), you can simply
call add_dependencies(algo cabs).

Michael
___
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


Re: [CMake] Build order

2011-06-27 Thread Maxime Lecourt
2011/6/27 Michael Wild them...@gmail.com

 On 06/27/2011 11:31 AM, Maxime Lecourt wrote:
  Hello,
 
  I'm using CMake to build OCaml libraries.
  For that, I use a macro that I call in my CMakeLists.txt
 
  As I have dependencies between my different libraries, I wrote my
  CMakeLists.txt so the build happens in the right order, but when
  building, libraries are built depending on alphabetical order.
 
  add_ocaml_library(cabs SOURCES cabs.ml http://cabs.ml)
  add_ocaml_library(algo SOURCES algo.ml http://algo.ml)
 
  (algo depends on cabs being already built)
 
  How can I create a add_ocaml_dependencies macro ?
  Or is there a way to force CMake to follow the build order in the
  CMakeLists.txt ?
 
  Regards
 
  Maxime Lecourt
 

 Well, if cabs and algo are top-level targets (i.e. created via
 add_library(), add_executable() or add_custom_target()), you can simply
 call add_dependencies(algo cabs).

 Michael
 ___
 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


algo and cabs are created using add_custom_command()

I tried add_dependencies(algo cabs), but it did not work.
Would it work if i create a fake target (can I force cabs and algo as
top-level targets, or as valid parameters for add_custom_target ?) ?

add_custom_target(target1 depends cabs)
add_custom_target(algo depends target1)


Or something like that.

Maxime Lecourt
___
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

Re: [CMake] Build order

2011-06-27 Thread Michael Wild
On 06/27/2011 12:00 PM, Maxime Lecourt wrote:
 
 
 2011/6/27 Michael Wild them...@gmail.com mailto:them...@gmail.com
 
 On 06/27/2011 11:31 AM, Maxime Lecourt wrote:
  Hello,
 
  I'm using CMake to build OCaml libraries.
  For that, I use a macro that I call in my CMakeLists.txt
 
  As I have dependencies between my different libraries, I wrote my
  CMakeLists.txt so the build happens in the right order, but when
  building, libraries are built depending on alphabetical order.
 
  add_ocaml_library(cabs SOURCES cabs.ml http://cabs.ml
 http://cabs.ml)
  add_ocaml_library(algo SOURCES algo.ml http://algo.ml
 http://algo.ml)
 
  (algo depends on cabs being already built)
 
  How can I create a add_ocaml_dependencies macro ?
  Or is there a way to force CMake to follow the build order in the
  CMakeLists.txt ?
 
  Regards
 
  Maxime Lecourt
 
 
 Well, if cabs and algo are top-level targets (i.e. created via
 add_library(), add_executable() or add_custom_target()), you can simply
 call add_dependencies(algo cabs).
 
 Michael
 
 
 algo and cabs are created using add_custom_command()
 
 I tried add_dependencies(algo cabs), but it did not work.
 Would it work if i create a fake target (can I force cabs and algo as
 top-level targets, or as valid parameters for add_custom_target ?) ?
 
 add_custom_target(target1 depends cabs)
 add_custom_target(algo depends target1)
 
 
 Or something like that.
 
 Maxime Lecourt

Yes, you should create a custom target with add_custom_target(). In
CMake you have to distinguish between top-level and file-level targets.
add_custom_command() only creates a file-level target, so you need the
add_custom_target() call. Also, this will make it possible to build the
targets selectively from the command line or the IDE.

However, your above shown code is semantically wrong. Your
add_ocaml_library() macro (you probably should make it a function
instead) should contain the add_custom_target() call and give it the
name passed to the add_ocaml_library function.

Michael
___
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


[CMake] Build-order in Visual Studio

2009-01-26 Thread Micha Renner
Hello,

is it possible to influence the build-order of MSVC from
CMakeLists.txt-files?

The top-level CMakeLists.txt looks like this:

ADD_SUBDIRECTORY(lib1)
ADD_SUBDIRECTORY(lib2)
ADD_SUBDIRECTORY(lib3)
ADD_SUBDIRECTORY(lib4)
ADD_SUBDIRECTORY(prog)

prog depends on the libs. lib3 depends on lib1 and lib4 depends on lib2.
After a cMake-run the build-order in Visual Studio is pure random,
even the main-program is sometimes ZERO_CHECK.

Michael


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Build-order in Visual Studio

2009-01-26 Thread Dmytro Ovdiienko
Micha,

Use 
*target_link_librarieshttp://www.cmake.org/cmake/help/cmake2.6docs.html#command:target_link_libraries
* and 
*add_dependencieshttp://www.cmake.org/cmake/help/cmake2.6docs.html#command:add_dependencies
* to fix project build order.

2009/1/26 Micha Renner micha.ren...@t-online.de

 Hello,

 is it possible to influence the build-order of MSVC from
 CMakeLists.txt-files?

 The top-level CMakeLists.txt looks like this:

 ADD_SUBDIRECTORY(lib1)
 ADD_SUBDIRECTORY(lib2)
 ADD_SUBDIRECTORY(lib3)
 ADD_SUBDIRECTORY(lib4)
 ADD_SUBDIRECTORY(prog)

 prog depends on the libs. lib3 depends on lib1 and lib4 depends on lib2.
 After a cMake-run the build-order in Visual Studio is pure random,
 even the main-program is sometimes ZERO_CHECK.

 Michael


 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Build-order in Visual Studio

2009-01-26 Thread Micha Renner
Am Montag, den 26.01.2009, 16:22 +0200 schrieb Dmytro Ovdiienko:
 Micha,
 
 Use target_link_libraries and add_dependencies to fix project build
 order.
 

I think, that this doesn't work in the case here.
For target_link_libraries I need a library. If prog is first in build
process then there are no libs.
add_dependencies helps if all projects would be in one CMakeList-file.

Michael

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake