diff --git a/CMake/options.cmake b/CMake/options.cmake index a4f781332..6957350b4 100644 --- a/CMake/options.cmake +++ b/CMake/options.cmake @@ -221,7 +221,6 @@ endif (UNIX) ####################################################################### if (APPLE) - option (OPTION_APPLE_X11 "use X11" OFF) if (CMAKE_OSX_SYSROOT) list (APPEND FLTK_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT}") endif (CMAKE_OSX_SYSROOT) @@ -229,7 +228,7 @@ endif (APPLE) # find X11 libraries and headers set (PATH_TO_XLIBS) -if ((NOT APPLE OR OPTION_APPLE_X11) AND NOT WIN32) +if (NOT APPLE AND NOT WIN32) include (FindX11) if (X11_FOUND) set (USE_X11 1) @@ -239,22 +238,7 @@ if ((NOT APPLE OR OPTION_APPLE_X11) AND NOT WIN32) endif (X11_Xext_FOUND) get_filename_component (PATH_TO_XLIBS ${X11_X11_LIB} PATH) endif (X11_FOUND) -endif ((NOT APPLE OR OPTION_APPLE_X11) AND NOT WIN32) - -if (OPTION_APPLE_X11) - if (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) # a.k.a. macOS version ≥ 10.13 - list (APPEND FLTK_CFLAGS "-D_LIBCPP_HAS_THREAD_API_PTHREAD") - endif (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) - include_directories (AFTER SYSTEM /opt/X11/include/freetype2) - if (PATH_TO_XLIBS) - set (LDFLAGS "-L${PATH_TO_XLIBS} ${LDFLAGS}") - endif (PATH_TO_XLIBS) - if (X11_INCLUDE_DIR) - set (TEMP_INCLUDE_DIR ${X11_INCLUDE_DIR}) - list (TRANSFORM TEMP_INCLUDE_DIR PREPEND "-I") - list (APPEND FLTK_CFLAGS "${TEMP_INCLUDE_DIR}") - endif (X11_INCLUDE_DIR) -endif (OPTION_APPLE_X11) +endif (NOT APPLE AND NOT WIN32) ####################################################################### option (OPTION_USE_POLL "use poll if available" OFF) @@ -375,17 +359,10 @@ if (HAVE_GL) endif (HAVE_GL) if (OPTION_USE_GL) - if (OPTION_APPLE_X11) - set (OPENGL_FOUND TRUE) - set (OPENGL_LIBRARIES -L${PATH_TO_XLIBS} -lGLU -lGL) - unset(HAVE_GL_GLU_H CACHE) - find_file (HAVE_GL_GLU_H GL/glu.h PATHS ${X11_INCLUDE_DIR}) - else() - include (FindOpenGL) - if (APPLE) - set (HAVE_GL_GLU_H ${HAVE_OPENGL_GLU_H}) - endif (APPLE) - endif (OPTION_APPLE_X11) + include (FindOpenGL) + if (APPLE) + set (HAVE_GL_GLU_H ${HAVE_OPENGL_GLU_H}) + endif (APPLE) else () set (OPENGL_FOUND FALSE) endif (OPTION_USE_GL) @@ -401,7 +378,7 @@ if (OPENGL_FOUND) if (WIN32) set (GLLIBS "-lglu32 -lopengl32") - elseif (APPLE AND NOT OPTION_APPLE_X11) + elseif (APPLE) set (GLLIBS "-framework OpenGL") else () set (GLLIBS "-lGLU -lGL") @@ -545,9 +522,6 @@ if (OPTION_USE_XFT) set (USE_XFT X11_Xft_FOUND) list (APPEND FLTK_LDLIBS -lXft) set (FLTK_XFT_FOUND TRUE) - if (APPLE AND OPTION_APPLE_X11) - find_library(LIB_fontconfig fontconfig "/opt/X11/lib") - endif (APPLE AND OPTION_APPLE_X11) else() set (FLTK_XFT_FOUND FALSE) endif (OPTION_USE_XFT) diff --git a/CMake/resources.cmake b/CMake/resources.cmake index 57173f206..bb059d9d2 100644 --- a/CMake/resources.cmake +++ b/CMake/resources.cmake @@ -163,9 +163,9 @@ mark_as_advanced (FREETYPE_PATH) ####################################################################### # libraries find_library (LIB_dl dl) -if ((NOT APPLE) OR OPTION_APPLE_X11) +if (NOT APPLE) find_library (LIB_fontconfig fontconfig) -endif ((NOT APPLE) OR OPTION_APPLE_X11) +endif (NOT APPLE) find_library (LIB_freetype freetype) find_library (LIB_GL GL) find_library (LIB_MesaGL MesaGL) diff --git a/CMake/setup.cmake b/CMake/setup.cmake index 60b7da109..ea1a6ea16 100644 --- a/CMake/setup.cmake +++ b/CMake/setup.cmake @@ -59,7 +59,7 @@ set (FLTK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc CACHE PATH # set where config files go if (WIN32 AND NOT CYGWIN) set (FLTK_CONFIG_PATH CMake) -elseif (APPLE AND NOT OPTION_APPLE_X11) +elseif (APPLE) set (FLTK_CONFIG_PATH FLTK.framework/Resources/CMake) else () set (FLTK_CONFIG_PATH ${FLTK_DATADIR}/fltk) @@ -75,17 +75,9 @@ if (APPLE) set (HAVE_VSNPRINTF 1) set (HAVE_SCANDIR 1) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") - if (OPTION_APPLE_X11) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U__APPLE__") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U__APPLE__") - if (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) # a.k.a. macOS version ≥ 10.13 - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_HAS_THREAD_API_PTHREAD") - endif (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) - else () - set (__APPLE_QUARTZ__ 1) - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa") - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework Cocoa") - endif (OPTION_APPLE_X11) + set (__APPLE_QUARTZ__ 1) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa") + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework Cocoa") endif (APPLE) if (WIN32) diff --git a/CMake/variables.cmake b/CMake/variables.cmake index 27672c7d5..0360d06d3 100644 --- a/CMake/variables.cmake +++ b/CMake/variables.cmake @@ -41,7 +41,7 @@ endif (DEBUG_VARIABLES_CMAKE) if (WIN32) list (APPEND FLTK_LDLIBS -lole32 -luuid -lcomctl32 -lws2_32) -elseif (APPLE AND NOT OPTION_APPLE_X11) +elseif (APPLE) list (APPEND FLTK_LDLIBS "-framework Cocoa") else () list (APPEND FLTK_LDLIBS -lm)