find_package(blaze) should set BLAZE_INCLUDE_DIRS

Issue #347 new
Orell Garten created an issue

Hi!,

I have a slight problem with the way find_package(blaze) currently works. Maybe I am missing something, if so please let me know 😉

Current status

My CMakeLists.txt currently looks like this to include blaze:

find_package(blaze)

I cannot set include directories for the blaze library, which raises problems on some systems. It works fine on my laptop, because blaze include can be found in /usr/include; however my travisCI script fails, because it cannot find the blaze includes which are not installed into /usr/include.

Blaze is installed into <project_dir>/deps/blaze like this:

wget https://bitbucket.org/blaze-lib/blaze/downloads/blaze-3.7.tar.gz; 
export BLAZE_INSTALL_DIR=`pwd`/deps/blaze; 
echo ${BLAZE_INSTALL_DIR}; 
tar -xf blaze-3.7.tar.gz; 
cd blaze-3.7; 
mkdir build; cd build; 
cmake ../ -DCMAKE_INSTALL_PREFIX=$BLAZE_INSTALL_DIR; 
cmake --build .; 
cmake --build . -- install;

In order to have travis run the CI correctly, I need to explicitly specify the include directories for blaze, otherwise the blaze headers will not be found:

find_package(blaze)
include_directories("deps/blaze/include")

Proposed Enhancement

I would like to do something like this

find_package(blaze)
include_directories(${BLAZE_INCLUDE_DIRS})

where the find_package(blaze) sets the include directories variable. I think this is quite common among most packages I have included via find_package so far.

Best,

Orell

Comments (4)

  1. Klaus Iglberger

    Hi Orell!

    Thanks for the proposal. This sounds like a reasonable addition to the find_package() functionality. We will try to integrate this as soon as possible.

    Best regards,

    Klaus!

  2. Log in to comment