From: verbalshadow Date: Sat, 3 May 2008 20:15:46 +0000 (+0000) Subject: Cmake: Fixed HAVE_CAIRO_PDF and moved ConfigChecks to it's own file X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=373c381026c690490f908c7537122fb30cacf9fc;p=inkscape.git Cmake: Fixed HAVE_CAIRO_PDF and moved ConfigChecks to it's own file --- diff --git a/CMakeScripts/ConfigChecks.cmake b/CMakeScripts/ConfigChecks.cmake new file mode 100644 index 000000000..184239cd8 --- /dev/null +++ b/CMakeScripts/ConfigChecks.cmake @@ -0,0 +1,70 @@ +#--------------- +# From here on: +# Set all HAVE_XXX variables, to correctly set all defines in config.h + +INCLUDE (CheckIncludeFiles) +INCLUDE (CheckFunctionExists) +INCLUDE (CheckStructMember) +# usage: CHECK_INCLUDE_FILES (
) +# usage: CHECK_FUNCTION_EXISTS ( ) +# usage: CHECK_STRUCT_MEMBER (
) + +CHECK_INCLUDE_FILES(boost/concept_check.hpp HAVE_BOOST_CONCEPT_CHECK_HPP) +CHECK_INCLUDE_FILES(cairo-pdf.h HAVE_CAIRO_PDF) +CHECK_FUNCTION_EXISTS(floor HAVE_FLOOR) +CHECK_FUNCTION_EXISTS(fpsetmask HAVE_FPSETMASK) +CHECK_INCLUDE_FILES(gc/gc.h HAVE_GC_GC_H) +CHECK_INCLUDE_FILES(gc.h HAVE_GC_H) +CHECK_INCLUDE_FILES(getopt.h HAVE_GETOPT_H) +CHECK_FUNCTION_EXISTS(gettext HAVE_GETTEXT) +CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) +CHECK_FUNCTION_EXISTS(gtk_window_fullscreen HAVE_GTK_WINDOW_FULLSCREEN) +CHECK_FUNCTION_EXISTS(gtk_window_set_default_icon_from_file HAVE_GTK_WINDOW_SET_DEFAULT_ICON_FROM_FILE) +CHECK_INCLUDE_FILES(ieeefp.h HAVE_IEEEFP_H) +CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H) +CHECK_INCLUDE_FILES(locale.h HAVE_LC_MESSAGES) +CHECK_INCLUDE_FILES(locale.h HAVE_LOCALE_H) +CHECK_INCLUDE_FILES(libintl.h HAVE_LIBINTL_H) +CHECK_INCLUDE_FILES(fcntl.h HAVE_FCNTL_H) +CHECK_FUNCTION_EXISTS(mallinfo HAVE_MALLINFO) +CHECK_INCLUDE_FILES(malloc.h HAVE_MALLOC_H) +CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE) +CHECK_INCLUDE_FILES(memory.h HAVE_MEMORY_H) +CHECK_FUNCTION_EXISTS(memset HAVE_MEMSET) +CHECK_FUNCTION_EXISTS(mkdir HAVE_MKDIR) +CHECK_FUNCTION_EXISTS(pow HAVE_POW) +CHECK_FUNCTION_EXISTS(sqrt HAVE_SQRT) +CHECK_INCLUDE_FILES(stddef.h HAVE_STDDEF_H) +CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H) +CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H) +CHECK_INCLUDE_FILES(strings.h HAVE_STRINGS_H) +CHECK_INCLUDE_FILES(string.h HAVE_STRING_H) +CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP) +CHECK_FUNCTION_EXISTS(strpbrk HAVE_STRPBRK) +CHECK_FUNCTION_EXISTS(strrchr HAVE_STRRCHR) +CHECK_FUNCTION_EXISTS(strspn HAVE_STRSPN) +CHECK_FUNCTION_EXISTS(strstr HAVE_STRSTR) +CHECK_FUNCTION_EXISTS(strtoul HAVE_STRTOUL) +CHECK_STRUCT_MEMBER(fordblks mallinfo malloc.h HAVE_STRUCT_MALLINFO_FORDBLKS) +CHECK_STRUCT_MEMBER(fsmblks mallinfo malloc.h HAVE_STRUCT_MALLINFO_FSMBLKS) +CHECK_STRUCT_MEMBER(hblkhd mallinfo malloc.h HAVE_STRUCT_MALLINFO_HBLKHD) +CHECK_STRUCT_MEMBER(uordblks mallinfo malloc.h HAVE_STRUCT_MALLINFO_UORDBLKS) +CHECK_STRUCT_MEMBER(usmblks mallinfo malloc.h HAVE_STRUCT_MALLINFO_USMBLKS) +CHECK_INCLUDE_FILES(sys/filio.h HAVE_SYS_FILIO_H) +CHECK_INCLUDE_FILES(sys/stat.h HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H) +CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H) +CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H) +CHECK_INCLUDE_FILES(zlib.h HAVE_ZLIB_H) + +#Enable pango defines, necessary for compilation on Win32, how about Linux? +# yes but needs to be done a better way +IF (HAVE_CAIRO_PDF) + SET(PANGO_ENABLE_ENGINE TRUE) + SET(RENDER_WITH_PANGO_CAIRO TRUE) +ENDIF(HAVE_CAIRO_PDF) + +# Create the two configuration files: config.h and inkscape_version.h +# Create them in the binary root dir +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) +FILE(WRITE ${CMAKE_BINARY_DIR}/inkscape_version.h "#define INKSCAPE_VERSION \"${INKSCAPE_VERSION}\"\n") diff --git a/CMakeScripts/ConfigCompileFlags.cmake b/CMakeScripts/ConfigCompileFlags.cmake index d100dd466..c5447df49 100644 --- a/CMakeScripts/ConfigCompileFlags.cmake +++ b/CMakeScripts/ConfigCompileFlags.cmake @@ -8,7 +8,6 @@ IF (ENABLE_PROFILING) SET(LINK_PROFILING_FLAGS "-pg") ENDIF (ENABLE_PROFILING) - ADD_DEFINITIONS(-DVERSION=\\\"${INKSCAPE_VERSION}\\\") ADD_DEFINITIONS(${DEFINE_FLAGS} -DHAVE_CONFIG_H -D_INTL_REDIRECT_INLINE) @@ -23,8 +22,3 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILE_PROFILING_FLAGS} ") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILE_PROFILING_FLAGS} ") SET(CMAKE_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM} ") -#Linking check -message(STATUS "@XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") -message(STATUS "${INKSCAPE_LINK_FLAGS}") -message(STATUS "@XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") - diff --git a/CMakeScripts/ConfigInkscapeDepends.cmake b/CMakeScripts/ConfigInkscapeDepends.cmake index 450bc1fb7..1f0eac639 100644 --- a/CMakeScripts/ConfigInkscapeDepends.cmake +++ b/CMakeScripts/ConfigInkscapeDepends.cmake @@ -1,6 +1,6 @@ SET(INKSCAPE_DEPENDS # the commented out below are required but pulled in with gtk+-2.0 & gtkmm-2.4 -# with some duplication that we can only remove if lookup each sub-lib individaully +# with some duplication that we can only remove if lookup each sub-lib individually # cairo # cairomm-1.0 # glib-2.0 @@ -79,74 +79,8 @@ ENDFOREACH(opt) message(STATUS "") message(STATUS "") -SET(CMAKE_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM} -j2") - -#--------------- -# From here on: -# Set all HAVE_XXX variables, to correctly set all defines in config.h - -INCLUDE (CheckIncludeFiles) -INCLUDE (CheckFunctionExists) -INCLUDE (CheckStructMember) -# usage: CHECK_INCLUDE_FILES (
) -# usage: CHECK_FUNCTION_EXISTS ( ) -# usage: CHECK_STRUCT_MEMBER (
) - -CHECK_INCLUDE_FILES(boost/concept_check.hpp HAVE_BOOST_CONCEPT_CHECK_HPP) -CHECK_INCLUDE_FILES(cairo-pdf.h HAVE_CAIRO_PDF) -CHECK_FUNCTION_EXISTS(floor HAVE_FLOOR) -CHECK_FUNCTION_EXISTS(fpsetmask HAVE_FPSETMASK) -CHECK_INCLUDE_FILES(gc/gc.h HAVE_GC_GC_H) -CHECK_INCLUDE_FILES(gc.h HAVE_GC_H) -CHECK_INCLUDE_FILES(getopt.h HAVE_GETOPT_H) -CHECK_FUNCTION_EXISTS(gettext HAVE_GETTEXT) -CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) -CHECK_FUNCTION_EXISTS(gtk_window_fullscreen HAVE_GTK_WINDOW_FULLSCREEN) -CHECK_FUNCTION_EXISTS(gtk_window_set_default_icon_from_file HAVE_GTK_WINDOW_SET_DEFAULT_ICON_FROM_FILE) -CHECK_INCLUDE_FILES(ieeefp.h HAVE_IEEEFP_H) -CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H) -CHECK_INCLUDE_FILES(locale.h HAVE_LC_MESSAGES) -CHECK_INCLUDE_FILES(locale.h HAVE_LOCALE_H) -CHECK_INCLUDE_FILES(libintl.h HAVE_LIBINTL_H) -CHECK_INCLUDE_FILES(fcntl.h HAVE_FCNTL_H) -CHECK_FUNCTION_EXISTS(mallinfo HAVE_MALLINFO) -CHECK_INCLUDE_FILES(malloc.h HAVE_MALLOC_H) -CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE) -CHECK_INCLUDE_FILES(memory.h HAVE_MEMORY_H) -CHECK_FUNCTION_EXISTS(memset HAVE_MEMSET) -CHECK_FUNCTION_EXISTS(mkdir HAVE_MKDIR) -CHECK_FUNCTION_EXISTS(pow HAVE_POW) -CHECK_FUNCTION_EXISTS(sqrt HAVE_SQRT) -CHECK_INCLUDE_FILES(stddef.h HAVE_STDDEF_H) -CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H) -CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H) -CHECK_INCLUDE_FILES(strings.h HAVE_STRINGS_H) -CHECK_INCLUDE_FILES(string.h HAVE_STRING_H) -CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP) -CHECK_FUNCTION_EXISTS(strpbrk HAVE_STRPBRK) -CHECK_FUNCTION_EXISTS(strrchr HAVE_STRRCHR) -CHECK_FUNCTION_EXISTS(strspn HAVE_STRSPN) -CHECK_FUNCTION_EXISTS(strstr HAVE_STRSTR) -CHECK_FUNCTION_EXISTS(strtoul HAVE_STRTOUL) -CHECK_STRUCT_MEMBER(fordblks mallinfo malloc.h HAVE_STRUCT_MALLINFO_FORDBLKS) -CHECK_STRUCT_MEMBER(fsmblks mallinfo malloc.h HAVE_STRUCT_MALLINFO_FSMBLKS) -CHECK_STRUCT_MEMBER(hblkhd mallinfo malloc.h HAVE_STRUCT_MALLINFO_HBLKHD) -CHECK_STRUCT_MEMBER(uordblks mallinfo malloc.h HAVE_STRUCT_MALLINFO_UORDBLKS) -CHECK_STRUCT_MEMBER(usmblks mallinfo malloc.h HAVE_STRUCT_MALLINFO_USMBLKS) -CHECK_INCLUDE_FILES(sys/filio.h HAVE_SYS_FILIO_H) -CHECK_INCLUDE_FILES(sys/stat.h HAVE_SYS_STAT_H) -CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H) -CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H) -CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H) -CHECK_INCLUDE_FILES(zlib.h HAVE_ZLIB_H) - -#Enable pango defines, necessary for compilation on Win32, how about Linux? -IF (HAVE_CAIRO_PDF) - SET(PANGO_ENABLE_ENGINE TRUE) - SET(RENDER_WITH_PANGO_CAIRO TRUE) -ENDIF(HAVE_CAIRO_PDF) - -# Create the two configuration files: config.h and inkscape_version.h -# Create them in the binary root dir -CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) -FILE(WRITE ${CMAKE_BINARY_DIR}/inkscape_version.h "#define INKSCAPE_VERSION \"${INKSCAPE_VERSION}\"\n") +SET(CMAKE_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM} -j2") + +INCLUDE(ConfigCompileFlags) +INCLUDE(ConfigChecks) + diff --git a/CMakeScripts/ConfigPaths.cmake b/CMakeScripts/ConfigPaths.cmake index ec3985e3f..aac3fc00b 100644 --- a/CMakeScripts/ConfigPaths.cmake +++ b/CMakeScripts/ConfigPaths.cmake @@ -13,7 +13,7 @@ SET(CMAKE_SKIP_RPATH:BOOL OFF) # Include base dir, so other files can refer to the generated files. # CMAKE_INCLUDE_CURRENT_DIR is not enough as it only includes the current dir and not the basedir with config.h in it INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}" "${PROJECT_SOURCE_DIR}" src/) -LINK_DIRECTORIES ("${CMAKE_BINARY_DIR}" "${PROJECT_SOURCE_DIR}" src/) +LINK_DIRECTORIES ("${LINK_DIRECTORIES}" "${CMAKE_BINARY_DIR}" "${PROJECT_SOURCE_DIR}" src/) #INSTALL(TARGETS INKSCAPE # RUNTIME DESTINATION bin diff --git a/CMakeScripts/FindBoost.cmake b/CMakeScripts/FindBoost.cmake index f33e152ef..c0cf6f361 100644 --- a/CMakeScripts/FindBoost.cmake +++ b/CMakeScripts/FindBoost.cmake @@ -7,7 +7,9 @@ # To find boost on Windows, use DEVLIBS_PATH variable set by mingwenv.bat FIND_PATH(BOOST_INCLUDE_DIR boost/weak_ptr.hpp - /usr/include + /usr/include/boost + /usr/include + /usr/local/include/boost /usr/local/include $ENV{DEVLIBS_PATH}//include )