Skip to content

Commit

Permalink
Fixed CMake MSYS2 build
Browse files Browse the repository at this point in the history
  • Loading branch information
ice0 committed Aug 20, 2019
1 parent d69464f commit e83f045
Show file tree
Hide file tree
Showing 33 changed files with 120 additions and 21 deletions.
23 changes: 17 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ language: cpp
git:
depth: 1
submodules: false

env:
global:
- BUILD_FILENAME="build-$TRAVIS_OS_NAME.$TRAVIS_BUILD_NUMBER-$(date '+%Y-%m-%d_%H_%M_%S').tgz"
- MAKE_THREADS=4

matrix:
include:

- os: linux
name: "Synfig Studio Ubuntu 16.04 Xenial (GCC/Autotools)"
sudo: required
Expand All @@ -21,7 +21,17 @@ matrix:
before_script: ccache -s
script: ./travis.sh
after_script: autobuild/synfigrenderer-regression-test.sh


- os: linux
name: "Synfig Studio Ubuntu 16.04 Xenial (CMake/Ninja)"
env: CMAKE=true
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)

- os: osx
name: "Synfig Studio OS X 10.10 Yosemite (Clang/Autotools/Brew)"
sudo: required
Expand All @@ -35,7 +45,7 @@ matrix:
before_script: ccache -s
script: ./travis.sh
after_script: ccache -s # show ccache stats

- os: osx
name: "Synfig Studio OS X 10.13 High Sierra (Clang/Autotools/Brew)"
sudo: required
Expand All @@ -52,6 +62,7 @@ matrix:
- ccache --set-config=compression=true
script: ./travis.sh
after_script: ccache -s # show ccache stats

#allow_failures:

allow_failures:
- env: CMAKE=true
# - os: osx
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 2.8)

project(synfig-studio)

add_subdirectory(ETL)
include_directories(ETL)
include_directories(${PROJECT_BINARY_DIR}/ETL) # to find the generated etl_profile.h
add_subdirectory(synfig-core)

include_directories(synfig-core/src)
add_subdirectory(synfig-studio)
8 changes: 6 additions & 2 deletions ETL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 2.8)

project(ETL)

option(ENABLE_TESTS "Enable tests" OFF)

find_package(Threads)
if (CMAKE_USE_PTHREADS_INIT)
set(HAVE_LIBPTHREAD ON)
Expand All @@ -15,5 +17,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_subdirectory(ETL)

enable_testing()
add_subdirectory(test)
if (${ENABLE_TESTS})
enable_testing()
add_subdirectory(test)
endif()
8 changes: 6 additions & 2 deletions ETL/ETL/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## TODO: install headers properly

configure_file(etl_profile.h.cmake.in etl_profile.h)
configure_file(
etl_profile.h.cmake.in
${PROJECT_BINARY_DIR}/ETL/etl_profile.h
)

set(ETL_HEADERS
"${CMAKE_CURRENT_LIST_DIR}/rect"
Expand Down Expand Up @@ -63,7 +66,8 @@ set(ETL_HEADERS
"${CMAKE_CURRENT_LIST_DIR}/_handle.h"
"${CMAKE_CURRENT_LIST_DIR}/_gaussian.h"

"${CMAKE_CURRENT_BINARY_DIR}/etl_profile.h"
# autogenerated
"${PROJECT_BINARY_DIR}/ETL/etl_profile.h"
)

install(
Expand Down
5 changes: 5 additions & 0 deletions ETL/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# for test to find generated etl_profile.h
include_directories(${PROJECT_BINARY_DIR})

include_directories(${PROJECT_SOURCE_DIR})

add_executable(angle angle.cpp)
add_test(test_angle angle)

Expand Down
2 changes: 1 addition & 1 deletion synfig-core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# TODO: find out which version is actually required
cmake_minimum_required(VERSION 3.1)

project(synfig)
project(synfig-core)

enable_testing()

Expand Down
7 changes: 7 additions & 0 deletions synfig-core/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@ pkg_check_modules(SIGCPP REQUIRED sigc++-2.0)
pkg_check_modules(GLIBMM REQUIRED glibmm-2.4)
pkg_check_modules(GIOMM REQUIRED giomm-2.4)
pkg_check_modules(CAIRO REQUIRED cairo)
pkg_check_modules(PANGOCAIRO REQUIRED pangocairo) # lyr_freetype
pkg_check_modules(LIBXML REQUIRED libxml++-2.6)
pkg_check_modules(MLT REQUIRED mlt++)
pkg_check_modules(FFTW REQUIRED fftw3)
pkg_check_modules(FT REQUIRED freetype2) # for lyr_freetype
pkg_check_modules(LIBPNG REQUIRED libpng) # for mod_png
pkg_check_modules(LIBMNG REQUIRED libmng) # for mod_mng
pkg_check_modules(LIBJPEG REQUIRED libjpeg) # for mod_mng
pkg_check_modules(OPENEXR REQUIRED OpenEXR) # for mod_openexr
pkg_check_modules(MAGICKCORE REQUIRED MagickCore) # for Magick++

## TODO: move to module where it is actually required
pkg_check_modules(PANGO REQUIRED pango)
Expand Down
10 changes: 5 additions & 5 deletions synfig-core/src/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ set(MODS_ENABLED
mod_gradient
mod_imagemagick
mod_jpeg
# mod_libavcodec - build failure
# mod_magickpp - made optional
# mod_mng - missing include
# mod_libavcodec # - build failure
# mod_magickpp # - made optional
mod_mng
mod_noise
# mod_openexr - missing include
mod_openexr
mod_particle
mod_png
mod_ppm
mod_svg
mod_yuv420p
# mptr_mplayer - "This code has vulnerabilities"
# mptr_mplayer # - "This code has vulnerabilities"
)

## Magick++ support
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/lyr_freetype/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ target_sources(lyr_freetype
"${CMAKE_CURRENT_LIST_DIR}/lyr_freetype.cpp"
)

target_link_libraries(lyr_freetype synfig ${CAIRO_LIBRARIES} ${PANGO_LIBRARIES} ${PANGOCAIRO_LIBRARIES} ${FT_LIBRARIES})

install (
TARGETS lyr_freetype
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/lyr_std/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ target_sources(lyr_std
"${CMAKE_CURRENT_LIST_DIR}/zoom.cpp"
)

target_link_libraries(lyr_std synfig ${CAIRO_LIBRARIES} ${GLIBMM_LIBRARIES})

install (
TARGETS lyr_std
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_bmp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ target_sources(mod_bmp
"${CMAKE_CURRENT_LIST_DIR}/trgt_bmp.cpp"
)

target_link_libraries(mod_bmp synfig ${SIGCPP_LIBRARIES})

install (
TARGETS mod_bmp
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_dv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ target_sources(mod_dv
"${CMAKE_CURRENT_LIST_DIR}/trgt_dv.cpp"
)

target_link_libraries(mod_dv synfig ${SIGCPP_LIBRARIES})

install (
TARGETS mod_dv
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ target_sources(mod_example
"${CMAKE_CURRENT_LIST_DIR}/simplecircle.cpp"
)

target_link_libraries(mod_example synfig)

install (
TARGETS mod_example
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_ffmpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ target_sources(mod_ffmpeg
"${CMAKE_CURRENT_LIST_DIR}/mptr_ffmpeg.cpp"
)

target_link_libraries(mod_ffmpeg synfig ${SIGCPP_LIBRARIES})

install (
TARGETS mod_ffmpeg
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_filter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ target_sources(mod_filter
"${CMAKE_CURRENT_LIST_DIR}/radialblur.cpp"
)

target_link_libraries(mod_filter synfig ${CAIRO_LIBRARIES})

install (
TARGETS mod_filter
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ target_sources(mod_geometry
"${CMAKE_CURRENT_LIST_DIR}/star.cpp"
)

target_link_libraries(mod_geometry synfig ${CAIRO_LIBRARIES} ${GLIBMM_LIBRARIES})

install (
TARGETS mod_geometry
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_gif/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ target_sources(mod_gif
"${CMAKE_CURRENT_LIST_DIR}/main.cpp"
)

target_link_libraries(mod_gif synfig ${SIGCPP_LIBRARIES})

install (
TARGETS mod_gif
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_gradient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ target_sources(mod_gradient
"${CMAKE_CURRENT_LIST_DIR}/spiralgradient.cpp"
)

target_link_libraries(mod_gradient synfig ${CAIRO_LIBRARIES})

install (
TARGETS mod_gradient
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_imagemagick/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ target_sources(mod_imagemagick
"${CMAKE_CURRENT_LIST_DIR}/trgt_imagemagick.cpp"
)

target_link_libraries(mod_imagemagick synfig)

install (
TARGETS mod_imagemagick
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_jpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ target_sources(mod_jpeg
"${CMAKE_CURRENT_LIST_DIR}/trgt_jpeg.cpp"
)

target_link_libraries(mod_jpeg synfig ${LIBJPEG_LIBRARIES})

install (
TARGETS mod_jpeg
DESTINATION lib/synfig/modules
Expand Down
3 changes: 3 additions & 0 deletions synfig-core/src/modules/mod_libavcodec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ target_sources(mod_libavcodec
"${CMAKE_CURRENT_LIST_DIR}/main.cpp"
)

#target_link_libraries(mod_jpeg synfig ${LIBJPEG_LIBRARIES})
target_link_libraries(mod_libavcodec synfig)

install (
TARGETS mod_libavcodec
DESTINATION lib/synfig/modules
Expand Down
2 changes: 1 addition & 1 deletion synfig-core/src/modules/mod_magickpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ target_sources(mod_magickpp
"${CMAKE_CURRENT_LIST_DIR}/trgt_magickpp.cpp"
)

target_link_libraries(mod_magickpp ${ImageMagick_LIBRARIES})
target_link_libraries(mod_magickpp synfig ${MAGICKCORE_LIBRARIES} ${ImageMagick_LIBRARIES})

install (
TARGETS mod_magickpp
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_mng/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ target_sources(mod_mng
"${CMAKE_CURRENT_LIST_DIR}/main.cpp"
)

target_link_libraries(mod_mng synfig ${LIBMNG_LIBRARIES})

install (
TARGETS mod_mng
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_noise/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ target_sources(mod_noise
"${CMAKE_CURRENT_LIST_DIR}/valuenode_random.cpp"
)

target_link_libraries(mod_noise synfig ${SIGCPP_LIBRARIES})

install (
TARGETS mod_noise
DESTINATION lib/synfig/modules
Expand Down
7 changes: 7 additions & 0 deletions synfig-core/src/modules/mod_openexr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ target_sources(mod_openexr
"${CMAKE_CURRENT_LIST_DIR}/mptr_openexr.cpp"
)

message(STATUS "OpenEXR include: ${OPENEXR_INCLUDE_DIRS}")

target_include_directories(mod_openexr PRIVATE ${OPENEXR_INCLUDE_DIRS})

#target_link_libraries(mod_noise synfig ${SIGCPP_LIBRARIES})
target_link_libraries(mod_openexr synfig ${OPENEXR_LIBRARIES})

install (
TARGETS mod_openexr
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_particle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ target_sources(mod_particle
"${CMAKE_CURRENT_LIST_DIR}/plant.cpp"
)

target_link_libraries(mod_particle synfig ${CAIRO_LIBRARIES})

install (
TARGETS mod_particle
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_png/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ target_sources(mod_png
"${CMAKE_CURRENT_LIST_DIR}/trgt_png.cpp"
)

target_link_libraries(mod_png synfig ${LIBPNG_LIBRARIES})

install (
TARGETS mod_png
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_ppm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ target_sources(mod_ppm
"${CMAKE_CURRENT_LIST_DIR}/mptr_ppm.cpp"
)

target_link_libraries(mod_ppm synfig)

install (
TARGETS mod_ppm
DESTINATION lib/synfig/modules
Expand Down
3 changes: 3 additions & 0 deletions synfig-core/src/modules/mod_svg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ target_sources(mod_svg
"${CMAKE_CURRENT_LIST_DIR}/svg_parser.cpp"
)

target_link_libraries(mod_svg synfig ${LIBXML_LIBRARIES} ${GLIBMM_LIBRARIES})
#target_link_libraries(mod_svg synfig ${GLIBMM_LIBRARIES})

install (
TARGETS mod_svg
DESTINATION lib/synfig/modules
Expand Down
2 changes: 2 additions & 0 deletions synfig-core/src/modules/mod_yuv420p/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ target_sources(mod_yuv420p
"${CMAKE_CURRENT_LIST_DIR}/trgt_yuv.cpp"
)

target_link_libraries(mod_yuv420p synfig)

install (
TARGETS mod_yuv420p
DESTINATION lib/synfig/modules
Expand Down
Loading

0 comments on commit e83f045

Please sign in to comment.