[CMake] 1 tricky question, 1 bug report

Denis Scherbakov denis_scherbakov at yahoo.com
Fri Mar 13 10:52:45 EDT 2009


> I don't understand the question here?   At gmake time
> why do they need to know anything about mico or libxml2?

Ok, I will try harder now:

Let's say I have a main CMakeLists.txt and 2 sub projects:
=============CMakeLists.txt
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.1 FATAL_ERROR)

INCLUDE(FindLibXml2)

ADD_SUBDIRECTORY(targetA)
ADD_SUBDIRECTORY(targetB)
=============targetA/CMakeLists.txt
PROJECT(SOMENAME)

SET (SOMENAME_SRCS "source.cpp")

IF ( NOT LIBXML2_FOUND )
  MESSAGE( FATAL_ERROR "Required library libxml2 was not found." )
ENDIF ()

ADD_EXECUTABLE(somename ${SOMENAME_SRCS})
=============targetB/CMakeLists.txt
PROJECT(OTHERNAME)

SET (OTHERNAME_SRCS "other_source.cpp")

ADD_EXECUTABLE(othername ${OTHERNAME_SRCS})
=============

Now, I have a developer which wants to build "othername" from targetB
directory, which does not depend on anything. He does:

cmake /path/to/main/file/

Before the developer issues "gmake othername" he gets an error that
LibXml2 was not found.

How to perform a dependency check, only when the project is being built?
Or how to get a cmake code, which gets executed before the project starts
to build, like in ADD_CUSTOM_COMMAND?

> Try CMake 2.6.3, I am pretty sure we fixed the fortran
> comment module issue.

I have "cmake version 2.6-patch 3" from http://www.cmake.org/files/v2.6/cmake-2.6.3.tar.gz. The bug is still there.

Denis


      


More information about the CMake mailing list