2015-04-25 16:50:27 +03:00
|
|
|
#
|
|
|
|
# This file sets variables for common use in export.cmake and install.cmake
|
|
|
|
# Written by Michael Surette
|
|
|
|
#
|
2020-06-13 16:19:27 +03:00
|
|
|
# Copyright 1998-2020 by Bill Spitzak and others.
|
2015-04-25 16:50:27 +03: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
|
2015-04-25 16:50:27 +03:00
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# Please see the following page on how to report bugs and issues:
|
2015-04-25 16:50:27 +03:00
|
|
|
#
|
2020-07-01 19:03:10 +03:00
|
|
|
# https://www.fltk.org/bugs.php
|
2015-04-25 16:50:27 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
#######################################################################
|
2018-02-23 22:41:52 +03:00
|
|
|
|
|
|
|
set (DEBUG_VARIABLES_CMAKE 0)
|
|
|
|
if (DEBUG_VARIABLES_CMAKE)
|
|
|
|
message (STATUS "[** variables.cmake **]")
|
2018-02-24 16:44:06 +03:00
|
|
|
fl_debug_var (HAVE_DLSYM)
|
|
|
|
fl_debug_var (CMAKE_DL_LIBS)
|
2018-02-23 22:41:52 +03:00
|
|
|
fl_debug_var (CMAKE_EXE_LINKER_FLAGS)
|
|
|
|
fl_debug_var (LDFLAGS)
|
|
|
|
fl_debug_var (LIBS)
|
|
|
|
fl_debug_var (GLLIBS)
|
|
|
|
fl_debug_var (IMAGELIBS)
|
|
|
|
fl_debug_var (STATICIMAGELIBS)
|
|
|
|
fl_debug_var (FLTK_LDLIBS)
|
|
|
|
fl_debug_var (LIB_jpeg)
|
|
|
|
fl_debug_var (LIB_png)
|
|
|
|
fl_debug_var (LIB_zlib)
|
|
|
|
endif (DEBUG_VARIABLES_CMAKE)
|
2015-04-25 16:50:27 +03:00
|
|
|
|
|
|
|
#######################################################################
|
2018-02-23 22:41:52 +03:00
|
|
|
# add several libraries
|
|
|
|
# FIXME: libraries may need reordering.
|
2018-02-24 16:44:06 +03:00
|
|
|
# FIXME: check fontconfig conditions (only if Xft is used or ...)
|
|
|
|
|
|
|
|
if (WIN32)
|
2018-06-19 13:33:41 +03:00
|
|
|
list (APPEND FLTK_LDLIBS -lole32 -luuid -lcomctl32 -lws2_32)
|
2018-02-24 16:44:06 +03:00
|
|
|
elseif (APPLE AND OPTION_APPLE_SDL)
|
|
|
|
# FIXME: do nothing?
|
|
|
|
elseif (APPLE AND NOT OPTION_APPLE_X11)
|
|
|
|
list (APPEND FLTK_LDLIBS "-framework Cocoa")
|
|
|
|
else ()
|
|
|
|
list (APPEND FLTK_LDLIBS -lm)
|
|
|
|
endif (WIN32)
|
2015-04-25 16:50:27 +03:00
|
|
|
|
2018-02-23 22:41:52 +03:00
|
|
|
if (LIB_fontconfig)
|
|
|
|
list(APPEND FLTK_LDLIBS -lfontconfig)
|
|
|
|
endif (LIB_fontconfig)
|
2015-04-25 16:50:27 +03:00
|
|
|
|
2018-02-24 16:44:06 +03:00
|
|
|
# add "-ldl" or whatever is necessary according to CMake (CMAKE_DL_LIBS)
|
|
|
|
if (HAVE_DLSYM)
|
|
|
|
foreach (LIB ${CMAKE_DL_LIBS})
|
|
|
|
list (APPEND FLTK_LDLIBS "-l${LIB}")
|
|
|
|
endforeach ()
|
|
|
|
endif (HAVE_DLSYM)
|
2015-04-25 16:50:27 +03:00
|
|
|
|
2018-02-23 22:41:52 +03:00
|
|
|
#######################################################################
|
|
|
|
# Set variables for fltk-config (generated from fltk-config.in)
|
|
|
|
#######################################################################
|
|
|
|
|
|
|
|
# Variables in fltk-config.in (@VAR@) are used in configure(.ac)
|
|
|
|
# and in CMake so their names and usage must be synchronized.
|
|
|
|
# CMake generates two instances of fltk-config, one that can be used
|
|
|
|
# directly in the build tree (see export.cmake) and one that is copied
|
|
|
|
# to the installation directory (see install.cmake). Common variables
|
|
|
|
# should be set here, whereas variables with different values should
|
|
|
|
# be set in install.cmake or export.cmake, respectively.
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
set (LDFLAGS "${CMAKE_EXE_LINKER_FLAGS} -mwindows")
|
|
|
|
endif ()
|
2015-04-25 16:50:27 +03:00
|
|
|
|
2018-02-23 22:41:52 +03:00
|
|
|
set (IMAGELIBS)
|
|
|
|
set (STATICIMAGELIBS)
|
2015-04-25 16:50:27 +03:00
|
|
|
|
2018-02-23 22:41:52 +03:00
|
|
|
if (FLTK_BUILTIN_JPEG_FOUND)
|
2020-06-13 16:19:27 +03:00
|
|
|
list (APPEND IMAGELIBS -lfltk_jpeg)
|
|
|
|
list (APPEND STATICIMAGELIBS \$libdir/libfltk_jpeg.a)
|
2018-02-23 22:41:52 +03:00
|
|
|
else ()
|
|
|
|
if (LIB_jpeg)
|
2020-06-13 16:19:27 +03:00
|
|
|
list (APPEND IMAGELIBS -ljpeg)
|
|
|
|
list (APPEND STATICIMAGELIBS -ljpeg)
|
2018-02-23 22:41:52 +03:00
|
|
|
endif (LIB_jpeg)
|
|
|
|
endif (FLTK_BUILTIN_JPEG_FOUND)
|
|
|
|
|
|
|
|
if (FLTK_BUILTIN_PNG_FOUND)
|
2020-06-13 16:19:27 +03:00
|
|
|
list (APPEND IMAGELIBS -lfltk_png)
|
|
|
|
list (APPEND STATICIMAGELIBS \$libdir/libfltk_png.a)
|
2018-02-23 22:41:52 +03:00
|
|
|
else ()
|
|
|
|
if (LIB_png)
|
2020-06-13 16:19:27 +03:00
|
|
|
list (APPEND IMAGELIBS -lpng)
|
|
|
|
list (APPEND STATICIMAGELIBS -lpng)
|
2018-02-23 22:41:52 +03:00
|
|
|
endif (LIB_png)
|
|
|
|
endif (FLTK_BUILTIN_PNG_FOUND)
|
|
|
|
|
|
|
|
if (FLTK_BUILTIN_ZLIB_FOUND)
|
2020-06-13 16:19:27 +03:00
|
|
|
list (APPEND IMAGELIBS -lfltk_z)
|
|
|
|
list (APPEND STATICIMAGELIBS \$libdir/libfltk_z.a)
|
2018-02-23 22:41:52 +03:00
|
|
|
else ()
|
|
|
|
if (LIB_zlib)
|
2020-06-13 16:19:27 +03:00
|
|
|
list (APPEND IMAGELIBS -lz)
|
|
|
|
list (APPEND STATICIMAGELIBS -lz)
|
2018-02-23 22:41:52 +03:00
|
|
|
endif (LIB_zlib)
|
|
|
|
endif (FLTK_BUILTIN_ZLIB_FOUND)
|
2015-04-25 16:50:27 +03:00
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
string (REPLACE ";" " " IMAGELIBS "${IMAGELIBS}")
|
|
|
|
string (REPLACE ";" " " STATICIMAGELIBS "${STATICIMAGELIBS}")
|
2015-04-25 16:50:27 +03:00
|
|
|
|
|
|
|
#######################################################################
|
2020-06-13 16:19:27 +03:00
|
|
|
set (CC ${CMAKE_C_COMPILER})
|
|
|
|
set (CXX ${CMAKE_CXX_COMPILER})
|
2015-04-25 16:50:27 +03:00
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
set (ARCHFLAGS ${OPTION_ARCHFLAGS})
|
2015-04-25 16:50:27 +03:00
|
|
|
|
|
|
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_UPPER)
|
2018-02-23 22:41:52 +03:00
|
|
|
if (${BUILD_UPPER})
|
2018-02-25 22:25:45 +03:00
|
|
|
set (CFLAGS "${CMAKE_C_FLAGS_${BUILD_UPPER}} ${CFLAGS}")
|
2018-02-23 22:41:52 +03:00
|
|
|
endif (${BUILD_UPPER})
|
2015-04-25 23:36:48 +03:00
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
set (CFLAGS "${OPTION_OPTIM} ${CMAKE_C_FLAGS} ${CFLAGS}")
|
|
|
|
foreach (arg ${FLTK_CFLAGS})
|
|
|
|
set (CFLAGS "${CFLAGS} ${arg}")
|
|
|
|
endforeach (arg ${FLTK_CFLAGS})
|
2015-04-25 16:50:27 +03:00
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
set (CXXFLAGS "${CFLAGS}")
|
2015-04-25 16:50:27 +03:00
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
foreach (arg ${FLTK_LDLIBS})
|
|
|
|
set (LINK_LIBS "${LINK_LIBS} ${arg}")
|
|
|
|
endforeach (arg ${FLTK_LDLIBS})
|
2015-04-25 16:50:27 +03:00
|
|
|
|
2020-06-13 16:19:27 +03:00
|
|
|
set (LIBS "${LINK_LIBS}")
|
2015-04-25 16:50:27 +03:00
|
|
|
|
2015-04-25 23:36:48 +03:00
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "AIX")
|
2020-06-13 16:19:27 +03:00
|
|
|
set (SHAREDSUFFIX "_s")
|
2015-04-25 23:36:48 +03:00
|
|
|
else ()
|
2020-06-13 16:19:27 +03:00
|
|
|
set (SHAREDSUFFIX "")
|
2015-04-25 23:36:48 +03:00
|
|
|
endif (${CMAKE_SYSTEM_NAME} STREQUAL "AIX")
|
2018-02-23 22:41:52 +03:00
|
|
|
|
|
|
|
if (DEBUG_VARIABLES_CMAKE)
|
2018-02-24 16:44:06 +03:00
|
|
|
message (STATUS "") # empty line
|
|
|
|
fl_debug_var (HAVE_DLSYM)
|
|
|
|
fl_debug_var (CMAKE_DL_LIBS)
|
2018-02-23 22:41:52 +03:00
|
|
|
fl_debug_var (CMAKE_EXE_LINKER_FLAGS)
|
|
|
|
fl_debug_var (LDFLAGS)
|
|
|
|
fl_debug_var (LIBS)
|
|
|
|
fl_debug_var (GLLIBS)
|
|
|
|
fl_debug_var (IMAGELIBS)
|
|
|
|
fl_debug_var (STATICIMAGELIBS)
|
|
|
|
fl_debug_var (FLTK_LDLIBS)
|
|
|
|
fl_debug_var (LIB_jpeg)
|
|
|
|
fl_debug_var (LIB_png)
|
|
|
|
fl_debug_var (LIB_zlib)
|
|
|
|
message (STATUS "[** end of variables.cmake **]")
|
|
|
|
endif (DEBUG_VARIABLES_CMAKE)
|
|
|
|
unset (DEBUG_VARIABLES_CMAKE)
|