[cmake-developers] [CMake 0015011]: problem to find non-standard ncurses.h location

Greg Jung gvjung at gmail.com
Thu Jul 10 00:10:28 EDT 2014


The CMake module scripting is weak regarding the variable that should be
taking care of this,
CMAKE_SYSTEM_PREFIX_PATH  (i.e., /usr; /opt)  will be used in find_path
(after appending /include)
and for find_library(after appending /lib) - according to cmake.html
documentation. For my mingw/msys
builds I set this and the /include, /lib mostly located in
platform/MingW.cmake:
----------------
if(MSYS)
# enhance the system prefix path.  (picks up /Mingw/lib)
find_path( MINGWPATH msys
   PATH ${CMAKE_USR_PATH}/../../
NO_DEFAULT_PATH)
 list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${MINGWPATH} )
list(APPEND CMAKE_SYSTEM_INCLUDE_PATH ${MINGWPATH}/include )
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${MINGWPATH}/lib )
-------
then LDFLAGS is inspected:
____
set(LDFLAGS "$ENV{LDFLAGS}")
if(LDFLAGS)
message(STATUS "\n"
" <Platform/Mingw> inspecting LDFLAGS: ${LDFLAGS}" )
string( REGEX MATCHALL "-L([^\" ]+)" librarylist
        "${LDFLAGS}" )
foreach(element  IN LISTS librarylist) # LDFLAGS is more specific.
------------ etc., leading to
message(STATUS
"<Platform/Mingw>  adding system library path: ${library}")
list(INSERT CMAKE_SYSTEM_LIBRARY_PATH 0 ${library})
list(INSERT CMAKE_SYSTEM_INCLUDE_PATH 0 ${library}/../include )
-------------------------------------------------------



On Wed, Jul 9, 2014 at 4:14 AM, Mantis Bug Tracker <
mantis at public.kitware.com> wrote:

>
> The following issue has been SUBMITTED.
> ======================================================================
> http://public.kitware.com/Bug/view.php?id=15011
> ======================================================================
> Reported By:                hsk
> Assigned To:
> ======================================================================
> Project:                    CMake
> Issue ID:                   15011
> Category:                   (No Category)
> Reproducibility:            always
> Severity:                   minor
> Priority:                   normal
> Status:                     new
> ======================================================================
> Date Submitted:             2014-07-09 07:14 EDT
> Last Modified:              2014-07-09 07:14 EDT
> ======================================================================
> Summary:                    problem to find non-standard ncurses.h location
> Description:
> i have installed gnu ncurses (and several other libraries) under separate
> location; os: solaris10, compiler: sunstudio 12.2
>
> building cmake 2.8.x worked using
>
> env \
>   CC=cc \
>   CFLAGS='-xtarget=ultra2 -xarch=sparcvis -xO4' \
>   CXX=CC \
>   CXXFLAGS='-xtarget=ultra2 -xarch=sparcvis -xO4' \
>   LDFLAGS='-L/var/imb/lib -R/var/imb/lib -L/usr/sfw/lib -R/usr/sfw/lib -s'
> \
>   CPPFLAGS=-I/var/imb/include \
>     ./bootstrap --prefix=/var/imb;  gmake
>
> with cmake 3.0, the "gmake" step fails:
>
> cmake-3.0.0/Source/CursesDialog/form/form.h", line 46: cannot find include
> file:
> <ncurses/ncurses.h>
>
> and -I/var/imb/include must be explicitly added to CFLAGS / CXXFLAGS for
> ncurses.h to be found, i.e., i have to use
>
> env \
>   CC=cc \
>   CFLAGS='-xtarget=ultra2 -xarch=sparcvis -xO4 -I/var/imb/include' \
>   CXX=CC \
>   CXXFLAGS='-xtarget=ultra2 -xarch=sparcvis -xO4 -I/var/imb/include' \
>   LDFLAGS='-L/var/imb/lib -R/var/imb/lib -L/usr/sfw/lib -R/usr/sfw/lib -s'
> \
>   CPPFLAGS=-I/var/imb/include \
>     ./bootstrap --prefix=/var/imb;  gmake
>
> imho, the value of CPPFLAGS should be honoured here
>
> ======================================================================
>
> Issue History
> Date Modified    Username       Field                    Change
> ======================================================================
> 2014-07-09 07:14 hsk            New Issue
> ======================================================================
>
> --
>
> 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:
> http://public.kitware.com/mailman/listinfo/cmake-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140709/227a539c/attachment-0002.html>


More information about the cmake-developers mailing list