summaryrefslogtreecommitdiff
path: root/CMake/variables.cmake
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2018-02-24 13:44:06 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2018-02-24 13:44:06 +0000
commitc9d4df288ceab6061d46dd1a5db36abcf8dc721a (patch)
tree2bac7ac615574e44d2fc651579ad385cf440a012 /CMake/variables.cmake
parent7d1488507d110e567f57610894e9ce5d0eaebf2b (diff)
CMake: fix fltk-config generation for MacOS.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12687 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'CMake/variables.cmake')
-rw-r--r--CMake/variables.cmake27
1 files changed, 23 insertions, 4 deletions
diff --git a/CMake/variables.cmake b/CMake/variables.cmake
index 9719435cf..60e14a5f2 100644
--- a/CMake/variables.cmake
+++ b/CMake/variables.cmake
@@ -25,6 +25,8 @@ set (FL_PATCH_VERSION ${FLTK_VERSION_PATCH})
set (DEBUG_VARIABLES_CMAKE 0)
if (DEBUG_VARIABLES_CMAKE)
message (STATUS "[** variables.cmake **]")
+ fl_debug_var (HAVE_DLSYM)
+ fl_debug_var (CMAKE_DL_LIBS)
fl_debug_var (CMAKE_EXE_LINKER_FLAGS)
fl_debug_var (LDFLAGS)
fl_debug_var (LIBS)
@@ -40,14 +42,28 @@ endif (DEBUG_VARIABLES_CMAKE)
#######################################################################
# add several libraries
# FIXME: libraries may need reordering.
+# FIXME: check fontconfig conditions (only if Xft is used or ...)
+
+if (WIN32)
+ list (APPEND FLTK_LDLIBS -lole32 -luuid -lcomctl32)
+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)
if (LIB_fontconfig)
list(APPEND FLTK_LDLIBS -lfontconfig)
endif (LIB_fontconfig)
-if (HAVE_DLSYM AND NOT WIN32)
- list(APPEND FLTK_LDLIBS -ldl)
-endif (HAVE_DLSYM AND NOT WIN32)
+# 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)
#######################################################################
# Set variables for fltk-config (generated from fltk-config.in)
@@ -123,7 +139,7 @@ foreach(arg ${FLTK_LDLIBS})
set(LINK_LIBS "${LINK_LIBS} ${arg}")
endforeach(arg ${FLTK_LDLIBS})
-set(LIBS ${LINK_LIBS})
+set(LIBS "${LINK_LIBS}")
if (${CMAKE_SYSTEM_NAME} STREQUAL "AIX")
set(SHAREDSUFFIX "_s")
@@ -132,6 +148,9 @@ else ()
endif (${CMAKE_SYSTEM_NAME} STREQUAL "AIX")
if (DEBUG_VARIABLES_CMAKE)
+ message (STATUS "") # empty line
+ fl_debug_var (HAVE_DLSYM)
+ fl_debug_var (CMAKE_DL_LIBS)
fl_debug_var (CMAKE_EXE_LINKER_FLAGS)
fl_debug_var (LDFLAGS)
fl_debug_var (LIBS)