[CMake] setting CMAKE_MODULE_PATH removes the default path?

2007-01-11 Thread Pierre

Hello,

Doing:

SET(CMAKE_MODULE_PATH "${FOO_CMAKE_DIR}")

removes the default module path (${CMAKE_ROOT}/Modules here on ubuntu
with 2.4.3). It is not possible anymore to call system macros like
"check_include_file".  Is it the expected behavior?

I thought setting CMAKE_MODULE_PATH adds a path but do not replace the
default one. Is there a way to get back the system path and add it
again (as a workaround)?

Regards,
--Pierre
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] setting CMAKE_MODULE_PATH removes the default path?

2007-01-11 Thread David Cole

Use:

SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${FOO_CMAKE_DIR}")
to append your own path...

SET(CMAKE_MODULE_PATH "${FOO_CMAKE_DIR}" ${CMAKE_MODULE_PATH})
to prepend your own path...


HTH,
David


On 1/11/07, Pierre <[EMAIL PROTECTED]> wrote:


Hello,

Doing:

SET(CMAKE_MODULE_PATH "${FOO_CMAKE_DIR}")

removes the default module path (${CMAKE_ROOT}/Modules here on ubuntu
with 2.4.3). It is not possible anymore to call system macros like
"check_include_file".  Is it the expected behavior?

I thought setting CMAKE_MODULE_PATH adds a path but do not replace the
default one. Is there a way to get back the system path and add it
again (as a workaround)?

Regards,
--Pierre
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] setting CMAKE_MODULE_PATH removes the default path?

2007-01-11 Thread Pierre

Hell David,

On 1/11/07, David Cole <[EMAIL PROTECTED]> wrote:

Use:

SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${FOO_CMAKE_DIR}")
to append your own path...

SET(CMAKE_MODULE_PATH "${FOO_CMAKE_DIR}" ${CMAKE_MODULE_PATH})
to prepend your own path...


CMAKE_MODULE_PATH is empty, cmake uses the default path. It is always
${CMAKE_ROOT}/Modules right?

SET(CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules")
SET(GD_CMAKE_DIR "${FOO_SOURCE_DIR}/CMakeModules")
SET(CMAKE_MODULE_PATH "${FOO_CMAKE_DIR}" ${CMAKE_MODULE_PATH})

CMAKE_MODULE_PATH is now:

/home/test/projects/foo/CMakeModules;/usr/share/CMake/Modules

Am I right that it should first look in the first path and then the
second? Allowing me to override existing macros (or other files). But
it still does not find the default macros. Whether I append or prepend
my path does not change anything. Is it a bug in 2.4.3?

If I do not set CMAKE_MODULE_PATH or set it using CMAKE_ROOT/Modules,
it works, but I cannot add any path without loosing the system path.

--Pierre
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] setting CMAKE_MODULE_PATH removes the default path?

2007-01-11 Thread Axel Roebel
On Thursday 11 January 2007 16:47, Pierre wrote:
> Hello,
>
> Doing:
>
> SET(CMAKE_MODULE_PATH "${FOO_CMAKE_DIR}")

Effectively this is correct, it worked for me like this 
on all cmake versions I ever tried. The default path 
should be searched for automagically.

You find the implementation in 
cmake-source-dir/Source/cmMakefile.cxx 
function GetModulesFiles.

The default location is
${CMAKE_ROOT}/Modules.
You may want to check whether 
your CMAKE_ROOT variable
is correct...

> removes the default module path (${CMAKE_ROOT}/Modules here on ubuntu
> with 2.4.3). It is not possible anymore to call system macros like
> "check_include_file".  Is it the expected behavior?
>
> I thought setting CMAKE_MODULE_PATH adds a path but do not replace the
> default one. Is there a way to get back the system path and add it
> again (as a workaround)?
>
> Regards,
> --Pierre
> ___
> CMake mailing list
> CMake@cmake.org
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Axel Roebel
IRCAM Analysis/Synthesis Team
Phone: ++33-1-4478 4845 | Fax: ++33-1-4478 1540
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] setting CMAKE_MODULE_PATH removes the default path?

2007-01-11 Thread Pierre

On 1/11/07, Axel Roebel <[EMAIL PROTECTED]> wrote:

On Thursday 11 January 2007 16:47, Pierre wrote:
> Hello,
>
> Doing:
>
> SET(CMAKE_MODULE_PATH "${FOO_CMAKE_DIR}")

Effectively this is correct, it worked for me like this
on all cmake versions I ever tried. The default path
should be searched for automagically.


Sounds logical and it is what I expect, very good :)

I remove my 2.4.3 install and use now the freshly released 2.4.6.


You find the implementation in
cmake-source-dir/Source/cmMakefile.cxx
function GetModulesFiles.


The "out.txt" attachment is the ouput of the CMakeLists.txt.  I simply
added a printf in cmMakefile::GetModulesFile, in the true clause of
"if(cmSystemTools::FileExists(itempl.c_str()))".

I was wrong when I said that cmake did not find or do not use the
default path, it does.  But the macros is not defined. If I add
include(CheckIncludeFile), it works. I wonder what I broke (as it
seems to work for anyone else) as it is now a fresh install from the
official 2.4.6 sources package. Any idea?

As a workaround, I will a file to include all macros I need. It's ugly
but it will work.


The default location is
${CMAKE_ROOT}/Modules.
You may want to check whether
your CMAKE_ROOT variable
is correct...


It is set correctly.

--Pierre
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.3 FATAL_ERROR)
PROJECT(GD)

SET(GD_VERSION_MAJOR "2")
SET(GD_VERSION_MINOR "0")
SET(GD_VERSION_PATCH "34")
SET(GD_VERSION "${GD_VERSION_MAJOR}.${GD_VERSION_MINOR}.${GD_VERSION_PATCH}")

message(STATUS "module path: ${CMAKE_MODULE_PATH} ${CMAKE_ROOT}")

SET(CMAKE_MODULE_PATH "${GD_SOURCE_DIR}/CMakeModules")

message(STATUS "module path: ${CMAKE_MODULE_PATH} !!!")

include(CheckIncludeFiles)

FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(ZLIB)
FIND_PACKAGE(JPEG)
FIND_PACKAGE(PTHREAD)
FIND_PACKAGE(Freetype)
SET(HAVE_FT2BUILD_H 0)


if (FREETYPE_FOUND)
INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIR})
MESSAGE(STATUS "${CMAKE_MODULE_PATH}")
CHECK_INCLUDE_FILE(ft2build.h HAVE_FT2BUILD_H)
SET(HAVE_LIBFREETYPE 1)
ENDIF(FREETYPE_FOUND)

IF(ZLIB_FOUND)
INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
SET(HAVE_LIBZ 1)
SET(HAVE_LIBPNG_PNG_H 1)
ENDIF(ZLIB_FOUND)

IF(PNG_FOUND)
INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
SET(HAVE_LIBPNG 1)
ENDIF(PNG_FOUND)

IF(JPEG_FOUND)
INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
SET(HAVE_LIBJPEG 1)
ENDIF(JPEG_FOUND)

SET (LIBGD_SRC_FILES
gd.c
gdfx.c
gd_security.c
gd_gd.c
gd_gd2.c
gd_io.c
gd_io_dp.c
gd_gif_in.c
gd_gif_out.c
gd_io_file.c
gd_io_ss.c
gd_jpeg.c
gd_png.c
gd_ss.c
gd_topal.c
gd_wbmp.c
gdcache.c
gdfontg.c
gdfontl.c
gdfontmb.c
gdfonts.c
gdfontt.c
gdft.c
gdhelpers.c
gdhelpers.h
gdkanji.c
gdtables.c
gdxpm.c
jisx0208.h
wbmp.c
wbmp.h
)

Set(BUILD_SHARED_LIBS On)
INCLUDE_DIRECTORIES(BEFORE ${PROJET_SOURCE_DIR})
CONFIGURE_FILE(config.h.cmake test.h)

add_library (gd ${LIBGD_SRC_FILES})
target_link_libraries(gd ${FREETYPE_LIBRARIES} ${PNG_LIBRARIES} 
${JPEG_LIBRARIES})itempl: /usr/share/cmake-2.4/Modules/CMakeSystemSpecificInformation.cmake Found
itempl: /usr/share/cmake-2.4/Modules/CMakeGenericSystem.cmake Found
itempl: /usr/share/cmake-2.4/Modules/Platform/gcc.cmake Found
itempl: /usr/share/cmake-2.4/Modules/Platform/Linux.cmake Found
itempl: /usr/share/cmake-2.4/Modules/Platform/UnixPaths.cmake Found
itempl: /usr/share/cmake-2.4/Modules/CMakeCInformation.cmake Found
itempl: /usr/share/cmake-2.4/Modules/CMakeCommonLanguageInclude.cmake Found
itempl: /usr/share/cmake-2.4/Modules/CMakeCXXInformation.cmake Found
itempl: /usr/share/cmake-2.4/Modules/CMakeCommonLanguageInclude.cmake Found
-- module path:  /usr/share/cmake-2.4
-- module path: /home/pierre/projects/gd/gdcmake/CMakeModules !!!
itempl: /usr/share/cmake-2.4/Modules/CheckIncludeFiles.cmake Found
itempl: /home/pierre/projects/gd/gdcmake/CMakeModules/FindPNG.cmake Found
itempl: /usr/share/cmake-2.4/Modules/FindZLIB.cmake Found
-- Found PNG: /usr/lib/libpng.so
itempl: /usr/share/cmake-2.4/Modules/FindZLIB.cmake Found
itempl: /usr/share/cmake-2.4/Modules/FindJPEG.cmake Found
-- Found JPEG: /usr/lib/libjpeg.so
itempl: /home/pierre/projects/gd/gdcmake/CMakeModules/FindPTHREAD.cmake Found
itempl: /home/pierre/projects/gd/gdcmake/CMakeModules/FindFreetype.cmake Found
-- Version
-- Looking for freetype files...
-- Found Freetype: 2.2.1
-- /home/pierre/projects/gd/gdcmake/CMakeModules
CMake Error: Error in cmake code at
/home/pierre/projects/gd/gdcmake/CMakeLists.txt:28:
Unknown CMake command "CHECK_INCLUDE_FILE".
-- Configuring done
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] setting CMAKE_MODULE_PATH removes the default path?

2007-01-11 Thread Pierre

On 1/11/07, Pierre <[EMAIL PROTECTED]> wrote:


Sounds logical and it is what I expect, very good :)


Listen to advices and read the manual is also good. What I was trying
to use os provided by default, not loaded by default... Problem
solved. Thanks for the help

--Pierre
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake