[Cmake-commits] [cmake-commits] lowman committed FindFLTK.cmake 1.39 1.40
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri Jan 23 00:30:24 EST 2009
Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv15599
Modified Files:
FindFLTK.cmake
Log Message:
ENH: Better support for "fltk-config" binary, added options so the user
doesn't have to have everything in order for FLTK_FOUND to be true. #7809
Index: FindFLTK.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindFLTK.cmake,v
retrieving revision 1.39
retrieving revision 1.40
diff -C 2 -d -r1.39 -r1.40
*** FindFLTK.cmake 22 Jan 2009 04:52:37 -0000 1.39
--- FindFLTK.cmake 23 Jan 2009 05:30:22 -0000 1.40
***************
*** 1,21 ****
# - Find the native FLTK includes and library
! # The following settings are defined
! # FLTK_FLUID_EXECUTABLE, where to find the Fluid tool
! # FLTK_WRAP_UI, This enables the FLTK_WRAP_UI command
! # FLTK_INCLUDE_DIR, where to find include files
! # FLTK_LIBRARIES, list of fltk libraries
! # FLTK_FOUND, Don't use FLTK if false.
! # The following settings should not be used in general.
! # FLTK_BASE_LIBRARY = the full path to fltk.lib
! # FLTK_GL_LIBRARY = the full path to fltk_gl.lib
! # FLTK_FORMS_LIBRARY = the full path to fltk_forms.lib
! # FLTK_IMAGES_LIBRARY = the full path to fltk_images.lib
!
! IF (FLTK_INCLUDE_DIR)
! # Already in cache, be silent
! SET(FLTK_FIND_QUIETLY TRUE)
! ENDIF (FLTK_INCLUDE_DIR)
! FIND_PACKAGE(OpenGL)
# Platform dependent libraries required by FLTK
--- 1,36 ----
# - Find the native FLTK includes and library
! #
! # By default FindFLTK.cmake will search for all of the FLTK components and
! # add them to the FLTK_LIBRARIES variable.
! #
! # You can limit the components which get placed in FLTK_LIBRARIES by
! # defining one or more of the following three options:
! #
! # FLTK_SKIP_OPENGL, set to true to disable searching for opengl and
! # the FLTK GL library
! # FLTK_SKIP_FORMS, set to true to disable searching for fltk_forms
! # FLTK_SKIP_IMAGES, set to true to disable searching for fltk_images
! #
! # FLTK_SKIP_FLUID, set to true if the fluid binary need not be present
! # at build time
! #
! # The following variables will be defined:
! # FLTK_FOUND, True if all components not skipped were found
! # FLTK_INCLUDE_DIR, where to find include files
! # FLTK_LIBRARIES, list of fltk libraries you should link against
! # FLTK_FLUID_EXECUTABLE, where to find the Fluid tool
! # FLTK_WRAP_UI, This enables the FLTK_WRAP_UI command
! #
! # The following cache variables are assigned but should not be used.
! # See the FLTK_LIBRARIES variable instead.
! #
! # FLTK_BASE_LIBRARY = the full path to fltk.lib
! # FLTK_GL_LIBRARY = the full path to fltk_gl.lib
! # FLTK_FORMS_LIBRARY = the full path to fltk_forms.lib
! # FLTK_IMAGES_LIBRARY = the full path to fltk_images.lib
! IF(NOT FLTK_SKIP_OPENGL)
! FIND_PACKAGE(OpenGL)
! ENDIF()
# Platform dependent libraries required by FLTK
***************
*** 118,122 ****
# Fluid
! IF(FLUID_COMMAND)
SET(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
ELSE(FLUID_COMMAND)
--- 133,137 ----
# Fluid
! IF(FLUID_COMMAND)
SET(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
ELSE(FLUID_COMMAND)
***************
*** 178,182 ****
#
! # Try to find FLTK include dir
IF(UNIX)
# Use fltk-config to generate a list of possible include directories
--- 193,198 ----
#
! # Try to find FLTK include dir using fltk-config
! #
IF(UNIX)
# Use fltk-config to generate a list of possible include directories
***************
*** 186,191 ****
EXEC_PROGRAM(${FLTK_CONFIG_SCRIPT} ARGS --cxxflags OUTPUT_VARIABLE FLTK_CXXFLAGS)
IF(FLTK_CXXFLAGS)
! STRING(REGEX REPLACE "-I" "" _FLTK_POSSIBLE_INCLUDE_DIRS ${FLTK_CXXFLAGS})
! STRING(REGEX REPLACE "-D[A-Za-z0-9_=]+" "" _FLTK_POSSIBLE_INCLUDE_DIRS ${_FLTK_POSSIBLE_INCLUDE_DIRS})
ENDIF(FLTK_CXXFLAGS)
ENDIF()
--- 202,211 ----
EXEC_PROGRAM(${FLTK_CONFIG_SCRIPT} ARGS --cxxflags OUTPUT_VARIABLE FLTK_CXXFLAGS)
IF(FLTK_CXXFLAGS)
! STRING(REGEX MATCHALL "-I[^ ]*" _fltk_temp_dirs ${FLTK_CXXFLAGS})
! STRING(REPLACE "-I" "" _fltk_temp_dirs "${_fltk_temp_dirs}")
! FOREACH(_dir ${_fltk_temp_dirs})
! STRING(STRIP ${_dir} _output)
! LIST(APPEND _FLTK_POSSIBLE_INCLUDE_DIRS ${_output})
! ENDFOREACH()
ENDIF(FLTK_CXXFLAGS)
ENDIF()
***************
*** 250,271 ****
ENDIF(FLTK_BUILT_WITH_CMAKE)
!
! SET(FLTK_FOUND 1)
! FOREACH(var FLTK_FLUID_EXECUTABLE FLTK_INCLUDE_DIR
! FLTK_BASE_LIBRARY FLTK_GL_LIBRARY
! FLTK_FORMS_LIBRARY FLTK_IMAGES_LIBRARY)
! IF(NOT ${var})
! SET(FLTK_FOUND 0)
! ENDIF(NOT ${var})
! ENDFOREACH(var)
!
! IF(FLTK_FOUND)
! SET(FLTK_LIBRARIES ${FLTK_IMAGES_LIBRARY} ${FLTK_IMAGES_LIBS} ${FLTK_BASE_LIBRARY})
! IF(FLTK_GL_LIBRARY AND OPENGL_FOUND)
LIST(APPEND FLTK_LIBRARIES ${FLTK_GL_LIBRARY} ${OPENGL_gl_LIBRARY})
LIST(APPEND FLTK_INCLUDE_DIR ${OPENGL_INCLUDE_DIR})
ENDIF()
! LIST(APPEND FLTK_LIBRARIES ${FLTK_FORMS_LIBRARY})
IF(APPLE)
SET(FLTK_LIBRARIES ${FLTK_PLATFORM_DEPENDENT_LIBS} ${FLTK_LIBRARIES})
--- 270,296 ----
ENDIF(FLTK_BUILT_WITH_CMAKE)
! # Append all of the required libraries together (by default, everything)
! SET(FLTK_LIBRARIES)
! IF(NOT FLTK_SKIP_IMAGES)
! LIST(APPEND FLTK_LIBRARIES ${FLTK_IMAGES_LIBRARY})
! ENDIF()
! IF(NOT FLTK_SKIP_FORMS)
! LIST(APPEND FLTK_LIBRARIES ${FLTK_FORMS_LIBRARY})
! ENDIF()
! IF(NOT FLTK_SKIP_OPENGL)
LIST(APPEND FLTK_LIBRARIES ${FLTK_GL_LIBRARY} ${OPENGL_gl_LIBRARY})
LIST(APPEND FLTK_INCLUDE_DIR ${OPENGL_INCLUDE_DIR})
+ LIST(REMOVE_DUPLICATES FLTK_INCLUDE_DIR)
ENDIF()
! LIST(APPEND FLTK_LIBRARIES ${FLTK_BASE_LIBRARY})
!
! INCLUDE(FindPackageHandleStandardArgs)
! IF(FLTK_SKIP_FLUID)
! FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLTK DEFAULT_MSG FLTK_LIBRARIES FLTK_INCLUDE_DIR)
! ELSE()
! FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLTK DEFAULT_MSG FLTK_LIBRARIES FLTK_INCLUDE_DIR FLTK_FLUID_EXECUTABLE)
! ENDIF()
+ IF(FLTK_FOUND)
IF(APPLE)
SET(FLTK_LIBRARIES ${FLTK_PLATFORM_DEPENDENT_LIBS} ${FLTK_LIBRARIES})
***************
*** 281,284 ****
ENDIF(FLTK_FOUND)
- INCLUDE(FindPackageHandleStandardArgs)
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLTK DEFAULT_MSG FLTK_LIBRARIES FLTK_INCLUDE_DIR)
--- 306,307 ----
More information about the Cmake-commits
mailing list