fltk/CMake/install-symlinks.cmake.in
Albrecht Schlosser fd5cd80935 Introduce "Modern CMake" in FLTK
This is a big commit and there are too many changes to list them all.
The main changes are:

- rename all CMake build options to 'FLTK_*'
- export library targets with namespace (prefix) 'fltk::'
- standardize shared library target names with suffix '-shared'
- set public build properties on libraries for consumers
- document library names and aliases in README.CMake.txt
- document changes in "Migrating Code from FLTK 1.3 to 1.4"
- partial backwards compatibility for old user projects

Included but not directly related changes:

- fix Windows (Visual Studio) DLL build
- add CMake function fl_debug_target() to show target properties
- don't build test programs if FLTK is a subproject
- internal: reformat CMake code: remove space before '('

Thanks to Matthias and Manolo for their help, testing, and feeback.
2024-02-07 18:37:34 +01:00

34 lines
1.1 KiB
CMake

#
# Installation script to create symlinks for the FLTK project using CMake
#
# Copyright 1998-2021 by Bill Spitzak and others.
#
# 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:
#
# https://www.fltk.org/COPYING.php
#
# Please see the following page on how to report bugs and issues:
#
# https://www.fltk.org/bugs.php
# On UNIX create backward compatibility symlinks
if (NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/Fl)
EXECUTE_PROCESS(
COMMAND ln -s FL Fl
WORKING_DIRECTORY $ENV{DESTDIR}@PREFIX_INCLUDE@
)
endif (NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/Fl)
file (GLOB FLTK_HEADER_FILES $ENV{DESTDIR}@PREFIX_INCLUDE@/FL/*.H)
foreach(file ${FLTK_HEADER_FILES})
GET_FILENAME_COMPONENT(nameWE ${file} NAME_WE)
if (NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/FL/${nameWE}.h)
EXECUTE_PROCESS(
COMMAND ln -s ${nameWE}.H ${nameWE}.h
WORKING_DIRECTORY $ENV{DESTDIR}@PREFIX_INCLUDE@/FL
)
endif (NOT EXISTS $ENV{DESTDIR}@PREFIX_INCLUDE@/FL/${nameWE}.h)
endforeach(file)