开发者

CMake find_path not working on MinGW

I have an issue when using find_path CMake command on windows and MinGW. Consider the following code:

find_path(FINDPATH_TEST stdio.h)
message(STATUS "FINDPATH_TEST: "${FINDPATH_TEST})

It开发者_如何学JAVA works perfectly on Linux, printing: FINDPATH_TEST: /usr/include. However running this code on windows using "MinGW Makefiles" as CMake generator will output:

FINDPATH_TEST: FINDPATH_TEST-NOTFOUND

Why find_path not works in the same way on MinGW?


You could check this thread: http://www.cmake.org/pipermail/cmake/2007-November/017813.html It explains what are the default search paths for various operating systems. You should see which one is used in your case (mingw).

I also believe that you may need to use the cmake version compiled for mingw in order to get that working on your mingw environment. I am not 100% sure though because I didn't use cmake with mingw.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜