2014-02-09 22:41:29 +04:00
|
|
|
#
|
2022-03-26 22:04:04 +03:00
|
|
|
# Installation support for building the FLTK project using CMake (www.cmake.org)
|
|
|
|
# Originally written by Michael Surette
|
2014-02-09 22:41:29 +04:00
|
|
|
#
|
2022-03-26 22:04:04 +03:00
|
|
|
# Copyright 1998-2022 by Bill Spitzak and others.
|
2014-02-09 22:41:29 +04:00
|
|
|
#
|
|
|
|
# This library is free software. Distribution and use rights are outlined in
|
|
|
|
# the file "COPYING" which should have been included with this file. If this
|
|
|
|
# file is missing or damaged, see the license at:
|
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# https://www.fltk.org/COPYING.php
|
2014-02-09 22:41:29 +04:00
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# Please see the following page on how to report bugs and issues:
|
2014-02-09 22:41:29 +04:00
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# https://www.fltk.org/bugs.php
|
2014-02-09 22:41:29 +04:00
|
|
|
#
|
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# installation
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
# generate uninstall target
|
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
|
|
@ONLY
|
|
|
|
)
|
2020-06-13 16:19:27 +03:00
|
|
|
add_custom_target (uninstall
|
2014-02-09 22:41:29 +04:00
|
|
|
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
|
|
)
|
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
install (DIRECTORY
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/FL
|
|
|
|
DESTINATION ${FLTK_INCLUDEDIR} USE_SOURCE_PERMISSIONS
|
2021-04-11 22:56:28 +03:00
|
|
|
FILES_MATCHING
|
|
|
|
PATTERN "*.[hH]"
|
2021-12-19 00:42:30 +03:00
|
|
|
PATTERN "fl_config.h" EXCLUDE
|
2014-02-09 22:41:29 +04:00
|
|
|
)
|
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
install (DIRECTORY
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/FL
|
|
|
|
DESTINATION ${FLTK_INCLUDEDIR} USE_SOURCE_PERMISSIONS
|
2021-04-11 22:56:28 +03:00
|
|
|
FILES_MATCHING
|
|
|
|
PATTERN "*.[hH]"
|
2015-07-12 22:23:55 +03:00
|
|
|
)
|
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
if (OPTION_CREATE_LINKS)
|
|
|
|
install (SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/install-symlinks.cmake)
|
|
|
|
endif (OPTION_CREATE_LINKS)
|
2014-02-09 22:41:29 +04:00
|
|
|
|
2014-09-27 04:41:06 +04:00
|
|
|
# generate FLTKConfig.cmake for installed directory use
|
2020-06-13 16:19:27 +03:00
|
|
|
set (INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include)
|
2021-12-20 21:18:38 +03:00
|
|
|
if (FLTK_HAVE_CAIRO)
|
|
|
|
list (APPEND INCLUDE_DIRS ${PKG_CAIRO_INCLUDE_DIRS})
|
|
|
|
endif ()
|
2014-09-27 04:41:06 +04:00
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
set (CONFIG_PATH ${CMAKE_INSTALL_PREFIX}/${FLTK_CONFIG_PATH})
|
2014-09-27 04:41:06 +04:00
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
install (EXPORT FLTK-Targets
|
|
|
|
DESTINATION ${FLTK_CONFIG_PATH}
|
|
|
|
FILE FLTK-Targets.cmake
|
2014-09-27 04:41:06 +04:00
|
|
|
)
|
|
|
|
|
|
|
|
configure_file(
|
2020-06-13 16:19:27 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/CMake/FLTKConfig.cmake.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/etc/FLTKConfig.cmake
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|
|
|
|
install (FILES
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/etc/FLTKConfig.cmake
|
|
|
|
DESTINATION ${FLTK_CONFIG_PATH}
|
2014-02-09 22:41:29 +04:00
|
|
|
)
|
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
install (FILES
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/CMake/FLTK-Functions.cmake
|
|
|
|
DESTINATION ${FLTK_CONFIG_PATH}
|
2014-02-09 22:41:29 +04:00
|
|
|
)
|
|
|
|
|
2023-12-03 19:16:11 +03:00
|
|
|
# Generate fltk-config
|
2014-02-09 22:41:29 +04:00
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
set (prefix ${CMAKE_INSTALL_PREFIX})
|
|
|
|
set (exec_prefix "\${prefix}")
|
|
|
|
set (includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
|
|
|
|
set (BINARY_DIR)
|
|
|
|
set (libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
|
|
|
|
set (srcdir ".")
|
2015-04-25 16:50:27 +03:00
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
set (LIBNAME "${libdir}/libfltk.a")
|
2015-04-25 16:50:27 +03:00
|
|
|
|
|
|
|
configure_file(
|
2020-06-13 16:19:27 +03:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/fltk-config.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/bin/fltk-config"
|
|
|
|
@ONLY
|
2015-04-25 16:50:27 +03:00
|
|
|
)
|
2020-06-13 16:19:27 +03:00
|
|
|
|
2022-03-13 23:52:18 +03:00
|
|
|
# Install fltk-config
|
|
|
|
# Note: no need to set execute perms, install (PROGRAMS) does this
|
2020-06-13 16:19:27 +03:00
|
|
|
|
|
|
|
install (PROGRAMS
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/bin/fltk-config
|
|
|
|
DESTINATION ${FLTK_BINDIR}
|
2015-04-06 16:06:21 +03:00
|
|
|
)
|
|
|
|
|
2022-03-13 23:52:18 +03:00
|
|
|
if (UNIX OR MSYS OR MINGW)
|
2020-06-13 16:19:27 +03:00
|
|
|
macro(INSTALL_MAN FILE LEVEL)
|
|
|
|
install(FILES
|
2018-01-10 23:49:03 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/documentation/src/${FILE}.man
|
2015-02-16 17:30:27 +03:00
|
|
|
DESTINATION ${FLTK_MANDIR}/man${LEVEL}
|
2014-02-09 22:41:29 +04:00
|
|
|
RENAME ${FILE}.${LEVEL}
|
2020-06-13 16:19:27 +03:00
|
|
|
)
|
|
|
|
endmacro (INSTALL_MAN FILE LEVEL)
|
2014-02-09 22:41:29 +04:00
|
|
|
|
2022-11-13 22:16:54 +03:00
|
|
|
if (FLTK_BUILD_FLUID)
|
|
|
|
INSTALL_MAN (fluid 1)
|
|
|
|
endif (FLTK_BUILD_FLUID)
|
2023-01-21 19:14:41 +03:00
|
|
|
if (FLTK_BUILD_FLTK_OPTIONS)
|
|
|
|
INSTALL_MAN (fltk-options 1)
|
|
|
|
endif (FLTK_BUILD_FLTK_OPTIONS)
|
2020-06-13 16:19:27 +03:00
|
|
|
INSTALL_MAN (fltk-config 1)
|
|
|
|
INSTALL_MAN (fltk 3)
|
2022-03-26 22:04:04 +03:00
|
|
|
|
2022-11-13 22:16:54 +03:00
|
|
|
if (FLTK_BUILD_TEST AND FLTK_BUILD_FLUID)
|
|
|
|
# Don't (!) install man pages of games (GitHub issue #23)
|
|
|
|
# INSTALL_MAN (blocks 6)
|
|
|
|
# INSTALL_MAN (checkers 6)
|
|
|
|
# INSTALL_MAN (sudoku 6)
|
|
|
|
endif ()
|
2014-02-09 22:41:29 +04:00
|
|
|
|
2022-03-13 23:52:18 +03:00
|
|
|
endif (UNIX OR MSYS OR MINGW)
|