Crascit/DownloadProject

not working in a nested project

Closed this issue · 8 comments

@audiofanatic I've tried to use the download_project function in a child directory of a project and it doesn't download the external project.

Any tip or hint? thanks!

Can you provide a small, simple example which demonstrates the problem you are seeing? If I can reproduce it, I can look into why it isn't working for you, but without that, I don't have much to go on.

Take a look into this repo: https://github.com/edgarriba/test_cmake

Besides, this PR #2 might be the solution. Not sure

Thanks for the quick example. I can reproduce the problem and will look into it.

welcome. That's a useful and clean tool for projects with many third party libs

You can fix the problem for now by changing the configure_file command in DownloadProject.cmake to this:

configure_file("${_DownloadProjectDir}/DownloadProject.CMakeLists.cmake.in"
               "${CMAKE_BINARY_DIR}/${DL_ARGS_PROJ}-download/CMakeLists.txt")

I will think through this a bit more, especially in light of the other discussion in #2 which you correctly point out is somewhat related. There may be a clean solution which addresses both.

Should now be fixed on latest master. Thanks for reporting.

thanks! but bad news. Your project itself works but when I add it to a different project it crashes at compilation step. I got a huge error log

Building CXX object googletest-build/googlemock/CMakeFiles/gmock_main.dir/__/googletest/src/gtest-all.cc.o
In file included from /home/eriba/software/bmva/build/googletest-src/googletest/src/gtest.cc:142:0,
from /home/eriba/software/bmva/build/googletest-src/googletest/src/gtest-all.cc:42:
/home/eriba/software/bmva/build/googletest-src/googletest/src/gtest-internal-inl.h: In static member function ‘static void testing::internal::TestResultAccessor::RecordProperty(testing::TestResult*, const string&, const testing::TestProperty&)’:
/home/eriba/software/bmva/build/googletest-src/googletest/src/gtest-internal-inl.h:1019:54: error: no matching function for call to ‘testing::TestResult::RecordProperty(const string&, const testing::TestProperty&)’
test_result->RecordProperty(xml_element, property);
^
/home/eriba/software/bmva/build/googletest-src/googletest/src/gtest-internal-inl.h:1019:54: note: candidate is:
In file included from /home/eriba/software/bmva/build/googletest-src/googletest/src/gtest-all.cc:39:0:
/home/eriba/software/caffe/src/gtest/gtest.h:17600:8: note: void testing::TestResult::RecordProperty(const testing::TestProperty&)
void RecordProperty(const TestProperty& test_property);

it's weird since the project has the same structure as the mock project I forwarded to you.