POV-Ray : Newsgroups : povray.programming : Interested in CMake support (build system, IDE integration) : Re: Interested in CMake support (build system, IDE integration) Server Time
27 Apr 2024 18:32:52 EDT (-0400)
  Re: Interested in CMake support (build system, IDE integration)  
From: LanuHum
Date: 9 Oct 2016 06:00:00
Message: <web.57fa13dbdc6ec2767a3e03fe0@news.povray.org>
In his project, I want to use the Povray. I can not study very long
configuration files.
I decided to use CMake.
To build the project in Linux, I wrote a single file CMakeLists.txt

cmake_minimum_required(VERSION 2.8)

project(povanim)


set(CMAKE_CXX_FLAGS "-std=c++11 -pipe -Wno-multichar -Wno-write-strings
-fno-enforce-eh-specs -Wno-non-template-friend -s -O3 -ffast-math -march=native
-pthread")


set( SOURCE_ROOT                    source )
set( SOURCE_BASKEND                 source/backend )
set( SOURCE_BASKEND_BOUNDING        source/backend/bounding )
set( SOURCE_BASKEND_CONTROL         source/backend/control )
set( SOURCE_BASKEND_LIGHTING        source/backend/lighting )
set( SOURCE_BASKEND_RENDER          source/backend/render )
set( SOURCE_BASKEND_SCENE           source/backend/scene )
set( SOURCE_BASKEND_SUPPORT         source/backend/support )
set( SOURCE_BASE                    source/base )
set( SOURCE_BASE_ANIMATION          source/base/animation )
set( SOURCE_BASE_FONT               source/base/font )
set( SOURCE_BASE_IMAGE              source/base/image )
set( SOURCE_CORE                    source/core )
set( SOURCE_CORE_BOUNDING           source/core/bounding )
set( SOURCE_CORE_COLOUR             source/core/colour )
set( SOURCE_CORE_LIGHTING           source/core/lighting )
set( SOURCE_CORE_MATERIAL           source/core/material )
set( SOURCE_CORE_MATH               source/core/math )
set( SOURCE_CORE_RENDER             source/core/render )
set( SOURCE_CORE_SCENE              source/core/scene )
set( SOURCE_CORE_SHAPE              source/core/shape )
set( SOURCE_CORE_SUPPORT            source/core/support )
set( SOURCE_FRONTEND                source/frontend )
set( SOURCE_PARSER                  source/parser )
set( SOURCE_POVMS                   source/povms )
set( SOURCE_VM                      source/vm )
set( SOURCE_UNIX                    unix )
set( SOURCE_PLATFORM_UNIX           platform/unix )
set( SOURCE_PLATFORM_X86            platform/x86)
set( SOURCE_VFE                     vfe )
set( SOURCE_VFE_UNIX                vfe/unix)


aux_source_directory( ${SOURCE_ROOT}                     SOURCEROOT )
aux_source_directory( ${SOURCE_BASKEND}                  SOURCEBASKEND )
aux_source_directory( ${SOURCE_BASKEND_BOUNDING}         SOURCEBASKENDBOUNDING )
aux_source_directory( ${SOURCE_BASKEND_CONTROL}          SOURCEBASKENDCONTROL )
aux_source_directory( ${SOURCE_BASKEND_LIGHTING}         SOURCEBASKENDLIGHTING )
aux_source_directory( ${SOURCE_BASKEND_RENDER}           SOURCEBASKENDRENDER )
aux_source_directory( ${SOURCE_BASKEND_SCENE}            SOURCEBASKENDSCENE )
aux_source_directory( ${SOURCE_BASKEND_SUPPORT}          SOURCEBASKENDSUPPORT )
aux_source_directory( ${SOURCE_BASE}                     SOURCEBASE )
aux_source_directory( ${SOURCE_BASE_ANIMATION}           SOURCEBASEANIMATION )
aux_source_directory( ${SOURCE_BASE_FONT}                SOURCEBASEFONT )
aux_source_directory( ${SOURCE_BASE_IMAGE}               SOURCEBASEIMAGE )
aux_source_directory( ${SOURCE_CORE}                     SOURCECORE )
aux_source_directory( ${SOURCE_CORE_BOUNDING}            SOURCECOREBOUNDING )
aux_source_directory( ${SOURCE_CORE_COLOUR}              SOURCECORECOLOUR )
aux_source_directory( ${SOURCE_CORE_LIGHTING}            SOURCECORELIGHTING )
aux_source_directory( ${SOURCE_CORE_MATERIAL}            SOURCECOREMATERIAL )
aux_source_directory( ${SOURCE_CORE_MATH}                SOURCECOREMATH )
aux_source_directory( ${SOURCE_CORE_RENDER}              SOURCECORERENDER )
aux_source_directory( ${SOURCE_CORE_SCENE}               SOURCECORESCENE )
aux_source_directory( ${SOURCE_CORE_SHAPE}               SOURCECORESHAPE )
aux_source_directory( ${SOURCE_CORE_SUPPORT}             SOURCECORESUPPORT )
aux_source_directory( ${SOURCE_FRONTEND}                 SOURCEFRONTEND )
aux_source_directory( ${SOURCE_PARSER}                   SOURCEPARSER )
aux_source_directory( ${SOURCE_POVMS}                    SOURCEPOVMS )
aux_source_directory( ${SOURCE_VM}                       SOURCEVM )
aux_source_directory( ${SOURCE_UNIX}                     SOURCEUNIX )
aux_source_directory( ${SOURCE_PLATFORM_UNIX}            SOURCEPLATFORMUNIX )
aux_source_directory( ${SOURCE_PLATFORM_X86}             SOURCEPLATFORMX86 )
aux_source_directory( ${SOURCE_VFE}                      SOURCEVFE )
aux_source_directory( ${SOURCE_VFE_UNIX}                 SOURCEVFEUNIX )

find_package(           JPEG REQUIRED)
find_package(           PNG REQUIRED)
find_package(           PkgConfig REQUIRED)

pkg_search_module(      SDL REQUIRED sdl)

set( UNIX_POVCONFIG_INCLUDE_DIR unix/povconfig)

include_directories(    ${SOURCE_ROOT}
                        ${SOURCE_BASKEND}
                        ${SOURCE_BASE}
                        ${SOURCE_CORE}
                        ${SOURCE_FRONTEND}
                        ${SOURCE_PARSER}
                        ${SOURCE_POVMS}
                        ${SOURCE_VM}
                        ${SOURCE_UNIX}
                        ${UNIX_POVCONFIG_INCLUDE_DIR}
                        ${SOURCE_PLATFORM_UNIX}
                        ${SOURCE_PLATFORM_X86}
                        ${SOURCE_VFE}
                        ${SOURCE_VFE_UNIX}
                        ${SDL_INCLUDE_DIRS}
                        ${JPEG_INCLUDE_DIRS}
                        ${PNG_INCLUDE_DIRS}
                        )

add_executable(         ${PROJECT_NAME}
                        ${SOURCEROOT}
                        ${SOURCEBASKEND}
                        ${SOURCEBASKENDBOUNDING}
                        ${SOURCEBASKENDCONTROL}
                        ${SOURCEBASKENDLIGHTING}
                        ${SOURCEBASKENDRENDER}
                        ${SOURCEBASKENDSCENE}
                        ${SOURCEBASKENDSUPPORT}
                        ${SOURCEBASE}
                        ${SOURCEBASEANIMATION}
                        ${SOURCEBASEFONT}
                        ${SOURCEBASEIMAGE}
                        ${SOURCECORE}
                        ${SOURCECOREBOUNDING}
                        ${SOURCECORECOLOUR}
                        ${SOURCECORELIGHTING}
                        ${SOURCECOREMATERIAL}
                        ${SOURCECOREMATH}
                        ${SOURCECORERENDER}
                        ${SOURCECORESCENE}
                        ${SOURCECORESHAPE}
                        ${SOURCECORESUPPORT}
                        ${SOURCEFRONTEND}
                        ${SOURCEPARSER}
                        ${SOURCEPOVMS}
                        ${SOURCEVM}
                        ${SOURCEUNIX}
                        ${SOURCEPLATFORMUNIX}
                        ${SOURCEPLATFORMX86}
                        ${SOURCEVFE}
                        ${SOURCEVFEUNIX}
                        )


target_link_libraries(  ${PROJECT_NAME}
                        ${SDL_LIBRARIES}
                        ${JPEG_LIBRARIES}
                        )

Not all external library I added, but JPEG FOUND

leonid@lanucomp ~/workspace/programming/povray_animator/povray $ LC_ALL=C make
Scanning dependencies of target povanim
[  0%] Building CXX object CMakeFiles/povanim.dir/source/pov_mem.cpp.o
[  1%] Building CXX object CMakeFiles/povanim.dir/source/povmain.cpp.o
[  1%] Building CXX object CMakeFiles/povanim.dir/source/backend/povray.cpp.o
/home/leonid/workspace/programming/povray_animator/povray-master/source/backend/povray.cpp:69:30:
fatal error: jversion.h: No such file or directory
         #include <jversion.h>
                              ^
compilation terminated.
CMakeFiles/povanim.dir/build.make:110: recipe for target
'CMakeFiles/povanim.dir/source/backend/povray.cpp.o' failed
make[2]: *** [CMakeFiles/povanim.dir/source/backend/povray.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/povanim.dir/all' failed
make[1]: *** [CMakeFiles/povanim.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
leonid@lanucomp ~/workspace/programming/povray_animator/povray $

In file povray.cpp:
    #ifndef LIBJPEG_MISSING
        #include <jversion.h>
    #endif

Povray does not use an external library libjpeg????
jpeg-devel package has only these files:
   /usr/include/jconfig.h
   /usr/include/jerror.h
   /usr/include/jmorecfg.h
   /usr/include/jpegint.h
   /usr/include/jpeglib.h
   /usr/include/turbojpeg.h
   /usr/lib64/libjpeg.so
   /usr/lib64/libturbojpeg.so


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.