Cmake: default includes a path in unix

I use cmake and do to compile the project using an external library (speex). This library was found by the find_library command in my CMakeLists.txt. The only problem is that the cmake path is included by default, which does not include '/ usr / local / include /', i.e. the location of speex headers.

I do not want to add '/ usr / local / include' to the search path in CMakeLists.txt because it (I suppose) would create an error in windows where such a path does not exist. Moreover, it will be a dirty trick, I do not really like this decision.

Do you know a solution to this problem that would be portable and clean?

Thank you for your time.

+3
source share
3 answers

Try using the full-featured speex search module, created from scratch, or based on something found using http://www.google.com/search?q=findspeex.cmake

+1
source

Configure the user through the command line, for example

cmake -DSPEEX_PATH=/usr/local/include
0
source

use the PATH find_library argument to specify other places to search. If the path does not exist, it should not cause errors.

0
source

Source: https://habr.com/ru/post/1777258/


All Articles