2014-02-09 22:41:29 +04:00
|
|
|
#
|
2014-11-22 03:42:44 +03:00
|
|
|
# "$Id$"
|
2014-02-09 22:41:29 +04:00
|
|
|
#
|
|
|
|
# Main CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
|
|
|
|
# Written by Michael Surette
|
|
|
|
#
|
2018-01-10 23:49:03 +03:00
|
|
|
# Copyright 1998-2018 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:
|
|
|
|
#
|
|
|
|
# http://www.fltk.org/COPYING.php
|
|
|
|
#
|
|
|
|
# Please report all bugs and problems on the following page:
|
|
|
|
#
|
|
|
|
# http://www.fltk.org/str.php
|
|
|
|
#
|
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# installation
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
# generate uninstall target
|
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
add_custom_target(uninstall
|
|
|
|
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
|
|
)
|
|
|
|
|
2018-01-10 23:49:03 +03:00
|
|
|
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/FL
|
2015-02-16 17:30:27 +03:00
|
|
|
DESTINATION ${FLTK_INCLUDEDIR} USE_SOURCE_PERMISSIONS
|
2014-02-09 22:41:29 +04:00
|
|
|
PATTERN ".svn" EXCLUDE
|
|
|
|
)
|
|
|
|
|
2018-01-10 23:49:03 +03:00
|
|
|
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/FL
|
2015-07-12 22:23:55 +03:00
|
|
|
DESTINATION ${FLTK_INCLUDEDIR} USE_SOURCE_PERMISSIONS
|
|
|
|
)
|
|
|
|
|
2014-02-09 22:41:29 +04:00
|
|
|
if(OPTION_CREATE_LINKS)
|
2018-01-10 23:49:03 +03:00
|
|
|
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/install-symlinks.cmake)
|
2014-02-09 22:41:29 +04:00
|
|
|
endif(OPTION_CREATE_LINKS)
|
|
|
|
|
2014-09-27 04:41:06 +04:00
|
|
|
# generate FLTKConfig.cmake for installed directory use
|
|
|
|
set(INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include)
|
|
|
|
|
2014-11-24 12:35:04 +03:00
|
|
|
set(CONFIG_PATH ${CMAKE_INSTALL_PREFIX}/${FLTK_CONFIG_PATH})
|
2014-09-27 04:41:06 +04:00
|
|
|
|
|
|
|
install(EXPORT FLTK-Targets
|
|
|
|
DESTINATION ${FLTK_CONFIG_PATH}
|
|
|
|
FILE FLTK-Targets.cmake
|
|
|
|
)
|
|
|
|
|
|
|
|
configure_file(
|
2018-01-10 23:49:03 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/CMake/FLTKConfig.cmake.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/etc/FLTKConfig.cmake
|
2014-09-27 04:41:06 +04:00
|
|
|
@ONLY
|
2014-02-09 22:41:29 +04:00
|
|
|
)
|
|
|
|
|
2018-01-10 23:49:03 +03:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/etc/FLTKConfig.cmake
|
2014-09-27 04:41:06 +04:00
|
|
|
DESTINATION ${FLTK_CONFIG_PATH}
|
2014-02-09 22:41:29 +04:00
|
|
|
)
|
|
|
|
|
2014-09-27 04:41:06 +04:00
|
|
|
configure_file(
|
2018-01-10 23:49:03 +03:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/CMake/UseFLTK.cmake.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/etc/UseFLTK.cmake
|
2014-09-27 04:41:06 +04:00
|
|
|
@ONLY
|
2014-02-09 22:41:29 +04:00
|
|
|
)
|
|
|
|
|
2018-01-10 23:49:03 +03:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/etc/UseFLTK.cmake
|
2014-09-27 04:41:06 +04:00
|
|
|
DESTINATION ${FLTK_CONFIG_PATH}
|
2014-02-09 22:41:29 +04:00
|
|
|
)
|
|
|
|
|
2015-04-25 16:50:27 +03:00
|
|
|
# generate fltk-config
|
|
|
|
set(prefix ${CMAKE_INSTALL_PREFIX})
|
|
|
|
set(exec_prefix "\${prefix}")
|
|
|
|
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
|
2015-07-13 01:32:30 +03:00
|
|
|
set(BINARY_DIR)
|
2015-04-25 16:50:27 +03:00
|
|
|
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
|
|
|
|
set(srcdir ".")
|
|
|
|
|
|
|
|
set(LIBNAME "${libdir}/libfltk.a")
|
|
|
|
|
|
|
|
configure_file(
|
2018-01-10 23:49:03 +03:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/fltk-config.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/bin/fltk-config"
|
2015-04-25 16:50:27 +03:00
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
if(UNIX)
|
|
|
|
execute_process(COMMAND chmod 755 fltk-config
|
2018-01-10 23:49:03 +03:00
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin"
|
2015-04-25 16:50:27 +03:00
|
|
|
)
|
|
|
|
endif(UNIX)
|
|
|
|
|
2018-01-10 23:49:03 +03:00
|
|
|
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/bin/fltk-config
|
2015-04-06 16:06:21 +03:00
|
|
|
DESTINATION ${FLTK_BINDIR}
|
|
|
|
)
|
|
|
|
|
2015-02-16 17:30:27 +03:00
|
|
|
if(UNIX OR MSYS OR (MINGW AND CMAKE_CROSSCOMPILING))
|
2014-02-09 22:41:29 +04: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}
|
|
|
|
)
|
|
|
|
endmacro(INSTALL_MAN FILE LEVEL)
|
|
|
|
|
|
|
|
INSTALL_MAN(fluid 1)
|
|
|
|
INSTALL_MAN(fltk-config 1)
|
|
|
|
INSTALL_MAN(fltk 3)
|
|
|
|
INSTALL_MAN(blocks 6)
|
|
|
|
INSTALL_MAN(checkers 6)
|
|
|
|
INSTALL_MAN(sudoku 6)
|
|
|
|
|
2015-02-16 17:30:27 +03:00
|
|
|
endif(UNIX OR MSYS OR (MINGW AND CMAKE_CROSSCOMPILING))
|