[CMake] Where are tests located?

David Cole david.cole at kitware.com
Thu Nov 10 15:08:41 EST 2011


When you add an IMPORTED target, CMake does not know where the
imported target is AT ALL until you tell it.

After:
  add_executable(run_main.pl IMPORTED)

You need:
  set_property(TARGET run_main.pl PROPERTY IMPORTED_LOCATION
"${CMAKE_CURRENT_SOURCE_DIR}/run_main.pl")

See docs here:
  http://cmake.org/cmake/help/cmake-2-8-docs.html#command:set_property
  http://cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:IMPORTED_LOCATION


HTH,
David


On Thu, Nov 10, 2011 at 3:00 PM, EXT-York, Gantry
<gantry.york at boeing.com> wrote:
> When I do an
>
>
>
> add_executable( run_main.pl IMPORTED)
>
> add_test( test1 run_main.pl)
>
>
>
> How does it know where run_main.pl is located when you do an out of source
> build?
>
>
>
> It seems to look in
>
> .
>
> Releases
>
> Debug
>
> MinSizeRel
>
> RelWithDebInfo
>
> Deployment
>
> Development
>
>
>
> which are directories that I don’t even see existing.
>
>
>
> And if run_main.pl is just
>
>
>
> #!/usr/bin/perl
>
> system “ ../exec/main”
>
>
>
>
>
> How does it know if ../exec/main is in the src tree or the build tree?  If
> main is a C binary, it would be in the build tree, if it is just a script it
> would be in the source tree.
>
>
>
>
>
>
>
>
>
> Gantry York
>
> Chandler, Arizona
>
>
>
> --
>
> 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