Alexander Neundorf wrote:
> On Friday 07 November 2008, Christopher Harvey wrote:
>   
>> Hi list,
>> I wrote this library finding module. If it's good enough for cmake
>> please include it. If not let me know what's wrong with it so I can fix
>> it up. It has only had limited testing under linux. Before it's added it
>> would be nice to get some feedback about what has worked or what hasn't.
>>     
>
> Just some notes:
> You don't need to list all these search directories explicitely, most of them 
> are searched by default. Have a look at Modules/Platform/UnixPaths.cmake.
> Also instead of having a version with and one without "IL" you can use the 
> PATH_SUFFIXES option for FIND_PATH()
>
> In the end you can (should) use the find_package_handle_standard_args() macro 
> which comes with cmake >= 2.6.0 to have the standard argument handling.
>
> Alex
>   
Thanks for the valuable input. I've slimmed down my file a bit and used
the find_package_handle_standard_arg macro. It's attached to this
message. Again feel free to include it in cmake or give more input on
it. (or not, it's working for me now anyway)
# This module locates the developer's image library.
# http://openil.sourceforge.net/
#
# This module sets:
# IL_LIBRARY the name of the IL library.
# ILU_LIBRARY the name of the ILU library.
# ILUT_LIBRARY the name of the ILUT library.
# IL_INCLUDE_DIR where to find the il.h, ilu.h and ilut.h files.
# IL_FOUND this is set to TRUE if all the above variables were set.

# Original file by: Christopher Harvey

CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR) #uses FindPackageHandleStdArgs
INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)

FIND_PATH(IL_INCLUDE_DIR il.h 
  PATH_SUFFIXES include IL
  DOC "The path the the directory that contains il.h"
)

#MESSAGE("IL_INCLUDE_DIR is ${IL_INCLUDE_DIR}")

FIND_LIBRARY(IL_LIBRARY
  NAMES IL
  PATH_SUFFIXES lib64 lib lib32
  DOC "The file that corresponds to the base il library."
)

#MESSAGE("IL_LIBRARY is ${IL_LIBRARY}")

FIND_LIBRARY(ILUT_LIBRARY
  NAMES ILUT
  PATH_SUFFIXES lib64 lib lib32
  DOC "The file that corresponds to the il (system?) utility library."
)

#MESSAGE("ILUT_LIBRARY is ${ILUT_LIBRARY}")

FIND_LIBRARY(ILU_LIBRARY
  NAMES ILU
  PATH_SUFFIXES lib64 lib lib32
  DOC "The file that corresponds to the il utility library."
)

#MESSAGE("ILU_LIBRARY is ${ILU_LIBRARY}")

FIND_PACKAGE_HANDLE_STANDARD_ARGS(IL DEFAULT_MSG 
                                  IL_LIBRARY ILU_LIBRARY 
                                  ILUT_LIBRARY IL_INCLUDE_DIR)
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to