CMake: Force to use optional include and library p

2019-07-25 21:11发布

I have a piece of software that relies on a particular version of GEOS and GDAL (ie newer than the one installed on the system). I've installed the particular versions with prefix /opt/hhd. The problem is that there already is both GDAL and GEOS installed, and those get included first.

How can I force CMake to use this location to include headers, instead of /usr/local?

I was trying the BEFORE / AFTER keywords. But that didn't help:

include_directories(
    /opt/hhd/geos/include
    /opt/hhd/gdal/include
...
)

I was also trying -iprefix with above folders.

标签: c++ cmake
0条回答
登录 后发表回答