Where should I install FindXXX.cmake file of my own project and how to find it? -
i developing 2 cmake projects: libabc , libxyz. libxyz requires libabc, , install findabc.cmake in appropriate location on mac , linux machines.
libabc , related files installed under /usr/local default, , think findabc.cmake should installed under same directory. tried installing in following 6 different locations.
/usr/local/lib/cmake/abc/findabc.cmake
/usr/local/share/cmake/abc/findabc.cmake
/usr/local/lib/abc/findabc.cmake
/usr/local/share/abc/findabc.cmake
/usr/local/lib/abc/cmake/findabc.cmake
/usr/local/share/abc/cmake/findabc.cmake
however cmakelist.txt of libxyz cannot find following error.
cmake error @ cmakelists.txt:51 (find_package): not providing "findabc.cmake" in cmake_module_path project has asked cmake find package configuration file provided "abc", cmake did not find one. my cmake command installed under /opt/local using macports on os x. think searches not /usr/local /opt/local.
i know defining cmake_module_path when executing cmake command solve issue (e.g., cmake -dcmake_module_path=/usr/local/lib/cmake/abc), not want ask users every time.
my questions are
q1. should install findabc.cmake during libabc installation process?
q2. how find findabc.cmake in cmakelists.txt of libxyz without hard-coding cmake_module_path in it?
Comments
Post a Comment