diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2015-12-30 14:37:35 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2015-12-30 14:37:35 +0000 |
| commit | 4f5e6e7732553a9689f773715074fc14420f16b0 (patch) | |
| tree | 124fa87c6cf6f76443c061a598012ed7705d7ee3 /CMake | |
| parent | 17c48175927a5fa8eea52ef09090617b3e9b20f9 (diff) | |
Harmonize configure and CMake build system (part 1).
The files "config.h" generated by configure and CMake are now almost
identical, except a few comments and some still missing or failing
config tests, for instance checks for some functions in libraries.
[Note: tested and compared on Linux.]
configh.cmake.in: Fixed many #cmakedefine and #cmakedefine01 statements
so they #define their variables as 0 or 1, or /* #undef */ it, resp.,
as it is done in the configure build.
Added tests:
- libXrender
Fixed tests:
- function glXGetProcAddressARB
Todo (still failing tests in CMake):
- HAVE_PNG_GET_VALID
- HAVE_PNG_SET_TRNS_TO_ALPHA
- HAVE_DLSYM
Other remaining issues:
- compiler flags introduced in configure/make build
- HAVE_SYS_NDIR_H - maybe missing test in configure ?
- HAVE_SYS_DIR_H - maybe missing test in configure ?
- HAVE_NDIR_H - maybe missing test in configure ?
- WORDS_BIGENDIAN and #include <mac_endianness.h> ...
i.e. Mac OS X specific #include needed or not ?
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10984 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'CMake')
| -rw-r--r-- | CMake/macros.cmake | 4 | ||||
| -rw-r--r-- | CMake/options.cmake | 30 | ||||
| -rw-r--r-- | CMake/resources.cmake | 1 |
3 files changed, 31 insertions, 4 deletions
diff --git a/CMake/macros.cmake b/CMake/macros.cmake index 86b609d15..aa76375f4 100644 --- a/CMake/macros.cmake +++ b/CMake/macros.cmake @@ -148,6 +148,10 @@ macro(CREATE_EXAMPLE NAME SOURCES LIBRARIES) target_link_libraries(${tname} ${X11_Xinerama_LIB}) endif(HAVE_XINERAMA) + if(HAVE_XRENDER) + target_link_libraries(${tname} ${X11_Xrender_LIB}) + endif(HAVE_XRENDER) + endmacro(CREATE_EXAMPLE NAME SOURCES LIBRARIES) ####################################################################### diff --git a/CMake/options.cmake b/CMake/options.cmake index 1c721d131..0aa687fef 100644 --- a/CMake/options.cmake +++ b/CMake/options.cmake @@ -58,11 +58,8 @@ if((NOT APPLE OR OPTION_APPLE_X11) AND NOT WIN32) set(USE_X11 1) list(APPEND FLTK_LDLIBS -lX11) if (X11_Xext_FOUND) - list(APPEND FLTK_LDLIBS -lXext) + list(APPEND FLTK_LDLIBS -lXext) endif(X11_Xext_FOUND) - if(X11_Xrender_FOUND) - list(APPEND FLTK_LDLIBS -lXrender) - endif(X11_Xrender_FOUND) endif(X11_FOUND) endif((NOT APPLE OR OPTION_APPLE_X11) AND NOT WIN32) @@ -137,7 +134,14 @@ endif(OPTION_USE_GL) if(OPENGL_FOUND) set(CMAKE_REQUIRED_INCLUDES ${OPENGL_INCLUDE_DIR}/GL) set(GLLIB "-lGLU -lGL") + + # check if function glXGetProcAddressARB exists + set(TEMP_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES GLU GL) CHECK_FUNCTION_EXISTS(glXGetProcAddressARB HAVE_GLXGETPROCADDRESSARB) + set(CMAKE_REQUIRED_LIBRARIES ${TEMP_REQUIRED_LIBRARIES}) + unset(TEMP_REQUIRED_LIBRARIES) + set(FLTK_GL_FOUND TRUE) else() set(FLTK_GL_FOUND FALSE) @@ -315,6 +319,24 @@ else() endif(OPTION_USE_XFT) ####################################################################### +if(X11_Xrender_FOUND) + option(OPTION_USE_XRENDER "use lib Xrender" ON) +endif(X11_Xrender_FOUND) + +if(OPTION_USE_XRENDER) + set(HAVE_XRENDER ${X11_Xrender_FOUND}) + if(HAVE_XRENDER) + include_directories(${X11_Xrender_INCLUDE_PATH}) + list(APPEND FLTK_LDLIBS -lXrender) + set(FLTK_XRENDER_FOUND TRUE) + else(HAVE_XRENDER) + set(FLTK_XRENDER_FOUND FALSE) + endif(HAVE_XRENDER) +else(OPTION_USE_XRENDER) + set(FLTK_XRENDER_FOUND FALSE) +endif(OPTION_USE_XRENDER) + +####################################################################### if(X11_FOUND) option(OPTION_USE_XDBE "use lib Xdbe" ON) endif(X11_FOUND) diff --git a/CMake/resources.cmake b/CMake/resources.cmake index c44e36a15..730f19070 100644 --- a/CMake/resources.cmake +++ b/CMake/resources.cmake @@ -49,6 +49,7 @@ mark_as_advanced(HAVE_OPENGL_GLU_H HAVE_PNG_H HAVE_PTHREAD_H) mark_as_advanced(HAVE_STDIO_H HAVE_STRINGS_H HAVE_SYS_DIR_H) mark_as_advanced(HAVE_SYS_NDIR_H HAVE_SYS_SELECT_H) mark_as_advanced(HAVE_SYS_STDTYPES_H HAVE_XDBE_H) +mark_as_advanced(HAVE_X11_XREGION_H) # where to find freetype headers find_path(FREETYPE_PATH freetype.h PATH_SUFFIXES freetype2) |
