CMake errors: not find VTK files - cmake

I am using OpenCV and PCL. Recently, I have been trying to implement a demo, but the program cannot be compiled correctly. The following is my CMakeLists.txt.
cmake_minimum_required(VERSION 2.8)
project(point_cloud_join)
set( CMAKE_BUILD_TYPE Release )
set( CMAKE_CXX_FLAGS "-std=c++11 -O3" )
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories("/usr/include/eigen3/")
include_directories("/usr/include/pcl-1.8")
find_package(PCL REQUIRED QUIET
COMPONENT common io
)
include_directories(${PCL_INCLUDE_DIRS})
# message(${PCL_INCLUDE_DIRS})
add_definitions(${PCL_DEFINITIONS})
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR})
add_executable(joinMap joinMap.cpp)
target_link_libraries(joinMap ${OpenCV_LIBS} ${PCL_LIBRARIES})
And I always got these errors:
-- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR)
** WARNING ** io features related to ensenso will be disabled
-- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR)
** WARNING ** io features related to davidSDK will be disabled
-- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES)
** WARNING ** io features related to dssdk will be disabled
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- The imported target "vtkRenderingPythonTkWidgets" references the file
"/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.
-- The imported target "vtk" references the file
"/usr/bin/vtk"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
but not all the files it references.
** WARNING ** io features related to libusb-1.0 will be disabled
-- looking for PCL_COMPONENT
-- Could NOT find PCL_COMPONENT (missing: PCL_COMPONENT_LIBRARY PCL_COMPONENT_INCLUDE_DIR)
-- looking for PCL_COMMON
-- looking for PCL_OCTREE
-- looking for PCL_IO
-- Configuring done
-- Generating done
cmake said it cannot find libvtkRenderingPythonTkWidgets.so and vtk, yet I do find the two files but not in the exact same name--libvtkRenderingPythonTkWidgets.x86_64-linux-gnu.so and vtk6.
Now I am not sure what to do. Should I reinstall VTK or what ?

Related

add_subdirectory for cmake tensorflow lite fails on subsequent runs

I am trying to include tensorflow-lite in a project per the minimal example here: Build TensorFlow Lite with CMake. Specifically, I'm trying to add_subdirectory the CMakeLists.txt for tflite, as recommended.
This works when the project is first built, but if I change my top-level CMakeLists.txt for any reason (adding a test or linking something to a different target, say), then the build fails with the following:
-- Setting build type to Release, for debug builds use'-DCMAKE_BUILD_TYPE=Debug'.
CMake Warning at build/abseil-cpp/CMakeLists.txt:70 (message):
A future Abseil release will default ABSL_PROPAGATE_CXX_STD to ON for CMake
3.8 and up. We recommend enabling this option to ensure your project still
builds correctly.
-- Standard libraries to link to explicitly: none
-- The Fortran compiler identification is GNU 9.4.0
-- Could NOT find CLANG_FORMAT: Found unsuitable version "0.0", but required is exact version "9" (found CLANG_FORMAT_EXECUTABLE-NOTFOUND)
--
-- Configured Eigen 3.4.90
--
-- Proceeding with version: 2.0.6.v2.0.6
-- CMAKE_CXX_FLAGS: -std=c++0x -Wall -pedantic -Werror -Wextra -Werror=shadow -faligned-new -Werror=implicit-fallthrough=2 -Wunused-result -Werror=unused-result -Wunused-parameter -Werror=unused-parameter -fsigned-char
CMake Error at build/cpuinfo/CMakeLists.txt:262 (ADD_SUBDIRECTORY):
ADD_SUBDIRECTORY not given a binary directory but the given source
directory "/opt/------/workspace/------/build/clog-source"
is not a subdirectory of
"/opt/------/workspace/------/build/cpuinfo". When
specifying an out-of-tree source a binary directory must be explicitly
specified.
CMake Error at build/cpuinfo/CMakeLists.txt:265 (SET_PROPERTY):
SET_PROPERTY could not find TARGET clog. Perhaps it has not yet been
created.
-- Configuring incomplete, errors occurred!
See also "/opt/------/workspace/------/build/CMakeFiles/CMakeOutput.log".
See also "/opt/------/workspace/------/build/CMakeFiles/CMakeError.log".
(Those dashes aren't real paths, they're just to mask sensitive info.)
Just to reiterate, it DOES configure and build correctly the first time, but reruns of cmake .. will fail.
I've tried this on a couple of platforms and got the same result. You should be able to reproduce with a minimal CMakeLists.txt containing add_subdirectory and some helloworld target to link tensorflow-lite.
I tried giving the add_subdirectory for clog a binary location but just got a cascade of new errors, and at that point my CMake know-how definitely runs out.
The issue is due to the same cmake variable CLOG_SOURCE_DIR used in both xnnpack and cpuinfo.
In xnnpack, it uses a cmake script to download, configure and build the clog.
In cpuinfo, it add as a subdirectory.
So they use different ways to add dependency. We need to fix this issue in either xnnpack or cpuinfo but as a walkaround, we can change the CLOG_SOURCE_DIR in either project to a different name (e.g. CLOG_SOURCE_DIR1) then this problem will go away.

Why is the toolchain file executed a few times in CMake?

In an attempt to create a cross-compilation CMake toolchain template with the SDCC compiler, I have come across a very weird issue.
As described in this link, if the toolchain.cmake file defines a CMAKE_SYSTEM_NAME, CMake will look for the file with the ${CMAKE_SYSTEM_NAME}.cmake under the Module/Platform directory. And this file should define platform-specific options. In my case, I am using it to find the sdcc compiler and setting some compiler flags.
This works just fine for me. Using cmake -DCMAKE_MODULE_PATH="${PATH_TO_MY_MODULES}" -DCMAKE_TOOLCHAIN_FILE="${PATH_TO_MY_TOOLCHAIN}" -DSDCC_SYSROOT="SOME_VALUE", CMake finds all the correct toolchain and platform files.
It seems like the toolchain and the platform file are executed (not sure if that's the correct term) a few times during the configuration process. In the first few times, the variable SDCC_SYSROOT I passed in the CMake command has the value SOME_VALUE as expected. However, the same variable SDCC_SYSROOT seems to lose the value in the last time these toolchain/platform files are executed. So they are empty. This causes my script to generate a fatal error.
toolchain.cmake has the following contents:
set(CMAKE_SYSTEM_NAME SDCC_PIC_16F877A)
# Finding resource settings
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# Set default MCU family and model
if (NOT MICROCHIP_FAMILY)
set(MICROCHIP_FAMILY "pic16")
endif()
if (MICROCHIP_MODEL STREQUAL "pic16")
set(MICROCHIP_MODEL "16f877a")
endif()
# Need a better way to detect the supported models here
if (NOT MICROCHIP_FAMILY STREQUAL "pic16" AND NOT MICROCHIP_MODEL STREQUAL "16f877a")
message(FATAL_ERROR "Settings not supported. Please drop a request.")
endif()
if (NOT SDCC_ROOT)
message(FATA_ERROR "Need to provide the root (from toolchain.)")
endif()
# Cache those variables
set(SDCC_ROOT "${SDCC_ROOT}"
CACHE INTERNAL "Root directory of SDCC installation")
set(MICROCHIP_FAMILY "${MICROCHIP_FAMILY}"
CACHE INTERNAL "Family of the chip to compile for")
set(MICROCHIP_MODEL "${MICROCHIP_MODEL}"
CACHE INTERNAL "Model of the chip to compile for")
the Module/Platform/SDCC_PIC_16F877A.cmake file has the contents:
# Check if the shit exists
message("!!! The value of root is ${SDCC_ROOT}")
if (NOT SDCC_ROOT)
message(FATAL_ERROR
"SDCC_ROOT is not defined. Please set this variable e.g.\n"
"cmake -DSDCC_ROOT=\"C:/Program Files/sdcc\"")
endif()
# Finding the compilers
find_program(CMAKE_C_COMPILER
sdcc
PATHS ${SDCC_ROOT}
PATH_SUFFIXES "bin"
DOC "path to the SDCC C compiler.")
and my CMakeLists.txt is the following:
cmake_minimum_required(VERSION 3.10)
project(PicExample)
message("THE COMPILER IS ${CMAKE_C_COMPILER}")
add_executable(pic_example main.c)
what I invoke from my project/build directory and the error I get:
cmake -DCMAKE_MODULE_PATH:FILEPATH="/mnt/c/Users/mathe/Desktop/coding/sdcc-pic-template/Modules" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="/mnt/c/Users/mathe/Desktop/coding/sdcc-pic-template/Modules/toolchain.cmake" -DSDCC_ROOT="testing/" ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
!!! The value of root is testing/
!!! The value of root is testing/
-- Check for working C compiler: /usr/bin/cc
FATA_ERRORNeed to provide the root (from toolchain.)
!!! The value of root is
CMake Error at /mnt/c/Users/mathe/Desktop/coding/sdcc-pic-template/Modules/Platform/SDCC_PIC_16F877A.cmake:4 (message):
SDCC_ROOT is not defined. Please set this variable e.g.
cmake -DSDCC_ROOT="C:/Program Files/sdcc"
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/CMakeSystemSpecificInformation.cmake:26 (include)
/mnt/c/Users/mathe/Desktop/coding/sdcc-pic-template/build/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:44 (try_compile):
Failed to configure test project build system.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/mnt/c/Users/mathe/Desktop/coding/sdcc-pic-template/build/CMakeFiles/CMakeOutput.log".
Why do the toolchain files get "executed" more than once by CMake and has no access to cache in the latest runs? I've been finding CMake documentation for cross-compilation very difficult, especially if you are working with a non-standard compiler.
I am aware that other people have had same issues before, but I am not simply asking for a simple hacky solution (setting environment variables). I actually want to know why this happens (which the previous answers don't tackle).
Tsyvarev answered the why the toolchain is used multiple times in CMake. TLDR; CMake needs it for multiple try_compile() calls it uses internally for error checking and other things.
This works just fine for me.
-DCMAKE_MODULE_PATH="${PATH_TO_MY_MODULES}" -DCMAKE_TOOLCHAIN_FILE="${PATH_TO_MY_TOOLCHAIN}" -DSDCC_SYSROOT="SOME_VALUE",
To fix your problem here is what you need to do.
Essentially you are passing an argument to your toolchain file. And this argument SDCC_SYSROOT essentially goes out of scope.
To fix this problem here is what you need to do.
# Use list(APPEND) rather than set() so that any variables added by CMake aren't lost!
#
# Here is the docs for this variable:
# https://cmake.org/cmake/help/latest/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.html
list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES ${SDCC_SYSROOT})
If you want to see how many times your toolchain script gets executed try putting in a message() call in there for fun.
And if you are really interested look inside your build folder and see what it is CMake is doing.
If you are wondering how I know this information it's because I read the toolchain section in Craig Scott's CMake book "Professional CMake:
A Practical Guide"
Here is a link: https://crascit.com/professional-cmake/
For determine, whether some feature is supported by the compiler or by some library, CMake uses try_compile approach: during the configuration phase, it creates separate CMake project and immediately configures and builds it. Because it is a separate project, its configuration has the same steps as the main project and it loads the toolchain file too.
try_compile could be used by the (user) project for check features of the library or of the compiler. There are many CMake modules which use try_compile in their implementation. E.g. CheckSymbolExists.
try_compile is also used by CMake itself, in platform files, when it perform basics checks for the compiler. In your log you could find the line:
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:44 (try_compile)
Aside from try_compile, the new CMake project is created in ExternalProject_Add command. That creation is also accompanied by the reading of the toolchain file. (More correctly, the new project is created not when ExternalProject_Add invocation is processed but when corresponding project is configured. This configuration is performed on the build stage of the main project.)

Errors while making tdlib example

l am trying to build a java example for the td lib following the README(https://github.com/tdlib/td/tree/master/example/java)
I have got following mistackes. Please tell how can I fix it?
C:\Users\irina\td\jnibuild>cmake -DCMAKE_BUILD_TYPE=Debug -DTD_ENABLE_JNI=ON -DCMAKE_INSTALL_PREFIX:PATH=../example/java/td ..
-- Could NOT find ccache
-- Found OpenSSL: C:/OpenSSL-Win32/include optimized;C:/OpenSSL-Win32/lib/VC/ssleay32MD.lib;debug;C:/OpenSSL-Win32/lib/VC/ssleay32MDd.lib;optimized;C:/OpenSSL-Win32/lib/VC/libeay32MD.lib;debug;C:/OpenSSL-Win32/lib/VC/libeay32MDd.lib
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
CMake Warning at CMakeLists.txt:256 (message):
Not found zlib: skip TDLib, tdactor, tdnet, tddb
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ZLIB_LIBRARY
linked by target "tdutils" in directory C:/Users/irina/td/tdutils
-- Configuring incomplete, errors occurred!
See also "C:/Users/irina/td/jnibuild/CMakeFiles/CMakeOutput.log".
See also "C:/Users/irina/td/jnibuild/CMakeFiles/CMakeError.log".
ZLIB for Windows is a part of the GnuWin32 project (I'm not sure whether it is allowed to give links on SO). As I see, the CMakeLists.txt uses find_package to lookup the ZLIB library:
if (NOT ZLIB_FOUND)
find_package(ZLIB)
endif()
if (NOT ZLIB_FOUND)
message(WARNING "Not found zlib: skip TDLib, tdactor, tdnet, tddb")
return()
endif()
How the find_package command works is well described in the official documentation:
The command has two modes by which it searches for packages: “Module” mode and
“Config” mode. Module mode is available when the command is invoked with the
above reduced signature. CMake searches for a file called Find<package>.cmake
in the CMAKE_MODULE_PATH followed by the CMake installation. If the file is
found, it is read and processed by CMake. It is responsible for finding the
package, checking the version, and producing any needed messages. Many find-
modules provide limited or no support for versioning; check the module
documentation. If no module is found and the MODULE option is not given the
command proceeds to Config mode.
I've had a look into FindZLIB.cmake on my Windows machine. The module uses the following path: ZLIB_ROOT and the following registry keys:
"[HKEY_LOCAL_MACHINE\SOFTWARE\GnuWin32\Zlib;InstallPath]"
"$ENV{PROGRAMFILES}/zlib
So, as I understand, if you install GnuWin32 using the installer, the HKLM key will be written down into the registry and CMake will be able to find the path to ZLIB. If you wish to use just the zip-archive, the ZLIB_ROOT parameter must be correctly specified when you run CMake:
cmake -DZLIB_ROOT=<PATH-to-your-unpacked-zlib> -D.....

Can I cause a CMake internal error?

Following my question What can cause a CMake option not work? I attempted to find out whether there is any difference between using clean-all.cmake and manually deleting the build directory. After running clean-all, I still experience the option problem. When I remove the build subdirectory, I receive the error message below:
-- Looking for include file pthread.h
-- Looking for include file pthread.h - not found
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
CMake Error at /usr/local/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/usr/local/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.2/Modules/FindThreads.cmake:204 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/Dependencies.cmake:11 (find_package)
CMakeLists.txt:53 (include)
and the log file only contains:
Determining if files pthread.h exist failed with the following output:
Source:
/* */
#include <pthread.h>
int main(void){return 0;}
And, since that, the system keeps telling that error. So, it looks like there is a difference :) ; what is it? Is it possible that my CMakeLists.txt leads to some internal error?
PS: After having this permanent error, I started to look for its reason, building up my CMakeLists.txt again, starting with deleted build subdirectory.
At the beginning, I have
option (CLEAN_ALL "Make a cleanup before building" OFF)
later
if(CLEAN_ALL)
include(cmake/clean-all.cmake)
endif(CLEAN_ALL)
and the cmake file is
# clean-all.cmake
# Cleans all subdirectories in the build subdirectory
set(cmake_generated ${CMAKE_BINARY_DIR}/CMakeCache.txt
${CMAKE_BINARY_DIR}/cmake_install.cmake
${CMAKE_BINARY_DIR}/Makefile
${CMAKE_BINARY_DIR}/CMakeFiles
# Above this, the common directories, below the project-specific ones
${CMAKE_BINARY_DIR}/bin
${CMAKE_BINARY_DIR}/lib
${CMAKE_BINARY_DIR}/QtGUI
${CMAKE_BINARY_DIR}/test
)
foreach(file ${cmake_generated})
if (EXISTS ${file})
file(REMOVE_RECURSE ${file})
endif()
endforeach(file)
It looks like the error is reproducible: deleting build and switching the option ON, I receive the error mentioned. At the same time, with option OFF, it builds OK. Is there anything harmful with using that clean-all?
CMake stores the state of the project built as files in the build directory for the project. These files are not protected, so improper modification of them (like deleting) may cause state of the project to become non-consistent.
Message Internal CMake error means that this is (probably) an error within CMake if project build files, generated by CMake, are not corrupted outside.
Otherwise, such an error just signals that the project build is broken somehow.
In the given case, the inconsistent state is caused by deleting file CMakeCache.txt during CMake invocation. The answer which is origin of your clean- all.cmake script explicitly says that after calling this script no CMake command will work.

How to avoid CMAKE error "Could NOT find <package>" when <package> is included as "add_subdirectory" of the same master project

I am trying to create a CMAKE project that includes other third party projects (OGRE3D, CEGUI, etc) and my specific project (or projects). More specifically, I have a directory tree like this:
+ myMasterProject
-----+ OGRE3D_DEPENDENCIES
-----+ OGRE3D_CORE
-----+ CEGUI
-----+ myProject
If I build the libraries manually one by one in the right order everything works fine (even myProject). Every project has its own CMakeLists.txt file, and they almost all use the find_package function. For example, CEGUI needs to find OGRE for the OGRE renderer and returns an error if does not find it with find_package(OGRE REQUIRED). myProject needs both OGRE and CEGUI.
An important detail is that I would not modify the CMakeLists.txt files of the subprojects, as I import them as sub-projects using mercurial or svn (depends on their respective CVS), and I prefer to update them regularly, without modifications (I'm not expert enough to modify them).
Does anyone have an idea on how to get to this result? shall I define all the variables like "OGRE_FOUND", "Boost_FOUND", and their respective sub-variables ("OGRE_LIB", "OGRE_H_PATH" etc) manually in my masterProject/CMakeLists.txt file or is there a "smarter" or "cleaner" way to do it? In any case, these variables have to be defined somehow, because they are needed by the projects...
For the moment, myMasterProject/CMakeLists.txt contains only:
project(myMasterProject)
add_subdirectory("OGRE3D_DEPENDENCIES")
add_subdirectory("OGRE3D_CORE")
add_subdirectory("CEGUI")
add_subdirectory("myProject")
Here is the CMAKE output that I get:
-- Configuring OGRE 1.8.2
-- Detected g++ 4.6.1
-- Enabling GCC visibility flags
-- Search path: /home/me/myMasterProject/build/OGRE3D_CORE/Dependencies;/home/me/myMasterProject/sources/OGRE3D_CORE/Dependencies;/home/me/myMasterProject/build/OGRE3D_CORE/../Dependencies;/home/me/myMasterProject/sources/OGRE3D_CORE/../Dependencies
-- Looking for ZLIB...
-- Found ZLIB: optimized;zlib;debug;zlib
-- Looking for ZZip...
-- Found ZZip: optimized;zziplib;debug;zziplib
-- Looking for FreeImage...
-- checking for module 'freeimage'
-- package 'freeimage' not found
-- Found FreeImage: optimized;FreeImage;debug;FreeImage
-- Looking for FREETYPE...
-- CMAKE_PREFIX_PATH: /home/me/myMasterProject/build/OGRE3D_CORE/Dependencies;/home/me/myMasterProject/sources/OGRE3D_CORE/Dependencies;/home/me/myMasterProject/build/OGRE3D_CORE/../Dependencies;/home/me/myMasterProject/sources/OGRE3D_CORE/../Dependencies;/usr/local;/usr/lib/x86_64-linux-gnu
-- CMAKE_PREFIX_PATH: /home/me/myMasterProject/build/OGRE3D_CORE/Dependencies;/home/me/myMasterProject/sources/OGRE3D_CORE/Dependencies;/home/me/myMasterProject/build/OGRE3D_CORE/../Dependencies;/home/me/myMasterProject/sources/OGRE3D_CORE/../Dependencies;/usr/local;/usr/lib/x86_64-linux-gnu
-- Found FREETYPE: optimized;freetype;debug;freetype
-- Looking for Cg...
-- checking for module 'Cg'
-- package 'Cg' not found
-- Found Cg: optimized;/usr/lib/libCg.so;debug;/usr/lib/libCg.so
-- Looking for POCO...
-- checking for module 'POCO'
-- package 'POCO' not found
-- Could not locate POCO
-- Looking for TBB...
-- Could not locate TBB
-- Looking for GLSL_Optimizer...
-- checking for module 'GLSL_Optimizer'
-- package 'GLSL_Optimizer' not found
-- Could not locate GLSL_Optimizer
-- Looking for HLSL2GLSL...
-- checking for module 'HLSL2GLSL'
-- package 'HLSL2GLSL' not found
-- Could not locate HLSL2GLSL
-- Looking for OIS...
-- Found OIS: optimized;OIS;debug;OIS
-- Looking for Softimage...
-- Could not locate Softimage
-- Looking for CppUnit...
-- Found CppUnit: optimized;/usr/lib/libcppunit.so;debug;/usr/lib/libcppunit.so
--
-----------------------------------------------------------------------------
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these packages.
+ zlib
+ zziplib
+ freeimage
+ freetype
+ X11
+ Xt
+ Xaw
+ OpenGL
+ OpenGL ES 2.x
+ cg
+ boost
+ boost-thread
+ boost-date_time
+ OIS
+ Doxygen
+ CppUnit
-----------------------------------------------------------------------------
-- The following OPTIONAL packages could NOT be located on your system.
-- Consider installing them to enable more features from this software.
+ OpenGL ES 1.x: Support for the OpenGL ES 1.x render system (DEPRECATED) <http://www.khronos.org/opengles/>
+ POCO: POCO framework <http://pocoproject.org/>
+ tbb: Threading Building Blocks <http://www.threadingbuildingblocks.org/>
+ GLSL Optimizer: GLSL Optimizer <http://github.com/aras-p/glsl-optimizer/>
+ HLSL2GLSL: HLSL2GLSL <http://hlsl2glslfork.googlecode.com/>
+ Softimage: Softimage SDK needed for building XSIExporter <FALSE>
-----------------------------------------------------------------------------
--
----------------------------------------------------------------------------
FEATURE SUMMARY
----------------------------------------------------------------------------
Building components:
+ Paging
+ Property
+ Terrain
+ RTShader System
+ RTShader System Core Shaders
+ RTShader System Extensions Shaders
Building plugins:
+ BSP scene manager
+ Cg program manager
+ Octree scene manager
+ Portal connected zone scene manager
+ Particle FX
Building rendersystems:
+ OpenGL
Building executables:
+ Samples
+ Tools
Building core features:
+ DDS image codec
+ FreeImage codec
+ ZIP archives
Build type: dynamic
Threading support: background (boost)
Use double precision: disabled
Allocator type: nedmalloc (pooling)
STL containers use allocator: enabled
Strings use allocator: disabled
Memory tracker (debug): disabled
Memory tracker (release): disabled
Use new script compilers: enabled
Use Boost: enabled
----------------------------------------------------------------------------
OGRE_LIB = OGRE_LIB-NOTFOUND
OGRE_H_PATH = OGRE_H_PATH-NOTFOUND
OGRE_H_BUILD_SETTINGS_PATH = OGRE_H_BUILD_SETTINGS_PATH-NOTFOUND
CMAKE_MODULE_PATH = /home/me/myMasterProject/sources/CEGUI/cmake
-- Could NOT find PCRE (missing: PCRE_LIB PCRE_H_PATH)
-- Could NOT find MINIZIP (missing: MINIZIP_LIB MINIZIP_H_PATH)
-- Could NOT find GLFW (missing: GLFW_LIB GLFW_H_PATH)
-- Could NOT find DIRECTXSDK (missing: DIRECTXSDK_LIB_PATH DIRECTXSDK_H_PATH DIRECTXSDK_MAX_D3D)
-- Could NOT find D3DX11EFFECTS (missing: D3DX11EFFECTS_LIB D3DX11EFFECTS_H_PATH)
-- Could NOT find IRRLICHT (missing: IRRLICHT_LIB IRRLICHT_H_PATH)
-- Could NOT find OGRE (missing: OGRE_LIB OGRE_H_PATH OGRE_H_BUILD_SETTINGS_PATH)
-- Could NOT find DIRECTFB (missing: DIRECTFB_LIB DIRECTFB_H_PATH)
-- Could NOT find OPENGLES (missing: OPENGLES_LIB OPENGLES_H_PATH)
-- Could NOT find XERCESC (missing: XERCESC_LIB XERCESC_H_PATH)
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
-- Could NOT find TINYXML (missing: TINYXML_LIB TINYXML_H_PATH)
-- Could NOT find RAPIDXML (missing: RAPIDXML_H_PATH)
-- Could NOT find IL (missing: IL_LIB IL_H_PATH)
-- Could NOT find ILU (missing: ILU_LIB)
-- Could NOT find SILLY (missing: SILLY_LIB SILLY_H_PATH)
-- Could NOT find CORONA (missing: CORONA_LIB CORONA_H_PATH)
-- Could NOT find PVRTOOLS (missing: PVRTOOLS_LIB PVRTOOLS_H_PATH)
-- Could NOT find LUA51 (missing: LUA_LIB LUA_H_PATH)
-- Could NOT find TOLUAPP (missing: TOLUAPP_LIB TOLUAPP_H_PATH)
-- Could NOT find Boost
CMake Error at /usr/share/cmake-2.8/Modules/CPack.cmake:338 (message):
CPack package description file:
"/home/me/myMasterProject/sources/doc/README" could not be
found.
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/CPack.cmake:342 (cpack_check_file_exists)
CEGUI/CMakeLists.txt:574 (include)
CMake Error at /usr/share/cmake-2.8/Modules/CPack.cmake:338 (message):
CPack license resource file:
"/home/me/myMasterProject/sources/doc/COPYING" could not be
found.
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/CPack.cmake:343 (cpack_check_file_exists)
CEGUI/CMakeLists.txt:574 (include)
CMAKE_MODULE_PATH =/home/me/myMasterProject/sources/myProject/cmake
CEGUI LIBRARY:
CEGUI OGRE LIBRARY:
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 2.8)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
As you can notice, when building OGRE everything seems to work well, but after, when CEGUI is building it does not recognize OGRE and related variables. Idem for myProject...
Thanks in advance for your answers,
Cheers
DISCLAIMER: I am almost a newbie with CMAKE... Moreover, I know that similar questions have been already posted here, but I didn't find an answer that works...
Setting the variables for the find script yourself in the master project is a valid approach. It is a bit fragile in the sense that you rely on the respective projects not changing their find scripts, but otherwise this seems perfectly fine.
An alternative could be using CMake's ExternalProject functionality. With this approach, instead of building all dependencies from your master project, they get built during CMake configure time. The advantage here is that dependencies are built as if you would build them directly from the command line, so the effects described in your question are avoided. It also does not depend on any of the dependency's build system internals.