Hi all,

I am getting in trouble with the FindPkgConfig module. Here is a piece
of rather bigger CMakeLists.txt file that doesn't success to find
Doxygen although installed on the machine(ubuntu 10.4, cmake 2.8.3)

# $Id$ #
# ----------------------------------------------------------------------------
# A CMakeLists.txt file to test FindPkgConfig
# ----------------------------------------------------------------------------

set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)

# it MUST go before PROJECT(Jafar) in order to work
if (NOT CMAKE_INSTALL_PREFIX)
  set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR} CACHE INTERNAL "" FORCE)
endif()

cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)

project(test CXX C)

include(CheckIncludeFile)

macro(FIND_PACKAGE package_name)
                string(TOUPPER "${package_name}" PACKAGE_NAME)
#               string(TOUPPER "${package_name}_FOUND" PACKAGE_NAME_FOUND)
                pkg_check_modules(${PACKAGE_NAME} ${package_name})
#               message(STATUS "finding ${package_name} 
${${PACKAGE_NAME_FOUND}}")
endmacro(FIND_PACKAGE package_name)

include(FindPkgConfig)
if(PKG_CONFIG_FOUND)
        foreach(package
                        flann)
                string(TOUPPER "${package}" PACKAGE)
                string(TOUPPER "HAVE_${package}" HAVE_PACKAGE)
                string(TOUPPER "${package}_FOUND" PACKAGE_FOUND)
                find_package(${package})
                set(${HAVE_PACKAGE} ${${PACKAGE_FOUND}})
                if(${PACKAGE_FOUND})
                        string(TOUPPER "LIBS_MAP_${package}" LIBS_MAP_PACKAGE)
                        set(${LIBS_MAP_PACKAGE} "${PACKAGE}")
                        set(LIBS ${LIBS} ${${PACKAGE}_LIBRARIES})
                        include_directories(${${PACKAGE}_INCLUDE_DIRS})         
                endif(${PACKAGE_FOUND})
        endforeach(package)
else(PKG_CONFIG_FOUND)
  message(ERROR " pkgconfig not found you won't be able to build some modules")
endif(PKG_CONFIG_FOUND)

find_package(Doxygen)

==================================================================
It says :
Running CMake to regenerate build system...
-- checking for module 'Doxygen'                                                
                                                                                
                   
-- package 'Doxygen' not found

I get it work by putting find_package(Doxygen) before
include(FindPkgConfig) statement. Can someone explain me this strange
behaviour please ?

Cheers,
--
Nizar
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to