Re: [cmake-developers] FindFreetype Maintenance

2014-05-23 Thread Brad King
On Fri, May 23, 2014 at 12:56 AM, Greg Jung gvj...@gmail.com wrote:
 Somehow $ENV{CFLAGS} impossibly translates the first group but fails to go
 beyond that first blank.

The *only* program that translates paths in MinGW is the MSYS shell.
When it passes command line arguments and environment variables to
programs not located inside one of its soft mounts, it tries to
convert paths to pure windows paths.  In your example the value of
CFLAGS has been changed by the shell before CMake even runs.

For example, try:

 $ CFLAGS='-I/usr/local/include -I/usr/include' cmd //c echo %CFLAGS%
 -IC:/MinGW/msys/1.0/local/include -I/usr/include

Certainly cmd and echo are not doing that conversion.

 Including /usr and /usr/local in the .cmake file's search would solve the
 unix problem.

They shouldn't be needed explicitly in the module at all.  See my
response to Taylor's first patch.

 It doesn't make sense to me to chase every different freetype install
 location.

Agreed.  The current module's guesses need to be preserved for compatibility
(if they are not otherwise searched already), but should not be used as an
example of how to do it.

 It does make sense to reform
 the original kludge, which finds ft2build.h (should be easy) then goes after
 config/ftheader.h; ft2build simply
 includes (???)/config/ftheader.h  in whatever the way it would show.
 A simple search for freetype as a library, then verifying the affiliated
 include directory for ft2build.h,
 should replace the gymnastics there now.

Searching for ft2build.h is correct because that is the header that
applications are expected to include directly.  The rest of the
search is an attempt to locate the real headers so the version
can be extracted, AFAICT.

-Brad
-- 

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/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] FindFreetype Maintenance

2014-05-22 Thread Greg Jung
On Wed, May 21, 2014 at 6:50 PM, Taylor Holberton 
taylorcholber...@gmail.com wrote:

 I've noticed that the FindFreetype module doesn't search standard Unix and
 Windows paths. Can I add these to the find module?

 As it currently stands, the module won't find Freetype in either Windows
 or Linux (despite it being installed in very standard locations). It can be
 overridden by creating an environment variable called FREETYPE_DIR, but I
 think adding a search to standard installation paths would be preferable
 for most.

Freetype include files have been found in the wild under
 include/freetype2/config (My recent mingw installation) and also
include/freetype2/freetype/config;
In the first case, current cmake Findfreetype won't ever be satisfied
because it wants
to find  freetype/config/ftheader.h
I think it gets built these days with the second form, with ft2build.h in
include/ and ftheader.h
under config - ft2build simply includes ftheader relative to itself.
 cmake looks for both files in the second case; it needs to find both (even
if you may not be referencing them in code).
If you are built that way you should be good (under unix only; see code
below), FREETYPE_DIR would help if you have re-located it.
I (just) found that the variable CMAKE_SYSTEM_PREFIX_PATH can be used to
guide the search;  also CMAKE_PREFIX_PATH as the documentation says.  It
worked for me when I set this variable under MSYS generator.
You can also use CMAKE_SYSTEM_INCLUDE_PATH and CMAKE_INCLUDE_PATH as
environment variables.

find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
  HINTS
ENV FREETYPE_DIR
  PATHS
/usr/X11R6
/usr/local/X11R6
/usr/local/X11
/usr/freeware
ENV GTKMM_BASEPATH
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
  PATH_SUFFIXES include/freetype2 include
)

find_path(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
  HINTS
ENV FREETYPE_DIR



-- 

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/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] FindFreetype Maintenance

2014-05-22 Thread Brad King
On 05/21/2014 09:50 PM, Taylor Holberton wrote:
 As it currently stands, the module won't find Freetype
 in either Windows or Linux

There are numerous reports in the issue tracker regarding this
module.  There is a summary issue for them here:

 FindFreetype module needs a new maintainer and an overhaul
 http://www.cmake.org/Bug/view.php?id=14626

It is a call for a new module maintainer:

 http://www.cmake.org/Wiki/CMake:Module_Maintainers

for which no one has stepped forward yet.  Let us know if
you're interested in helping.

Thanks,
-Brad

-- 

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/cgi-bin/mailman/listinfo/cmake-developers


[cmake-developers] FindFreetype Maintenance

2014-05-21 Thread Taylor Holberton
I've noticed that the FindFreetype module doesn't search standard Unix and
Windows paths. Can I add these to the find module?

As it currently stands, the module won't find Freetype in either Windows or
Linux (despite it being installed in very standard locations). It can be
overridden by creating an environment variable called FREETYPE_DIR, but I
think adding a search to standard installation paths would be preferable
for most.

-- 
Taylor Holberton
Bay Point, California
-- 

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/cgi-bin/mailman/listinfo/cmake-developers