[CMake] Creating a find module for gtkglextmm

onionbla cacoubabenba at yahoo.com
Sun Jul 29 11:24:58 EDT 2012


Hi :) ,

I'm trying to create a .cmake-find module for gtkglextmm, but when trying to
use it, it fails:

CMake Error at
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find gtkglextmm (missing: GTKGLEXTMM_LIBRARY)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:252
(_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/Findgtkglextmm.cmake:23
(find_package_handle_standard_args)
  CMakeLists.txt:16 (find_package)

In my cmake file I integrate the gtkglextmm library like this:
find_package (gtkglextmm REQUIRED)
include_directories(${GTKGLEXTMM_INCLUDE_DIR})
set(LIBS ${LIBS} ${GTKGLEXTMM_LIBRARIES})

The find module looks like this:
find_package(PkgConfig)
pkg_check_modules(PC_GTKGLEXTMM QUIET gtkglextmm-1.2)
set(GTKGLEXTMM_DEFINITIONS ${PC_GTKGLEXTMM_CFLAGS_OTHER})

find_path(GTKGLEXTMM_INCLUDE_DIR gtkglmm.h
        HINTS ${PC_GTKGLEXTMM_INCLUDEDIR} ${PC_GTKGLEXTMM_INCLUDE_DIRS}
        PATH_SUFFIXES gtkglextmm-1.2)

find_library(GTKGLEXTMM_LIBRARY NAMES libgtkglextmm-1.2 gtkglextmm-1.2 
        HINTS ${PC_GTKGLEXTMM_LIBDIR} ${PC_GTKGLEXTMM_LIBRARY_DIRS})
        
set(GTKGLEXTMM_LIBRARIES ${GTKGLEXTMM_LIBRARY})
set(GTKGLEXTMM_INCLUDE_DIRS ${GTXGLEXTMM_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(gtkglextmm DEFAULT_MSG
        GTKGLEXTMM_LIBRARY GTKGLEXTMM_INCLUDE_DIR)
        
mark_as_advanced(GTKGLEXTMM_INCLUDE_DIR GTKGLEXTMM_LIBRARY)

So the question is, how can I make this work?
And if get it to work, what is the best way, to make this solution available
for others?

Thanks for any help :)



--
View this message in context: http://cmake.3232098.n2.nabble.com/Creating-a-find-module-for-gtkglextmm-tp7581002.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list