From 6efecd7b34280537a4a2c5d2a9d51bc6fa02d755 Mon Sep 17 00:00:00 2001 From: ice0 Date: Sep 19 2019 09:28:27 +0000 Subject: Merge pull request #956 from ice0/cmake-warnings Fixed CMake build warnings from LibXML and OpenEXR --- diff --git a/.travis.yml b/.travis.yml index 3bafbbc..f136f24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,13 @@ matrix: dist: xenial cache: ccache before_install: ./1-setup-linux-native.sh - before_script: ccache -s + before_script: + - ccache -s + - ccache --set-config=compression=true script: ./travis.sh - after_script: autobuild/synfigrenderer-regression-test.sh + after_script: + - autobuild/synfigrenderer-regression-test.sh + - ccache -s - os: linux name: "Synfig Studio Ubuntu 16.04 Xenial (CMake/Ninja)" @@ -28,9 +32,12 @@ matrix: sudo: required dist: xenial cache: ccache - before_install: ./1-setup-linux-native.sh - before_script: ccache -s - script: mkdir -p build && cd build && cmake .. && make -j$(nproc) + before_install: sudo apt-get install ninja-build && ./1-setup-linux-native.sh + before_script: + - ccache -s + - ccache --set-config=compression=true + script: mkdir -p build && cd build && cmake .. -GNinja && ninja + after_script: ccache -s # show ccache stats - os: osx name: "Synfig Studio OS X 10.10 Yosemite (Clang/Autotools/Brew)" @@ -42,7 +49,9 @@ matrix: cache: ccache before_install: brew reinstall libtool # fix no sed install: ./1-setup-osx-brew.sh - before_script: ccache -s + before_script: + - ccache -s + - ccache --set-config=compression=true script: ./travis.sh after_script: ccache -s # show ccache stats @@ -63,6 +72,6 @@ matrix: script: ./travis.sh after_script: ccache -s # show ccache stats - allow_failures: - - env: CMAKE=true + #allow_failures: + # - env: CMAKE=true # - os: osx diff --git a/synfig-core/src/CMakeLists.txt b/synfig-core/src/CMakeLists.txt index 4fe36fc..0880974 100644 --- a/synfig-core/src/CMakeLists.txt +++ b/synfig-core/src/CMakeLists.txt @@ -76,6 +76,21 @@ else() set(GIT_HASH "unknown") endif() +# Check headers +include(CheckIncludeFile) +CHECK_INCLUDE_FILE(sys/wait.h HAVE_SYS_WAIT_H) +CHECK_INCLUDE_FILE(signal.h HAVE_SIGNAL_H) +CHECK_INCLUDE_FILE(termios.h HAVE_TERMIOS_H) +CHECK_INCLUDE_FILE(process.h HAVE_PROCESS_H) +CHECK_INCLUDE_FILE(io.h HAVE_IO_H) +CHECK_INCLUDE_FILE(sys/fcntl.h HAVE_FCNTL_H) + +# Check functions +include (CheckFunctionExists) +CHECK_FUNCTION_EXISTS(fork HAVE_FORK) +CHECK_FUNCTION_EXISTS(pipe HAVE_PIPE) +CHECK_FUNCTION_EXISTS(waitpid HAVE_WAITPID) + add_definitions(-DHAVE_CONFIG_H) configure_file(config.h.cmake.in config.h) configure_file(autorevision.h.cmake.in autorevision.h) diff --git a/synfig-core/src/config.h.cmake.in b/synfig-core/src/config.h.cmake.in index 0b062a9..31034b6 100644 --- a/synfig-core/src/config.h.cmake.in +++ b/synfig-core/src/config.h.cmake.in @@ -1,3 +1,16 @@ // Configure file to be used with cmake build #cmakedefine HAVE_LIBPTHREAD + +// header files +#cmakedefine01 HAVE_SYS_WAIT_H +#cmakedefine01 HAVE_SIGNAL_H +#cmakedefine01 HAVE_TERMIOS_H +#cmakedefine01 HAVE_PROCESS_H +#cmakedefine01 HAVE_IO_H +#cmakedefine01 HAVE_FCNTL_H + +// defines needed for piped processes +#cmakedefine HAVE_FORK +#cmakedefine HAVE_PIPE +#cmakedefine HAVE_WAITPID diff --git a/synfig-core/src/modules/mod_ffmpeg/CMakeLists.txt b/synfig-core/src/modules/mod_ffmpeg/CMakeLists.txt index c87b667..519d7a9 100644 --- a/synfig-core/src/modules/mod_ffmpeg/CMakeLists.txt +++ b/synfig-core/src/modules/mod_ffmpeg/CMakeLists.txt @@ -1,10 +1,5 @@ add_library(mod_ffmpeg MODULE "") -if (UNIX) - add_definitions(-DHAVE_FORK -DHAVE_PIPE -DHAVE_WAITPID) - add_definitions(-DHAVE_SYS_WAIT_H) -endif (UNIX) - target_sources(mod_ffmpeg PUBLIC "${CMAKE_CURRENT_LIST_DIR}/main.cpp" diff --git a/synfig-core/src/modules/mod_openexr/CMakeLists.txt b/synfig-core/src/modules/mod_openexr/CMakeLists.txt index b5830c5..51687bd 100644 --- a/synfig-core/src/modules/mod_openexr/CMakeLists.txt +++ b/synfig-core/src/modules/mod_openexr/CMakeLists.txt @@ -9,7 +9,7 @@ target_sources(mod_openexr message(STATUS "OpenEXR include: ${OPENEXR_INCLUDE_DIRS}") -target_include_directories(mod_openexr PRIVATE ${OPENEXR_INCLUDE_DIRS}) +target_include_directories(mod_openexr SYSTEM PRIVATE ${OPENEXR_INCLUDE_DIRS}) target_link_libraries(mod_openexr synfig ${OPENEXR_LIBRARIES}) diff --git a/synfig-core/src/synfig/CMakeLists.txt b/synfig-core/src/synfig/CMakeLists.txt index 8f72fae..e668047 100644 --- a/synfig-core/src/synfig/CMakeLists.txt +++ b/synfig-core/src/synfig/CMakeLists.txt @@ -10,13 +10,14 @@ message(STATUS "MLT DIR: ${MLT_INCLUDE_DIRS}") target_include_directories(synfig # SYSTEM BEFORE PUBLIC +SYSTEM PUBLIC + ${LIBXML_INCLUDE_DIRS} PUBLIC ${SIGCPP_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${GIOMM_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${PANGO_INCLUDE_DIRS} - ${LIBXML_INCLUDE_DIRS} ${MLT_INCLUDE_DIRS} ${FFTW_INCLUDE_DIRS} )