Monday 15 April 2013

search - How to include an additional CMakeLists.txt -


Say that we have the command call foo in CMakeLists.txt which is the folder / A .

foo is defined in the antirection CMakeLists.txt in the folder / B .

How to call foo from /B/CemakeLists.txt within / A / CemakeLists.txt Can be a reference

I tried to set the search path through / B / CemakeLists.txt :

  • CMAKE_INCLUDE_PATH
  • CMAKE_MODULE_PATH
  • CMAKE_SOURCE_DIR

    But none of these works.

    Still complained unknown CMake command "foo"

    this A / CMKelist Txt

      function (foo) message (status "heya") end ()        Code>  

    B / CMKelist Content of Txt

      Semicamini Mum_required (version 2.8) includes ($ {CMAKE_CURRENT_SOURCE_DIR} /../A / CMakeLists.txt) foo ()   

    Now, everything else in that file, along with another CMakeLists.txt, can also be avoided if you have goals in B / CMKellists Tx

    , if you have your code If you can modify, then it would be better to define your tasks in the "top level" CMakeLists.txt add_sub directory .

No comments:

Post a Comment