Commit 30de9b03 authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: merge in changes to 2.6 RC 10

parent cc93e325
......@@ -354,7 +354,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 6)
SET(CMake_VERSION_PATCH 3)
SET(CMake_VERSION_RC 9)
SET(CMake_VERSION_RC 10)
# CVS versions are odd, if this is an odd minor version
# then set the CMake_VERSION_DATE variable
IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
......
......@@ -5,3 +5,8 @@ set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "www.cdash.org")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=CMake")
set(CTEST_DROP_SITE_CDASH TRUE)
# use old trigger stuff so that cmake 2.4 and below will not
# get errors on trigger
SET (TRIGGER_SITE
"http://public.kitware.com/cgi-bin/Submit-CMake-TestingResults.cgi")
......@@ -2,6 +2,7 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
"xtree.[0-9]+. : warning C4702: unreachable code"
"warning LNK4221"
"warning LNK4204" # Occurs by race condition with objects in small libs
"variable .var_args[2]*. is used before its value is set"
"jobserver unavailable"
"warning: \\(Long double usage is reported only once for each file"
......
Changes in CMake 2.6.3 RC 10
- Fix issue #7470. Allow spaces in the path names for CPack NSIS.
- Fix crash with set properties and empty values
- Enforce matching cmake_policy push/pop scope in scripts
- Document find_package refind
- add unset command
- add/fix many osg modules
- Fixes for FindBoost.cmake
- Fixes for FindDoxygen.cmake
- Fixes for FindFLTK.cmake
- Fix endif in FindKDE4.cmake
- Fix HEADER_FILE_ONLY with VS and midl files #7845
- Add #7833 changes to support OSXX11 file associations
- Fix target ordering in VS IDE solution files
- Fix LOCATION property for Mac App Bundle targets
- Better diagnosis of mismatching logical blocks
- Improve scoping of policies (see cmake_policy and CMP0011)
Changes in CMake 2.6.3 RC 9
- Fix borland 55 build
- Pop a function scope even on error
......
......@@ -4,6 +4,19 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>@CPACK_FILE_ASSOCIATION_EXTENSION@</string>
</array>
<key>CFBundleTypeName</key>
<string>@CPACK_FILE_ASSOCIATION_TYPE@</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>@CPACK_PACKAGE_FILE_NAME@</string>
<key>CFBundleGetInfoString</key>
......
......@@ -5,6 +5,26 @@
CWD="`dirname \"$0\"`"
TMP=/tmp/$UID/TemporaryItems
version=`sw_vers -productVersion`
if [ "$?" == "0" ]; then
major=${version%%\.*}
rest=${version#*\.}
minor=${rest%%\.*}
build=${rest#*\.}
else
major=10
minor=4
build=0
fi
echo $version
echo "Major = $major"
echo "Minor = $minor"
echo "Build = $build"
# if 10.5 or greater, then all the open-x11 stuff need not occur
if ((( $major < 10 )) || ((( $major == 10)) && (( $minor < 5 )))); then
version=`sw_vers -productVersion`
if [ "$?" = "0" ]; then
major=${version%%\.*}
......@@ -42,6 +62,7 @@ else
echo \$DISPLAY > "$TMP/display"
fi
__END_OF_GETDISPLAY_SCRIPT__
fi
chmod +x "$TMP/getdisplay.sh"
rm -f $TMP/display
open-x11 $TMP/getdisplay.sh || \
......
......@@ -708,6 +708,7 @@ if(NOT CPACK_GENERATOR)
else(CYGWIN)
if(APPLE)
option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF)
option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag And Drop package" OFF)
option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" ON)
option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF)
else(APPLE)
......@@ -715,17 +716,18 @@ if(NOT CPACK_GENERATOR)
endif(APPLE)
option(CPACK_BINARY_STGZ "Enable to build STGZ packages" ON)
option(CPACK_BINARY_TGZ "Enable to build TGZ packages" ON)
option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" ON)
option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" OFF)
option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF)
option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF)
option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF)
endif(CYGWIN)
else(UNIX)
option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON)
option(CPACK_BINARY_ZIP "Enable to build ZIP packages" ON)
option(CPACK_BINARY_ZIP "Enable to build ZIP packages" OFF)
endif(UNIX)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_BUNDLE Bundle)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DRAGNDROP DragNDrop)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_PACKAGEMAKER PackageMaker)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_OSXX11 OSXX11)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_CYGWIN CygwinBinary)
......@@ -768,7 +770,7 @@ mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX
CPACK_BINARY_DEB CPACK_BINARY_RPM CPACK_BINARY_TZ
CPACK_BINARY_NSIS CPACK_BINARY_ZIP CPACK_BINARY_BUNDLE
CPACK_SOURCE_CYGWIN CPACK_SOURCE_TBZ2 CPACK_SOURCE_TGZ
CPACK_SOURCE_TZ CPACK_SOURCE_ZIP)
CPACK_SOURCE_TZ CPACK_SOURCE_ZIP CPACK_BINARY_DRAGNDROP)
# Set some other variables
cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS
......
This diff is collapsed.
# - Find CxxTest
# Find the CxxTest suite and declare a helper macro for creating unit tests
# and integrating them with CTest.
# For more details on CxxTest see http://cxxtest.tigris.org
#
# INPUT Variables
#
# CXXTEST_USE_PYTHON
# If true, the CXXTEST_ADD_TEST macro will use
# the Python test generator instead of Perl.
#
# OUTPUT Variables
#
# CXXTEST_FOUND
# True if the CxxTest framework was found
# CXXTEST_INCLUDE_DIR
# Where to find the CxxTest include directory
# CXXTEST_PERL_TESTGEN_EXECUTABLE
# The perl-based test generator.
# CXXTEST_PYTHON_TESTGEN_EXECUTABLE
# The python-based test generator.
#
# MACROS for use by CMake users:
#
# CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
# Creates a CxxTest runner and adds it to the CTest testing suite
# Parameters:
# test_name The name of the test
# gen_source_file The generated source filename to be generated by CxxTest
# input_files_to_testgen The list of header files containing the
# CxxTest::TestSuite's to be included in this runner
#
# #==============
# Example Usage:
#
# FIND_PACKAGE(CxxTest)
# INCLUDE_DIRECTORIES(${CXXTEST_INCLUDE_DIR})
#
# ENABLE_TESTING()
# CXXTEST_ADD_TEST(unittest_foo foo_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
#
# This will:
# 1. Invoke the testgen executable to autogenerate foo_test.cc in the
# binary tree from "foo_test.h" in the current source directory.
# 2. Create an executable and test called unittest_foo.
#
# #=============
# Example foo_test.h:
#
# #include <cxxtest/TestSuite.h>
#
# class MyTestSuite : public CxxTest::TestSuite
# {
# public:
# void testAddition( void )
# {
# TS_ASSERT( 1 + 1 > 1 );
# TS_ASSERT_EQUALS( 1 + 1, 2 );
# }
# };
#
#
# FindCxxTest.cmake
# Copyright (c) 2008
# Philip Lowman <philip@yhbt.com>
#
# Version 1.0 (1/8/08)
# Fixed CXXTEST_INCLUDE_DIRS so it will work properly
# Eliminated superfluous CXXTEST_FOUND assignment
# Cleaned up and added more documentation
#=============================================================
# CXXTEST_ADD_TEST (public macro)
#=============================================================
MACRO(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname)
SET(_cxxtest_real_outfname ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_outfname})
IF(CXXTEST_USE_PYTHON)
SET(_cxxtest_executable ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
ELSE()
SET(_cxxtest_executable ${CXXTEST_PERL_TESTGEN_EXECUTABLE})
ENDIF()
ADD_CUSTOM_COMMAND(
OUTPUT ${_cxxtest_real_outfname}
DEPENDS ${ARGN}
COMMAND ${_cxxtest_executable}
--error-printer -o ${_cxxtest_real_outfname} ${ARGN}
)
SET_SOURCE_FILES_PROPERTIES(${_cxxtest_real_outfname} PROPERTIES GENERATED true)
ADD_EXECUTABLE(${_cxxtest_testname} ${_cxxtest_real_outfname})
IF(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
ADD_TEST(${_cxxtest_testname} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_cxxtest_testname})
ELSEIF(EXECUTABLE_OUTPUT_PATH)
ADD_TEST(${_cxxtest_testname} ${EXECUTABLE_OUTPUT_PATH}/${_cxxtest_testname})
ELSE()
ADD_TEST(${_cxxtest_testname} ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_testname})
ENDIF()
ENDMACRO(CXXTEST_ADD_TEST)
#=============================================================
# main()
#=============================================================
FIND_PATH(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h)
FIND_PROGRAM(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl)
FIND_PROGRAM(CXXTEST_PYTHON_TESTGEN_EXECUTABLE cxxtestgen.py)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG CXXTEST_INCLUDE_DIR)
SET(CXXTEST_INCLUDE_DIRS ${CXXTEST_INCLUDE_DIR})
# 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
# TODO: Add version support.
# Tested under Linux and Windows (MSVC)
INCLUDE(FindPackageHandleStandardArgs)
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)
# - This module looks for Doxygen and the path to Graphviz's dot
# Doxygen is a documentation generation tool see http://www.doxygen.org
# With the OS X GUI version, it likes to be installed to /Applications and
# it contains the doxygen executable in the bundle. In the versions I've
# seen, it is located in Resources, but in general, more often binaries are
# located in MacOS. This code sets the following variables:
# DOXYGEN_EXECUTABLE = The path to the doxygen command.
# DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
# DOXYGEN_DOT_PATH = The path to dot not including the executable
# DOXYGEN = same as DOXYGEN_EXECUTABLE for backwards compatibility
# DOT = same as DOXYGEN_DOT_EXECUTABLE for backwards compatibility
# Doxygen is a documentation generation tool. Please see
# http://www.doxygen.org
#
# This module accepts the following optional variables:
#
# DOXYGEN_SKIP_DOT = If true this module will skip trying to find Dot
# (an optional component often used by Doxygen)
#
# This modules defines the following variables:
#
# DOXYGEN_EXECUTABLE = The path to the doxygen command.
# DOXYGEN_FOUND = Was Doxygen found or not?
#
# DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
# DOXYGEN_DOT_FOUND = Was Dot found or not?
# DOXYGEN_DOT_PATH = The path to dot not including the executable
#
#
# The official Doxygen.app that is distributed for OS X uses non-standard
# conventions. Instead of the command-line "doxygen" tool being placed in
# Doxygen.app/Contents/MacOS, "Doxywizard" is placed there instead and
# "doxygen" is actually placed in Contents/Resources. This is most likely
# to accomodate people who double-click on the Doxygen.app package and expect
# to see something happen. However, the CMake backend gets horribly confused
# by this. Once CMake sees the bundle, it indiscrimately uses Doxywizard
# as the executable to use. The only work-around I have found is to disable
# the app-bundle feature for only this command.
# Save the old setting
SET(TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
# Disable the App-bundle detection feature
SET(CMAKE_FIND_APPBUNDLE "NEVER")
# For backwards compatibility support
# DOXYGEN_FIND_QUIETLY, but it should have been
# Doxygen_FIND_QUIETLY.
IF(Doxygen_FIND_QUIETLY)
SET(DOXYGEN_FIND_QUIETLY TRUE)
ENDIF(Doxygen_FIND_QUIETLY)
IF (NOT DOXYGEN_FIND_QUIETLY)
MESSAGE(STATUS "Looking for doxygen...")
ENDIF (NOT DOXYGEN_FIND_QUIETLY)
# ===== Rationale for OS X AppBundle mods below =====
# With the OS X GUI version, Doxygen likes to be installed to /Applications and
# it contains the doxygen executable in the bundle. In the versions I've
# seen, it is located in Resources, but in general, more often binaries are
# located in MacOS.
#
# NOTE: The official Doxygen.app that is distributed for OS X uses non-standard
# conventions. Instead of the command-line "doxygen" tool being placed in
# Doxygen.app/Contents/MacOS, "Doxywizard" is placed there instead and
# "doxygen" is placed in Contents/Resources. This is most likely done
# so that something happens when people double-click on the Doxygen.app
# package. Unfortunately, CMake gets confused by this as when it sees the
# bundle it uses "Doxywizard" as the executable to use instead of
# "doxygen". Therefore to work-around this issue we temporarily disable
# the app-bundle feature, just for this CMake module:
if(APPLE)
# Save the old setting
SET(TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
# Disable the App-bundle detection feature
SET(CMAKE_FIND_APPBUNDLE "NEVER")
endif()
# FYI:
# In the older versions of OS X Doxygen, dot was included with the
# Doxygen bundle. But the new versions require you to download
# Graphviz.app which contains "dot" in it's bundle.
# ============== End OSX stuff ================
#
# Find Doxygen...
#
FIND_PROGRAM(DOXYGEN_EXECUTABLE
NAMES doxygen
PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\doxygen_is1;Inno Setup: App Path]/bin"
/Applications/Doxygen.app/Contents/Resources
/Applications/Doxygen.app/Contents/MacOS
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\doxygen_is1;Inno Setup: App Path]/bin"
/Applications/Doxygen.app/Contents/Resources
/Applications/Doxygen.app/Contents/MacOS
DOC "Doxygen documentation generation tool (http://www.doxygen.org)"
)
IF (DOXYGEN_EXECUTABLE)
SET (DOXYGEN_FOUND "YES")
IF (NOT DOXYGEN_FIND_QUIETLY)
MESSAGE(STATUS "Looking for doxygen... - found ${DOXYGEN_EXECUTABLE}")
ENDIF (NOT DOXYGEN_FIND_QUIETLY)
ELSE (DOXYGEN_EXECUTABLE)
IF (NOT DOXYGEN_FIND_QUIETLY)
IF (DOXYGEN_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Looking for doxygen... - NOT found")
ELSE (DOXYGEN_FIND_REQUIRED)
MESSAGE(STATUS "Looking for doxygen... - NOT found")
ENDIF (DOXYGEN_FIND_REQUIRED)
ENDIF (NOT DOXYGEN_FIND_QUIETLY)
ENDIF (DOXYGEN_EXECUTABLE)
# In the older versions of OS X Doxygen, dot was included with the
# Doxygen bundle. But the new versions place make you download Graphviz.app
# which contains dot in its bundle.
IF (NOT DOXYGEN_FIND_QUIETLY)
MESSAGE(STATUS "Looking for dot tool...")
ENDIF (NOT DOXYGEN_FIND_QUIETLY)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DOXYGEN DEFAULT_MSG DOXYGEN_EXECUTABLE)
FIND_PROGRAM(DOXYGEN_DOT_EXECUTABLE
NAMES dot
PATHS "$ENV{ProgramFiles}/Graphviz 2.21/bin"
"C:/Program Files/Graphviz 2.21/bin"
"$ENV{ProgramFiles}/ATT/Graphviz/bin"
"C:/Program Files/ATT/Graphviz/bin"
[HKEY_LOCAL_MACHINE\\SOFTWARE\\ATT\\Graphviz;InstallPath]/bin
/Applications/Graphviz.app/Contents/MacOS
/Applications/Doxygen.app/Contents/Resources
/Applications/Doxygen.app/Contents/MacOS
DOC "Graphviz Dot tool for using Doxygen"
)
#
# Find Dot...
#
IF (NOT DOXYGEN_FIND_QUIETLY)
IF (DOXYGEN_DOT_EXECUTABLE)
MESSAGE(STATUS "Looking for dot tool... - found ${DOXYGEN_DOT_EXECUTABLE}")
IF(NOT DOXYGEN_SKIP_DOT)
FIND_PROGRAM(DOXYGEN_DOT_EXECUTABLE
NAMES dot
PATHS
"$ENV{ProgramFiles}/Graphviz 2.21/bin"
"C:/Program Files/Graphviz 2.21/bin"
"$ENV{ProgramFiles}/ATT/Graphviz/bin"
"C:/Program Files/ATT/Graphviz/bin"
[HKEY_LOCAL_MACHINE\\SOFTWARE\\ATT\\Graphviz;InstallPath]/bin
/Applications/Graphviz.app/Contents/MacOS
/Applications/Doxygen.app/Contents/Resources
/Applications/Doxygen.app/Contents/MacOS
DOC "Graphviz Dot tool for using Doxygen"
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DOXYGEN_DOT DEFAULT_MSG DOXYGEN_DOT_EXECUTABLE)
if(DOXYGEN_DOT_EXECUTABLE)
# The Doxyfile wants the path to Dot, not the entire path and executable
GET_FILENAME_COMPONENT(DOXYGEN_DOT_PATH "${DOXYGEN_DOT_EXECUTABLE}" PATH CACHE)
ELSE (DOXYGEN_DOT_EXECUTABLE)
MESSAGE(STATUS "Looking for dot tool... - NOT found")
ENDIF (DOXYGEN_DOT_EXECUTABLE)
ENDIF (NOT DOXYGEN_FIND_QUIETLY)
get_filename_component(DOXYGEN_DOT_PATH "${DOXYGEN_DOT_EXECUTABLE}" PATH CACHE)
endif()
endif(NOT DOXYGEN_SKIP_DOT)
#
# Backwards compatibility...
#
if(APPLE)
# Restore the old app-bundle setting setting
SET(CMAKE_FIND_APPBUNDLE ${TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE})
endif()
# Restore the old app-bundle setting setting
SET(CMAKE_FIND_APPBUNDLE ${TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE})
# Maintain the _FOUND variables as "YES" or "NO" for backwards compatibility
# (allows people to stuff them directly into Doxyfile with configure_file())
if(DOXYGEN_FOUND)
set(DOXYGEN_FOUND "YES")
else()
set(DOXYGEN_FOUND "NO")
endif()
if(DOXYGEN_DOT_FOUND)
set(DOXYGEN_DOT_FOUND "YES")
else()
set(DOXYGEN_DOT_FOUND "NO")
endif()
# Backwards compatibility for CMake4.3 and less
# For backwards compatibility support
SET (DOXYGEN ${DOXYGEN_EXECUTABLE} )
SET (DOT ${DOXYGEN_DOT_EXECUTABLE} )
MARK_AS_ADVANCED(
DOXYGEN_FOUND
DOXYGEN_EXECUTABLE
DOXYGEN_DOT_FOUND
DOXYGEN_DOT_EXECUTABLE
DOXYGEN_DOT_PATH
)
# - 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)
#
# 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
IF(WIN32)
......@@ -87,6 +104,8 @@ IF(NOT FLTK_DIR)
# Read from the CMakeSetup registry entries. It is likely that
# FLTK will have been recently built.
# TODO: Is this really a good idea? I can already hear the user screaming, "But
# it worked when I configured the build LAST week!"
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1]
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2]
[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3]
......@@ -113,7 +132,7 @@ ENDIF(NOT FLTK_DIR)
INCLUDE(${FLTK_DIR}/FLTKConfig.cmake)
# Fluid
IF(FLUID_COMMAND)
IF(FLUID_COMMAND)
SET(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable")
ELSE(FLUID_COMMAND)
FIND_PROGRAM(FLTK_FLUID_EXECUTABLE fluid PATHS
......@@ -172,17 +191,53 @@ ENDIF(NOT FLTK_DIR)
SET(FLTK_WRAP_UI 1)
ENDIF(FLTK_FLUID_EXECUTABLE)
#
# Try to find FLTK include dir using fltk-config
#
IF(UNIX)
# Use fltk-config to generate a list of possible include directories
FIND_PROGRAM(FLTK_CONFIG_SCRIPT fltk-config PATHS ${FLTK_BIN_DIR})
IF(FLTK_CONFIG_SCRIPT)
IF(NOT FLTK_INCLUDE_DIR)
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()
ENDIF()
ENDIF()
SET(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH}
/usr/local/fltk
/usr/X11R6/include
${_FLTK_POSSIBLE_INCLUDE_DIRS}
)
FIND_PATH(FLTK_INCLUDE_DIR FL/Fl.h ${FLTK_INCLUDE_SEARCH_PATH})
FIND_PATH(FLTK_INCLUDE_DIR
NAMES FL/Fl.h FL/Fl.H # fltk 1.1.9 has Fl.H (#8376)
PATHS ${FLTK_INCLUDE_SEARCH_PATH})
#
# Try to find FLTK library
IF(UNIX)
IF(FLTK_CONFIG_SCRIPT)
EXEC_PROGRAM(${FLTK_CONFIG_SCRIPT} ARGS --libs OUTPUT_VARIABLE _FLTK_POSSIBLE_LIBS)
IF(_FLTK_POSSIBLE_LIBS)
GET_FILENAME_COMPONENT(_FLTK_POSSIBLE_LIBRARY_DIR ${_FLTK_POSSIBLE_LIBS} PATH)
ENDIF()
ENDIF()