Index: CMake/FLTKConfig.cmake.in
===================================================================
--- CMake/FLTKConfig.cmake.in	(revision 10112)
+++ CMake/FLTKConfig.cmake.in	(working copy)
@@ -1,49 +1,18 @@
 #
 # FLTKConfig.cmake - FLTK CMake configuration file for external projects.
 #
-# This file is configured by FLTK and used by the UseFLTK.cmake module
-# to load FLTK's settings for an external project.
+# This file is generated by CMake and used to load FLTK's settings for an external project.
+# It defines the following variables
+#  FLTK_INCLUDE_DIRS - FLTK include directories
+#  FLTK_LIBRARIES    - list of FLTK libraries built
+#  FLTK_FLUID_EXECUTABLE needed by fltk_wrap_ui()
+#  FLTK_USE_FILE - sets things up to use FLTK
 
-set(FLTK_FOUND TRUE)
 set(FLTK_VERSION @FLTK_VERSION_FULL@)
 
-set(FLTK_FLUID_EXECUTABLE "@FLTK_FLUID_PATH@")
+include(${CMAKE_CURRENT_LIST_DIR}/FLTK-Targets.cmake)
 
-if("@EXE_LINKER_FLAGS@" MATCHES "[-_A-Za-z0-9]+"))
-   set(FLTK_EXE_LINKER_FLAGS "@EXE_LINKER_FLAGS@")
-endif("@EXE_LINKER_FLAGS@" MATCHES "[-_A-Za-z0-9]+")
-
-set(FLTK_USE_FILE "@PREFIX_CONFIG@/UseFLTK.cmake")
-
-set(FLTK_DIR "@PREFIX_CONFIG@")
-
-set(FLTK_BIN_DIR "@PREFIX_BIN@")
-set(FLTK_LIB_DIR "@PREFIX_LIB@")
-set(FLTK_INCLUDE_DIR "@PREFIX_INCLUDE@")
-set(FLTK_DATA_DIR "@PREFIX_DATA@")
-set(FLTK_DOC_DIR "@PREFIX_DOC@")
-
-set(FLTK_SHARED_LIBS_FOUND @OPTION_BUILD_SHARED_LIBS@)
-set(FLTK_CAIRO_FOUND @FLTK_CAIRO_FOUND@)
-set(FLTK_GL_FOUND @FLTK_GL_FOUND@)
-set(FLTK_THREADS_FOUND @FLTK_THREADS_FOUND@)
-set(FLTK_PTHREADS_FOUND @FLTK_PTHREADS_FOUND@)
-set(FLTK_BUILTIN_JPEG_FOUND @FLTK_BUILTIN_JPEG_FOUND@)
-set(FLTK_BUILTIN_ZLIB_FOUND @FLTK_BUILTIN_ZLIB_FOUND@)
-set(FLTK_BUILTIN_PNG_FOUND @FLTK_BUILTIN_PNG_FOUND@)
-set(FLTK_XINERAMA_FOUND @FLTK_XINERAMA_FOUND@)
-set(FLTK_XFT_FOUND @FLTK_XFT_FOUND@)
-set(FLTK_XDBE_FOUND @FLTK_XDBE_FOUND@)
-
-set(FLTK_CAIRO_FOUND @FLTK_CAIRO_FOUND@)
-set(FLTK_GL_FOUND @FLTK_GL_FOUND@)
-set(FLTK_THREADS_FOUND @FLTK_THREADS_FOUND@)
-set(FLTK_PTHREADS_FOUND @FLTK_PTHREADS_FOUND@)
-set(FLTK_BUILTIN_JPEG_FOUND @FLTK_BUILTIN_JPEG_FOUND@)
-set(FLTK_BUILTIN_ZLIB_FOUND @FLTK_BUILTIN_ZLIB_FOUND@)
-set(FLTK_BUILTIN_PNG_FOUND @FLTK_BUILTIN_PNG_FOUND@)
-set(FLTK_XINERAMA_FOUND @FLTK_XINERAMA_FOUND@)
-set(FLTK_XFT_FOUND @FLTK_XFT_FOUND@)
-set(FLTK_XDBE_FOUND @FLTK_XDBE_FOUND@)
-
-include("@PREFIX_CONFIG@/FLTKLibraries.cmake")
+set(FLTK_INCLUDE_DIRS "@INCLUDE_DIRS@")
+set(FLTK_LIBRARIES "@FLTK_LIBRARIES@")
+set(FLTK_FLUID_EXECUTABLE "@FLUID_EXECUTABLE@")
+set(FLTK_USE_FILE ${CMAKE_CURRENT_LIST_DIR}/UseFLTK.cmake)
Index: CMake/UseFLTK.cmake.in
===================================================================
--- CMake/UseFLTK.cmake.in	(revision 10112)
+++ CMake/UseFLTK.cmake.in	(working copy)
@@ -1,8 +1,8 @@
 #
+# UseFLTK.CMake - FLTK CMake environment configuration file for external projects.
+#
+# This file is generated by CMake and used to set FLTK's environment for an external project.
+#
 # automatically generated - do not edit
 
-include_directories("@PREFIX_INCLUDE@")
-
-if(FLTK_EXE_LINKER_FLAGS)
-   list(APPEND CMAKE_EXE_LINKER_FLAGS "${FLTK_EXE_LINKER_FLAGS}")
-endif(FLTK_EXE_LINKER_FLAGS)
+include_directories("@INCLUDE_DIRS@")
Index: CMake/export.cmake
===================================================================
--- CMake/export.cmake	(revision 10112)
+++ CMake/export.cmake	(working copy)
@@ -28,31 +28,44 @@
       NO_CMAKE_FIND_ROOT_PATH
    )
    add_executable(fluid IMPORTED)
+   set(FLUID_IMPORTED true)
    set(FLTK_FLUID_EXECUTABLE ${FLUID_PATH})
-   set(FLTK_FLUID_PATH ${FLUID_PATH})
    set_target_properties(fluid
       PROPERTIES IMPORTED_LOCATION ${FLUID_PATH}
    )
 else()
    add_subdirectory(fluid)
+   set(FLUID_IMPORTED false)
    set(FLTK_FLUID_EXECUTABLE fluid)
-   set(FLTK_FLUID_PATH ${PREFIX_BIN}/fluid)
 endif(CMAKE_CROSSCOMPILING)
 
 add_subdirectory(src)
 
-# generate FLTKConfig.cmake
-string(REPLACE ";" " " EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
+# generate FLTK-Targets.cmake for build directory use
+export(TARGETS fluid ${FLTK_LIBRARIES} FILE ${CMAKE_BINARY_DIR}/FLTK-Targets.cmake)
+
+# generate FLTKConfig.cmake for build directory use
+if(FLUID_IMPORTED)
+    get_property(fluid FLUID_EXECUTABLE PROPERTY IMPORTED_LOCATION)
+else()
+    set(FLUID_EXECUTABLE
+        ${EXECUTABLE_OUTPUT_PATH}/fluid${CMAKE_EXECUTABLE_SUFFIX}
+    )
+endif(FLUID_IMPORTED)
+
+set(INCLUDE_DIRS "@FLTK_INCLUDE_DIRS@")
+set(CONFIG_PATH @FLTK_BINARY_DIR@)
+
 configure_file(
    ${FLTK_SOURCE_DIR}/CMake/FLTKConfig.cmake.in
-   ${EXECUTABLE_OUTPUT_PATH}/FLTKConfig.cmake
+   ${FLTK_BINARY_DIR}/FLTKConfig.cmake
    @ONLY
 )
 
-# generate UseFLTK.cmake
+# generate UseFLTK.cmake for build directory use
 configure_file(
    ${FLTK_SOURCE_DIR}/CMake/UseFLTK.cmake.in
-   ${EXECUTABLE_OUTPUT_PATH}/UseFLTK.cmake
+   ${FLTK_BINARY_DIR}/UseFLTK.cmake
    @ONLY
 )
 
@@ -92,4 +105,3 @@
       @ONLY
    )
 endif(OPTION_CREATE_LINKS)
-#
Index: CMake/install.cmake
===================================================================
--- CMake/install.cmake	(revision 10112)
+++ CMake/install.cmake	(working copy)
@@ -32,7 +32,7 @@
 )
 
 install(DIRECTORY ${FLTK_SOURCE_DIR}/FL
-   DESTINATION ${PREFIX_INCLUDE} USE_SOURCE_PERMISSIONS
+   DESTINATION include USE_SOURCE_PERMISSIONS
    PATTERN ".svn" EXCLUDE
 )
 
@@ -40,24 +40,43 @@
    install(SCRIPT ${FLTK_BINARY_DIR}/install-symlinks.cmake)
 endif(OPTION_CREATE_LINKS)
 
-install(PROGRAMS ${FLTK_BINARY_DIR}/fltk-config
-   DESTINATION ${PREFIX_BIN}
-   OPTIONAL
+# generate FLTKConfig.cmake for installed directory use
+set(INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include)
+
+set(CONFIG_PATH ${CMAKE_INSTALL_PREFIX}/@FLTK_CONFIG_PATH@)
+if(FLUID_IMPORTED)
+    get_property(fluid FLUID_EXECUTABLE PROPERTY IMPORTED_LOCATION)
+else()
+    set(FLUID_EXECUTABLE
+        ${CMAKE_INSTALL_PREFIX}/bin/fluid${CMAKE_EXECUTABLE_SUFFIX}
+    )
+endif(FLUID_IMPORTED)
+
+install(EXPORT FLTK-Targets
+   DESTINATION ${FLTK_CONFIG_PATH}
+   FILE FLTK-Targets.cmake
 )
 
-install(EXPORT fltk-install
-   DESTINATION ${PREFIX_CONFIG}
-   FILE FLTKLibraries.cmake
+configure_file(
+   ${FLTK_SOURCE_DIR}/CMake/FLTKConfig.cmake.in
+   ${FLTK_BINARY_DIR}/etc/FLTKConfig.cmake
+   @ONLY
 )
 
-install(FILES ${EXECUTABLE_OUTPUT_PATH}/FLTKConfig.cmake
-   DESTINATION ${PREFIX_CONFIG}
+install(FILES ${FLTK_BINARY_DIR}/etc/FLTKConfig.cmake
+   DESTINATION ${FLTK_CONFIG_PATH}
 )
 
-install(FILES ${EXECUTABLE_OUTPUT_PATH}/UseFLTK.cmake
-   DESTINATION ${PREFIX_CONFIG}
+configure_file(
+   ${FLTK_SOURCE_DIR}/CMake/UseFLTK.cmake.in
+   ${FLTK_BINARY_DIR}/etc/UseFLTK.cmake
+   @ONLY
 )
 
+install(FILES ${FLTK_BINARY_DIR}/etc/UseFLTK.cmake
+   DESTINATION ${FLTK_CONFIG_PATH}
+)
+
 if(CMAKE_HOST_UNIX)
    macro(INSTALL_MAN FILE LEVEL)
    install(FILES
Index: CMake/options.cmake
===================================================================
--- CMake/options.cmake	(revision 10112)
+++ CMake/options.cmake	(working copy)
@@ -34,98 +34,8 @@
 add_definitions(${OPTION_ARCHFLAGS})
 
 #######################################################################
-set(OPTION_PREFIX_BIN ""
-   CACHE STRING
-   "where to install executables - leave empty to use {CMAKE_INSTALL_PREFIX}/bin"
-   )
-
-if(OPTION_PREFIX_BIN)
-   set(PREFIX_BIN ${OPTION_PREFIX_BIN} CACHE INTERNAL "" FORCE)
-else()
-   set(PREFIX_BIN ${CMAKE_INSTALL_PREFIX}/bin CACHE INTERNAL "" FORCE)
-endif(OPTION_PREFIX_BIN)
-
 #######################################################################
-set(OPTION_PREFIX_LIB ""
-   CACHE STRING
-   "where to install libraries - leave empty to use {CMAKE_INSTALL_PREFIX}/lib"
-   )
-
-if(OPTION_PREFIX_LIB)
-   set(PREFIX_LIB ${OPTION_PREFIX_LIB} CACHE INTERNAL "" FORCE)
-else()
-   set(PREFIX_LIB ${CMAKE_INSTALL_PREFIX}/lib CACHE INTERNAL "" FORCE)
-endif(OPTION_PREFIX_LIB)
-
-#######################################################################
-set(OPTION_PREFIX_INCLUDE ""
-   CACHE STRING
-   "where to install include files - leave empty to use {CMAKE_INSTALL_PREFIX}/include"
-   )
-
-if(OPTION_PREFIX_INCLUDE)
-   set(PREFIX_INCLUDE ${OPTION_PREFIX_INCLUDE} CACHE INTERNAL "" FORCE)
-else()
-   set(PREFIX_INCLUDE ${CMAKE_INSTALL_PREFIX}/include CACHE INTERNAL "" FORCE)
-endif(OPTION_PREFIX_INCLUDE)
-
-#######################################################################
-set(OPTION_PREFIX_DATA ""
-   CACHE STRING
-   "where to install data files - leave empty to use {CMAKE_INSTALL_PREFIX}/share/FLTK"
-   )
-
-if(OPTION_PREFIX_DATA)
-   set(PREFIX_DATA ${OPTION_PREFIX_DATA} CACHE INTERNAL "" FORCE)
-else()
-   set(PREFIX_DATA ${CMAKE_INSTALL_PREFIX}/share/FLTK CACHE INTERNAL "" FORCE)
-endif(OPTION_PREFIX_DATA)
-
-#######################################################################
-set(OPTION_PREFIX_DOC ""
-   CACHE STRING
-   "where to install doc files - leave empty to use {CMAKE_INSTALL_PREFIX}/share/doc/FLTK"
-   )
-
-if(OPTION_PREFIX_DOC)
-   set(PREFIX_DOC ${OPTION_PREFIX_DOC} CACHE INTERNAL "" FORCE)
-else()
-   set(PREFIX_DOC ${CMAKE_INSTALL_PREFIX}/share/doc/FLTK CACHE INTERNAL "" FORCE)
-endif(OPTION_PREFIX_DOC)
-
-#######################################################################
-if(WIN32)
-   set(DEFAULT_CONFIG "${CMAKE_INSTALL_PREFIX}/CMake")
-elseif(APPLE)
-   set(DEFAULT_CONFIG "${CMAKE_INSTALL_PREFIX}/FLTK/.framework/Resources/CMake")
-else()
-   set(DEFAULT_CONFIG "${CMAKE_INSTALL_PREFIX}/lib/FLTK-${FLTK_VERSION}")
-endif(WIN32)
-
-set(OPTION_PREFIX_CONFIG ""
-   CACHE STRING
-   "where to install CMake config files - leave empty to use ${DEFAULT_CONFIG}"
-   )
-
-if(OPTION_PREFIX_CONFIG)
-   set(PREFIX_CONFIG "${OPTION_PREFIX_CONFIG}" CACHE INTERNAL "" FORCE)
-else()
-   set(PREFIX_CONFIG "${DEFAULT_CONFIG}" CACHE INTERNAL "" FORCE)
-endif(OPTION_PREFIX_CONFIG)
-
-#######################################################################
 if(CMAKE_HOST_UNIX)
-   set(OPTION_PREFIX_MAN ""
-      CACHE STRING
-      "where to install man files - leave empty to use {CMAKE_INSTALL_PREFIX}/man"
-      )
-
-   if(OPTION_PREFIX_MAN)
-      set(PREFIX_MAN ${OPTION_PREFIX_MAN} CACHE INTERNAL "" FORCE)
-   else()
-      set(PREFIX_MAN ${CMAKE_INSTALL_PREFIX}/man CACHE INTERNAL "" FORCE)
-   endif(OPTION_PREFIX_MAN)
-
    option(OPTION_CREATE_LINKS "create backwards compatibility links" OFF)
 endif(CMAKE_HOST_UNIX)
 
Index: CMake/setup.cmake
===================================================================
--- CMake/setup.cmake	(revision 10112)
+++ CMake/setup.cmake	(working copy)
@@ -34,12 +34,25 @@
 # Search for modules in the FLTK source dir first
 set(CMAKE_MODULE_PATH "${FLTK_SOURCE_DIR}/CMake")
 
-include_directories(${FLTK_BINARY_DIR} ${FLTK_SOURCE_DIR})
+set(FLTK_INCLUDE_DIRS ${FLTK_BINARY_DIR} ${FLTK_SOURCE_DIR})
+include_directories(${FLTK_INCLUDE_DIRS})
 
 #######################################################################
 # platform dependent information
 #######################################################################
 
+# set where config and example files go
+if(WIN32 AND NOT CYGWIN)
+   set(FLTK_CONFIG_PATH CMake)
+   set(FLTK_EXAMPLES_PATH examples)
+elseif(APPLE)
+   set(FLTK_CONFIG_PATH FLTK/.framework/Resources/CMake)
+   set(FLTK_EXAMPLES_PATH share/fltk-examples)
+else()
+   set(FLTK_CONFIG_PATH lib/fltk)
+   set(FLTK_EXAMPLES_PATH share/fltk-examples)
+endif(WIN32 AND NOT CYGWIN)
+
 include(TestBigEndian)
 TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
 
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 10112)
+++ CMakeLists.txt	(working copy)
@@ -18,7 +18,7 @@
 #
 
 project(FLTK)
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.6)
 
 #######################################################################
 # basic setup
Index: README.CMake.txt
===================================================================
--- README.CMake.txt	(revision 10112)
+++ README.CMake.txt	(working copy)
@@ -98,16 +98,6 @@
 OPTION_ARCHFLAGS
    Extra architecture flags.
 
-OPTION_PREFIX_BIN
-OPTION_PREFIX_LIB
-OPTION_PREFIX_INCLUDE
-OPTION_PREFIX_DATA
-OPTION_PREFIX_DOC
-OPTION_PREFIX_CONFIG
-OPTION_PREFIX_MAN
-   The OPTION_PREFIX_* flags are for fine-tuning where everything goes
-   on the install.
-
 OPTION_APPLE_X11 - default OFF
    In case you want to use X11 on OSX.  Not currently supported.
 
@@ -218,6 +208,11 @@
  USING CMAKE WITH FLTK
 =======================
 
+The CMake Export/Import facility can be thought of as a cross-platform,
+automated fltk-config.  For example, if you link your program to the fltk
+library, it will automatically link in all of its dependencies.  This 
+includes any special flags.  ie on Linux it includes the -lpthread flag.
+
 This howto assumes that you have FLTK libraries which were built using
 CMake, installed.  Building them with CMake generates some CMake helper
 files which are installed in standard locations, making FLTK easy to find
@@ -231,6 +226,12 @@
 
 project(hello)
 
+# the following line is required only if you don't install FLTK
+# or if find_package can't find your installation directory
+# it points to the build directory or the base folder, 
+# not the library folder.
+set(FLTK_DIR /path/to/fltk)
+
 find_package(FLTK REQUIRED NO_MODULE)
 include(${FLTK_USE_FILE})
 
@@ -240,6 +241,8 @@
 
 ------
 
+The set(FLTK_DIR ...) command is a superhint to the find_package command.
+This is very useful if you don't install or have a non-standard install.
 The find_package command tells CMake to find the package FLTK, REQUIRED
 means that it is an error if it's not found.  NO_MODULE tells it to search
 only for the FLTKConfig file, not using the FindFLTK.cmake supplied with
@@ -246,15 +249,12 @@
 CMake, which doesn't work with this version of FLTK.
 
 Once the package is found we include the ${FLTK_USE_FILE} which adds the
-FLTK include directories and library link information to its knowledge
-base.  After that your programs will be able to find FLTK headers and
-when you link the fltk library, it automatically links the libraries
-fltk depends on.
+FLTK include directories to its knowledge base.  After that your programs 
+will be able to find FLTK headers.
 
 The WIN32 in the add_executable tells your Windows compiler that this is
 a gui app.  It is ignored on other platforms.
 
-
  LIBRARY NAMES
 ---------------
 
@@ -301,3 +301,4 @@
 
 Dec 20 2010 - matt: merged and restructures
 May 15 2013 - erco: small formatting tweaks, added some examples
+Feb 23 2014 - msurette: updated to reflect changes to the CMake files
Index: cairo/CMakeLists.txt
===================================================================
--- cairo/CMakeLists.txt	(revision 10112)
+++ cairo/CMakeLists.txt	(working copy)
@@ -9,7 +9,7 @@
 
 #######################################################################
 add_library(fltk_cairo ${cairo_SRCS})
-
+list(APPEND FLTK_LIBRARIES fltk_cairo)
 if(MSVC)
    set_target_properties(fltk_cairo
       PROPERTIES
@@ -22,6 +22,10 @@
 endif(MSVC)
 
 install(TARGETS fltk_cairo
-   EXPORT fltk-install
-   DESTINATION ${PREFIX_LIB}
+    EXPORT FLTK-Targets
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib
 )
+
+set(FLTK_LIBRARIES ${FLTK_LIBRARIES} PARENT_SCOPE)
Index: fluid/CMakeLists.txt
===================================================================
--- fluid/CMakeLists.txt	(revision 10112)
+++ fluid/CMakeLists.txt	(working copy)
@@ -43,6 +43,8 @@
 endif(HAVE_XINERAMA)
 
 install(TARGETS fluid
-   EXPORT fltk-install
-   DESTINATION ${PREFIX_BIN}
+    EXPORT FLTK-Targets
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib
 )
Index: jpeg/CMakeLists.txt
===================================================================
--- jpeg/CMakeLists.txt	(revision 10112)
+++ jpeg/CMakeLists.txt	(working copy)
@@ -33,7 +33,7 @@
 
 #######################################################################
 add_library(fltk_jpeg ${systemdependent_SRCS} ${common_SRCS} ${compression_SRCS} ${decompression_SRCS})
-
+list(APPEND FLTK_LIBRARIES fltk_jpeg)
 if(MSVC)
    set_target_properties(fltk_jpeg
       PROPERTIES
@@ -46,6 +46,10 @@
 endif(MSVC)
 
 install(TARGETS fltk_jpeg
-   EXPORT fltk-install
-   DESTINATION ${PREFIX_LIB}
+    EXPORT FLTK-Targets
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib
 )
+
+set(FLTK_LIBRARIES ${FLTK_LIBRARIES} PARENT_SCOPE)
Index: png/CMakeLists.txt
===================================================================
--- png/CMakeLists.txt	(revision 10112)
+++ png/CMakeLists.txt	(working copy)
@@ -1,8 +1,6 @@
 project(FLTKPNG)
-include_regular_expression("^png.*[.][c|h]$")
 
 include_directories(${FLTKZLIB_SOURCE_DIR})
-include_directories(${ZLIB_INCLUDE_DIR})
 
 include_directories(${FLTKPNG_SOURCE_DIR})
 include_directories(${FLTKPNG_BINARY_DIR})
@@ -17,7 +15,7 @@
 
 #######################################################################
 add_library(fltk_png ${PNG_SRCS})
-
+list(APPEND FLTK_LIBRARIES fltk_png)
 if(MSVC)
    set_target_properties(fltk_png PROPERTIES OUTPUT_NAME fltkpng)
    if(OPTION_LARGE_FILE)
@@ -27,9 +25,13 @@
    set_target_properties(fltk_png PROPERTIES OUTPUT_NAME fltk_png)
 endif(MSVC)
 
-target_link_libraries(fltk_png ${FLTK_ZLIB_LIBRARIES})
+target_link_libraries(fltk_png)
 
 install(TARGETS fltk_png
-   EXPORT fltk-install
-   DESTINATION ${PREFIX_LIB}
+    EXPORT FLTK-Targets
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib
 )
+
+set(FLTK_LIBRARIES ${FLTK_LIBRARIES} PARENT_SCOPE)
Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt	(revision 10112)
+++ src/CMakeLists.txt	(working copy)
@@ -208,6 +208,7 @@
 #######################################################################
 add_library(fltk STATIC ${CPPFILES} ${MMFILES} ${CFILES} fl_call_main.c)
 set_target_properties(fltk PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+list(APPEND LIBRARIES fltk)
 if(MSVC)
    if(OPTION_LARGE_FILE)
       set_target_properties(fltk PROPERTIES LINK_FLAGS /LARGEADDRESSAWARE)
@@ -257,6 +258,7 @@
 set_target_properties(fltk_forms
    PROPERTIES CLEAN_DIRECT_OUTPUT 1
 )
+list(APPEND LIBRARIES fltk_forms)
 if(MSVC)
    if(OPTION_LARGE_FILE)
       set_target_properties(fltk_forms PROPERTIES LINK_FLAGS /LARGEADDRESSAWARE)
@@ -273,6 +275,7 @@
 target_link_libraries(fltk_images fltk ${FLTK_PNG_LIBRARIES}
      ${FLTK_JPEG_LIBRARIES} ${FLTK_ZLIB_LIBRARIES})
 set_target_properties(fltk_images PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+list(APPEND LIBRARIES fltk_images)
 if(MSVC)
    if(OPTION_LARGE_FILE)
       set_target_properties(fltk_images PROPERTIES LINK_FLAGS /LARGEADDRESSAWARE)
@@ -285,16 +288,11 @@
 endif(MSVC)
 
 #######################################################################
-install(TARGETS fltk fltk_forms fltk_images
-   EXPORT fltk-install
-   DESTINATION ${PREFIX_LIB}
-)
-
-#######################################################################
 if(OPENGL_FOUND)
    add_library(fltk_gl STATIC ${GLCPPFILES})
    target_link_libraries(fltk_gl fltk ${OPENGL_LIBRARIES})
    set_target_properties(fltk_gl PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+   list(APPEND LIBRARIES fltk_gl)
    if(MSVC)
       if(OPTION_LARGE_FILE)
          set_target_properties(fltk_gl PROPERTIES LINK_FLAGS /LARGEADDRESSAWARE)
@@ -306,10 +304,6 @@
       )
    endif(MSVC)
 
-   install(TARGETS fltk_gl
-      EXPORT fltk-install
-      DESTINATION ${PREFIX_LIB}
-   )
 endif(OPENGL_FOUND)
 
 #######################################################################
@@ -323,6 +317,7 @@
    VERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}
    SOVERSION ${FLTK_VERSION_PATCH}
 )
+list(APPEND LIBRARIES fltk_SHARED)
 if(MSVC)
    set_target_properties(fltk_SHARED
       PROPERTIES
@@ -373,6 +368,7 @@
    VERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}
    SOVERSION ${FLTK_VERSION_PATCH}
 )
+list(APPEND LIBRARIES fltk_forms_SHARED)
 if(MSVC)
    set_target_properties(fltk_forms_SHARED
       PROPERTIES
@@ -405,6 +401,7 @@
    VERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}
    SOVERSION ${FLTK_VERSION_PATCH}
 )
+list(APPEND LIBRARIES fltk_images_SHARED)
 if(MSVC)
    set_target_properties(fltk_images_SHARED
       PROPERTIES
@@ -420,12 +417,6 @@
 endif(MSVC)
 
 #######################################################################
-install(TARGETS fltk_SHARED fltk_forms_SHARED fltk_images_SHARED
-   EXPORT fltk-install
-   DESTINATION ${PREFIX_LIB}
-)
-
-#######################################################################
 if(OPENGL_FOUND)
    add_library(fltk_gl_SHARED SHARED ${GLCPPFILES})
    target_link_libraries(fltk_gl_SHARED fltk_SHARED ${OPENGL_LIBRARIES})
@@ -434,6 +425,7 @@
       VERSION ${FLTK_VERSION_MAJOR}.${FLTK_VERSION_MINOR}
       SOVERSION ${FLTK_VERSION_PATCH}
    )
+   list(APPEND LIBRARIES fltk_gl_SHARED)
    if(MSVC)
       set_target_properties(fltk_gl_SHARED
          PROPERTIES
@@ -448,10 +440,16 @@
       set_target_properties(fltk_gl_SHARED PROPERTIES OUTPUT_NAME fltk_gl)
    endif(MSVC)
 
-   install(TARGETS fltk_gl_SHARED
-      EXPORT fltk-install
-      DESTINATION ${PREFIX_LIB}
-   )
 endif(OPENGL_FOUND)
 
 endif(OPTION_BUILD_SHARED_LIBS)
+
+install(TARGETS ${LIBRARIES}
+    EXPORT FLTK-Targets
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib
+)
+
+list(APPEND FLTK_LIBRARIES ${LIBRARIES})
+set(FLTK_LIBRARIES ${FLTK_LIBRARIES} PARENT_SCOPE)
Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt	(revision 10112)
+++ test/CMakeLists.txt	(working copy)
@@ -46,7 +46,7 @@
    endif(HAVE_XINERAMA)
 
    install(TARGETS ${NAME}
-      DESTINATION ${PREFIX_DOC}/examples
+      DESTINATION ${FLTK_EXAMPLES_PATH}
       )
 endmacro(CREATE_EXAMPLE NAME SOURCES LIBRARIES)
 
Index: zlib/CMakeLists.txt
===================================================================
--- zlib/CMakeLists.txt	(revision 10112)
+++ zlib/CMakeLists.txt	(working copy)
@@ -1,5 +1,4 @@
 project(FLTKZLIB)
-include_regular_expression(regex_match "[.][h|c]$")
 
 include_directories(${FLTKZLIB_SOURCE_DIR})
 include_directories(${FLTKZLIB_BINARY_DIR})
@@ -14,7 +13,7 @@
 
 #######################################################################
 add_library(fltk_z ${ZLIB_SRCS})
-
+list(APPEND FLTK_LIBRARIES fltk_z)
 if(MSVC)
    set_target_properties(fltk_z
       PROPERTIES
@@ -27,6 +26,10 @@
 endif(MSVC)
 
 install(TARGETS fltk_z
-   EXPORT fltk-install
-   DESTINATION ${PREFIX_LIB}
+    EXPORT FLTK-Targets
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib
 )
+
+set(FLTK_LIBRARIES ${FLTK_LIBRARIES} PARENT_SCOPE)
