Manu343726 / C--

The sandbox where we show our increasingly depressing C++ skills
MIT License
3 stars 1 forks source link

Run conan_basic_setup() command when setting up deps #2

Open Manu343726 opened 7 years ago

Manu343726 commented 7 years ago

Basically, I've removed the invocation to the command to prevent conan to change the runtime output directory of our targets. Moving all the executables to bin/ makes ctest to not find them when configured directly from an executable target (See CMake add_test() command).

Ping @memsharded

memsharded commented 7 years ago

I wouldn't recommend to remove all of the stuff that conan_basic_setup() is doing, but maybe just to remove the setting of the output dirs: http://docs.conan.io/en/latest/integrations/cmake.html

Create your own my_conan_basic_setup:

macro(my_conan_basic_setup)
     conan_check_compiler()
     # JUST REMOVE THIS LINE:
     # conan_output_dirs_setup()
     conan_set_find_library_paths()
     if(NOT "${ARGV0}" STREQUAL "TARGETS")
         message(STATUS "Conan: Using cmake global configuration")
         conan_global_flags()
     else()
         message(STATUS "Conan: Using cmake targets configuration")
         conan_define_targets()
     endif()
     conan_set_rpath()
     conan_set_vs_runtime()
     conan_set_libcxx()
     conan_set_find_paths()
 endmacro()

Then you will get some convenient things from the other macros, without conan messing with the output dirs.

Would this work for you? Thanks for the feedback!