[CMake] Best practice for static libraries and include files
Alessandro Saccoia
alessandro.saccoia at gmail.com
Fri Mar 8 21:29:38 EST 2013
>
> You can dredge up at least some information searching the recent cmake-devel acrhives for 'target_link_libraries', but I couldn't tell you offhand how much of that will reflect the actual current state of things.
>
I will look for that info, thank you.
>> OT: Since we're already here, do you know why CTest seems to be
>> broken, as I need to create a new custom target that depends on the
>> tests in order to run them, i.e. "make check" doesnt do anything and
>> "ctest -N" always shows "Total Tests: 0"?
>
> CMake has never created a 'check' target by default. This (as you probably know) is a GNU-ism/autotools-ism that CMake has never felt necessary to copy; for CMake projects, just think 'ctest' instead of 'make check'.
My bad, I meant "make test". I am already creating a custom "check" target myself as you've described, with this command
ADD_CUSTOM_TARGET(check ${CMAKE_CTEST_COMMAND} DEPENDS myTest1 myTest2)
>
> As for ctest reporting no tests, per Alexander's reply, I would first make sure you have called enable_testing().
I actually do call it, but still ctest doesn't find any test.
>> ctest -V -VV
….
….
No tests were found!!!
>
> This is the default behavior (although the output does not go to /dev/null :-); log files are written to ctest's output directory). Please refer to ctest's documentation for how to run tests verbosely (hint: '-V').
That did the trick, I have added the -V option.
ADD_CUSTOM_TARGET(check ${CMAKE_CTEST_COMMAND} -V DEPENDS test1 test2)
Thank you
Alessandro
>
> --
> Matthew
>
> --
>
> 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
More information about the CMake
mailing list