Skip to content
Snippets Groups Projects
  • Aleric Inglewood's avatar
    a9021607
    VWR-24251: Fix -DLL_TESTS:BOOL=ON on standalone when Tut is installed in a non-standard directory. · a9021607
    Aleric Inglewood authored
    If tut/tut.hpp isn't installed in a standard include directory all tests
    fail because the found include directory for tut isn't passed to the compiler.
    
    This patch fixes this by passing it.
    Note that using include_directories() in a Find*.cmake file is bad practise.
    The correct way is to set an include dir variable and call
    include_directories() once. It certainly doesn't work for the tests anyway
    because the tests are all over the place and include_directories is on a
    per folder basis.  What is needed is to set it for each (test) target.
    
    However, there is no TARGET_INCLUDE_DIRECTORIES. The closest thing that we
    have is to set the COMPILE_FLAGS property for a target.
    
    Fortunately, standalone is only used for linux, so we can just use
    -I${TUT_INCLUDE_DIR} to get the effect we want.
    a9021607
    History
    VWR-24251: Fix -DLL_TESTS:BOOL=ON on standalone when Tut is installed in a non-standard directory.
    Aleric Inglewood authored
    If tut/tut.hpp isn't installed in a standard include directory all tests
    fail because the found include directory for tut isn't passed to the compiler.
    
    This patch fixes this by passing it.
    Note that using include_directories() in a Find*.cmake file is bad practise.
    The correct way is to set an include dir variable and call
    include_directories() once. It certainly doesn't work for the tests anyway
    because the tests are all over the place and include_directories is on a
    per folder basis.  What is needed is to set it for each (test) target.
    
    However, there is no TARGET_INCLUDE_DIRECTORIES. The closest thing that we
    have is to set the COMPILE_FLAGS property for a target.
    
    Fortunately, standalone is only used for linux, so we can just use
    -I${TUT_INCLUDE_DIR} to get the effect we want.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
LLAddBuildTest.cmake 11.88 KiB