Blame synfig-core/src/CMakeLists.txt

caryoscelus b57217
# TODO: find out which version is actually required
caryoscelus b57217
cmake_minimum_required(VERSION 3.1)
caryoscelus b57217
caryoscelus b57217
##
caryoscelus b57217
## Find packages
caryoscelus b57217
##
caryoscelus b57217
caryoscelus b57217
# TODO: check if we really need all of them
cc8279
find_package(Boost REQUIRED system)
caryoscelus b57217
caryoscelus b57217
find_package(ZLIB REQUIRED)
Voldracarno Draconor bb9d74
Voldracarno Draconor bb9d74
## ETL doesn't install a package configuration so find package will fail
Voldracarno Draconor bb9d74
# find_package(ETL REQUIRED)
6b7cd4
caryoscelus b57217
caryoscelus f4661e
## TODO: investigate these more closely
caryoscelus 174476
set(CMAKE_THREAD_PREFER_PTHREAD ON)
caryoscelus 174476
set(THREADS_PREFER_PTHREAD_FLAG ON)
caryoscelus f4661e
find_package(Threads REQUIRED)
caryoscelus 174476
if (CMAKE_USE_PTHREADS_INIT)
caryoscelus 174476
    set(HAVE_LIBPTHREAD ON)
caryoscelus 174476
endif()
caryoscelus 174476
caryoscelus b57217
include(FindPkgConfig)
caryoscelus b57217
pkg_check_modules(SIGCPP REQUIRED sigc++-2.0)
caryoscelus b57217
pkg_check_modules(GLIBMM REQUIRED glibmm-2.4)
caryoscelus b57217
pkg_check_modules(GIOMM REQUIRED giomm-2.4)
caryoscelus b57217
pkg_check_modules(CAIRO REQUIRED cairo)
e83f04
pkg_check_modules(PANGOCAIRO REQUIRED pangocairo) # lyr_freetype
caryoscelus b57217
pkg_check_modules(LIBXML REQUIRED libxml++-2.6)
caryoscelus b57217
pkg_check_modules(MLT REQUIRED mlt++)
caryoscelus 174476
pkg_check_modules(FFTW REQUIRED fftw3)
e83f04
pkg_check_modules(FT REQUIRED freetype2) # for lyr_freetype
e83f04
pkg_check_modules(LIBPNG REQUIRED libpng) # for mod_png
7cea64
#TODO(ice0): find solution for libmng
7cea64
pkg_check_modules(LIBMNG libmng) # for mod_mng (set as optional as it is not correctly installed in Debian)
e83f04
pkg_check_modules(LIBJPEG REQUIRED libjpeg) # for mod_mng
e83f04
pkg_check_modules(OPENEXR REQUIRED OpenEXR) # for mod_openexr
e83f04
pkg_check_modules(MAGICKCORE REQUIRED MagickCore) # for Magick++
caryoscelus 174476
caryoscelus 0d136e
## TODO: move to module where it is actually required
caryoscelus 3084ef
pkg_check_modules(PANGO REQUIRED pango)
caryoscelus 3084ef
caryoscelus 0d136e
## TODO: should we keep it here?
caryoscelus 0d136e
find_package(ImageMagick COMPONENTS Magick++)
caryoscelus 0d136e
caryoscelus 174476
##
caryoscelus 174476
## Configure
caryoscelus 174476
##
caryoscelus 174476
caryoscelus 39d3fe
## set git version
caryoscelus 39d3fe
## TODO: put into separate file
caryoscelus 174476
find_package(Git)
caryoscelus 174476
if (GIT_FOUND)
caryoscelus 174476
    execute_process(
caryoscelus 174476
        COMMAND ${GIT_EXECUTABLE} show -s --format=%ad --date=format:%Y%m%d HEAD
caryoscelus 174476
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
caryoscelus 174476
        OUTPUT_VARIABLE GIT_DATE
caryoscelus 174476
        OUTPUT_STRIP_TRAILING_WHITESPACE
caryoscelus 174476
    )
caryoscelus 174476
    execute_process(
caryoscelus 174476
        COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
caryoscelus 174476
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
caryoscelus 174476
        OUTPUT_VARIABLE GIT_BRANCH
caryoscelus 174476
        OUTPUT_STRIP_TRAILING_WHITESPACE
caryoscelus 174476
    )
caryoscelus 174476
    execute_process(
caryoscelus 174476
        COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
caryoscelus 174476
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
caryoscelus 174476
        OUTPUT_VARIABLE GIT_HASH
caryoscelus 174476
        OUTPUT_STRIP_TRAILING_WHITESPACE
caryoscelus 174476
    )
caryoscelus 174476
else()
caryoscelus 174476
    set(GIT_DATE    "unknown")
caryoscelus 174476
    set(GIT_BRANCH  "unknown")
caryoscelus 174476
    set(GIT_HASH    "unknown")
caryoscelus 174476
endif()
caryoscelus 174476
3e8405
# Check headers
3e8405
include(CheckIncludeFile)
3e8405
CHECK_INCLUDE_FILE(sys/wait.h  HAVE_SYS_WAIT_H)
3e8405
CHECK_INCLUDE_FILE(signal.h    HAVE_SIGNAL_H)
3e8405
CHECK_INCLUDE_FILE(termios.h   HAVE_TERMIOS_H)
3e8405
CHECK_INCLUDE_FILE(process.h   HAVE_PROCESS_H)
3e8405
CHECK_INCLUDE_FILE(io.h        HAVE_IO_H)
3e8405
CHECK_INCLUDE_FILE(sys/fcntl.h HAVE_FCNTL_H)
3e8405
3e8405
# Check functions
3e8405
include (CheckFunctionExists)
3e8405
CHECK_FUNCTION_EXISTS(fork HAVE_FORK)
3e8405
CHECK_FUNCTION_EXISTS(pipe HAVE_PIPE)
3e8405
CHECK_FUNCTION_EXISTS(waitpid HAVE_WAITPID)
3e8405
caryoscelus 174476
add_definitions(-DHAVE_CONFIG_H)
caryoscelus 174476
configure_file(config.h.cmake.in config.h)
caryoscelus 174476
configure_file(autorevision.h.cmake.in autorevision.h)
caryoscelus b57217
caryoscelus b57217
##
caryoscelus b57217
## Include
caryoscelus b57217
##
caryoscelus b57217
caryoscelus 174476
## for config
caryoscelus 174476
include_directories(${CMAKE_CURRENT_BINARY_DIR})
caryoscelus b57217
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
caryoscelus b57217
caryoscelus b57217
##
caryoscelus de1b91
## CMake helpers
caryoscelus de1b91
##
caryoscelus de1b91
caryoscelus de1b91
include(cmake/install_header.cmake)
caryoscelus de1b91
caryoscelus de1b91
##
caryoscelus b57217
## Sub-dirs
caryoscelus b57217
##
caryoscelus b57217
caryoscelus b57217
add_subdirectory(synfig)
caryoscelus 174476
add_subdirectory(tool)
caryoscelus 5dc91c
add_subdirectory(modules)
caryoscelus b57217
caryoscelus b57217
##
caryoscelus b57217
## Build targets
caryoscelus b57217
##