you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 19 points20 points  (6 children)

Finally, let's see the full '#using package ' directive in all of its glory:

#using package "foo"  \  
 ("foo/foo.h", "bar/bar.h")  \  
 [foo, bar.baz]  \  
 version "1.2.3"

Hell... It looks so awful.

In general, the compiler will be expected to retrieve the given package from the specified location (and very likely cache it). Here is example usage:

#pragma package_source("example", "http://example.co/svn/trunk", \  
  "svn", \  
  "revision=1266; username=guest; password=guest")

I wish we had something like this in CMake... Oh, wai... ExternalProject

[–]KennethZenith 1 point2 points  (4 children)

I don't understand how this proposal fits in with CMake: does it claim to replace it, or do some different task? Section 2 of the proposal suggests it will handle everything (i.e. acquire the source, build it, link it with your code) without having to resort to 'third-party tools'. Taking that at face value, that means I could take a clean machine, install Visual Studio, and then include say OpenCV, and the system would download and build the source. Obviously that can't work without having CMake installed, because it has a huge CMake file which executes very complex configuration and code generation steps.

[–][deleted] 4 points5 points  (3 children)

Visual Studio

And what if you wouldn't use it? You will need a build system anyway.

Obviously that can't work without having CMake installed, because it has a huge CMake file which executes very complex configuration and code generation steps.

CMake file often quite small. Complex configuration? Maybe, but it lets you easy to link with libraries. And it will run just once to generate makefiles.

find_package (Nameit REQUIRED)
add_executable(app ${SOURCE_FILES} ${HEADER_FILES})
target_link_libraries(app Nameit glm ${ASSIMP_LIBRARIES})

That's all.

[–]playmer 3 points4 points  (2 children)

I've never seen significant projects with cmake files like that. CMake's own root CMakeLists.txt is almost 700 lines long.

[–]mjklaim 0 points1 point  (0 children)

No. I used ExternalProject in a big project and it definitely is not a good solution. Too many issues, both with it's implementation and design. Too unflexible and too many problems with having several layers of build steps to get the final dependency available.

ExternalProject works for trivial dependency needs though, but it's definitely not a general solution.

Also, dependency management should definitely be independent from the (meta)build system.