diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-03-01 01:42:13 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-03-01 01:42:13 +0000 |
| commit | 145f815859ba21f45e67d315e52f360f029355c7 (patch) | |
| tree | 54448bc60a94415f63f7b6f46296c8d5e2ac58a6 /CMakeScripts | |
| parent | Improve fill rule and add mass option (diff) | |
| parent | type in commit r14664 (diff) | |
| download | inkscape-145f815859ba21f45e67d315e52f360f029355c7.tar.gz inkscape-145f815859ba21f45e67d315e52f360f029355c7.zip | |
update to trunk
(bzr r14648.1.3)
Diffstat (limited to 'CMakeScripts')
| -rw-r--r-- | CMakeScripts/ConfigChecks.cmake | 1 | ||||
| -rw-r--r-- | CMakeScripts/DefineDependsandFlags.cmake | 1 | ||||
| -rw-r--r-- | CMakeScripts/Modules/FindSigC++.cmake | 22 | ||||
| -rw-r--r-- | CMakeScripts/Modules/sigcpp_test.cpp | 15 |
4 files changed, 37 insertions, 2 deletions
diff --git a/CMakeScripts/ConfigChecks.cmake b/CMakeScripts/ConfigChecks.cmake index 46df8051d..926dc3ad3 100644 --- a/CMakeScripts/ConfigChecks.cmake +++ b/CMakeScripts/ConfigChecks.cmake @@ -18,7 +18,6 @@ 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(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) diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 59c2cb063..ab197a7af 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -411,6 +411,7 @@ if(WITH_NLS) endif(GETTEXT_FOUND) endif(WITH_NLS) +find_package(SigC++ REQUIRED) # end Dependencies diff --git a/CMakeScripts/Modules/FindSigC++.cmake b/CMakeScripts/Modules/FindSigC++.cmake index ed0abc545..8046410b5 100644 --- a/CMakeScripts/Modules/FindSigC++.cmake +++ b/CMakeScripts/Modules/FindSigC++.cmake @@ -13,7 +13,6 @@ # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # - if (SIGC++_LIBRARIES AND SIGC++_INCLUDE_DIRS) # in cache already set(SIGC++_FOUND TRUE) @@ -103,4 +102,25 @@ else (SIGC++_LIBRARIES AND SIGC++_INCLUDE_DIRS) endif (SIGC++_LIBRARIES AND SIGC++_INCLUDE_DIRS) +# Try to add -std=c++11 if needed - see: +# https://bugs.launchpad.net/inkscape/+bug/1488079 + +macro (sigcpp_compile extra_cppflags) + try_compile(SIGCPP_COMPILES_FINE "${CMAKE_BINARY_DIR}/sigcpp-bindir" + SOURCES "${CMAKE_SOURCE_DIR}/CMakeScripts/Modules/sigcpp_test.cpp" + COMPILE_DEFINITIONS ${_SIGC++_CFLAGS} ${extra_cppflags} + LINK_LIBRARIES ${SIGC++_LIBRARIES}) +endmacro() + + +sigcpp_compile("") +if (NOT "${SIGCPP_COMPILES_FINE}") + set (cppflag "-std=c++11") + sigcpp_compile("${cppflag}") + if ("${SIGCPP_COMPILES_FINE}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${cppflag}") + else() + message(FATAL_ERROR "Could not compile against SIGC++") + endif() +endif() diff --git a/CMakeScripts/Modules/sigcpp_test.cpp b/CMakeScripts/Modules/sigcpp_test.cpp new file mode 100644 index 000000000..b4cf2c773 --- /dev/null +++ b/CMakeScripts/Modules/sigcpp_test.cpp @@ -0,0 +1,15 @@ +/* + * Building this using: + + g++ `pkg-config --cflags sigc++-2.0` sigcpp_test.cpp + + Results in an error. + * */ +#include <stddef.h> +#include <string> +#include <sigc++/signal.h> + +int main() +{ + return 0; +} |
