Dear CMake developers, for several years openSuse's CMake package has a patch which adds the sub-directory ncurses to the CURSES_INCLUDE_PATH:
diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt index 7d4e88c..0cc5357 100644 --- a/Source/CursesDialog/CMakeLists.txt +++ b/Source/CursesDialog/CMakeLists.txt @@ -17,7 +17,7 @@ CursesDialog/ccmake.cxx ) -include_directories(${CURSES_INCLUDE_PATH}) +include_directories(${CURSES_INCLUDE_PATH}/ncurses/) add_executable(ccmake ${CURSES_SRCS} ) The reason is, that curses.h and ncurses.h are present in /usr/include. Both are symbolic links to /usr/include/ncurses/curses.h. This layout does not seem uncommon, at least CURSES_HAVE_NCURSES_NCURSES_H and CURSES_HAVE_NCURSES_CURSES_H are true if the headers are found below ncurses/. I'd like to propose a patch for the issue with openSuse's package to upstream CMake, but I figured out several ways to fix this issue. Can you advice, which way you prefer? 1) Above patch. 2) Change the patch to add also the sub-directory ncurses/ -include_directories(${CURSES_INCLUDE_PATH}) +include_directories(${CURSES_INCLUDE_PATH};${CURSES_INCLUDE_PATH}/ncurses/) 3) Add the sub-diretory conditionally: -include_directories(${CURSES_INCLUDE_PATH}) +if(CURSES_HAVE_NCURSES_NCURSES_H OR CURSES_HAVE_NCURSES_CURSES_H) + include_directories("${CURSES_INCLUDE_DIRS}/ncurses") +else() + include_directories(${CURSES_INCLUDE_DIRS}) +endif() 4) Modify FincCurses.cmake that it adds ncurses to CURSES_INCLUDE_DIRS, either conditionally or unconditionally. Use this variable instead of CURSES_INCLUDE_PATH (which should be done anyway). Which way should I follow and propose a merge request? Kind regards, Christoph -- Nous vivons une époque où les pizzas arrivent plus vite que la police. [Claude Chabrol] -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake-developers