[CMake] Problem with the path when including another Cmakelist file

Renan Greinert Renan.Greinert at daiken.com.br
Wed Feb 3 08:35:51 EST 2010


Hello,
I am trying to develop a database for codes for reuse, and I would like to use CMake to manage it.
Here is how my files are organizated:

In
/codes/Thread/
IThread.h
Thread.cpp
Runnable.h
CMakelists_Thread.txt



Then, inside CMakelists_Thread.txt I have:

#cmake_minimum_required(VERSION 2.6.4)

set (THREADS_HEADERS
                IThread.h
                Runnable.h )

set (THREADS_SRCS
      Thread.cpp )
endif (WIN32)


set ( REUSE_CODE_HEADERS
                ${ REUSE_CODE_HEADERS }
                ${ THREADS_HEADERS }
)

set (REUSE_CODE_SRCS
                ${ REUSE_CODE_SRCS }
                ${ THREADS_SRCS }
)



Then I have a project that uses Threads.  This project is in /project/src

So, in /project/src I have my CMakelists.txt:


cmake_minimum_required(VERSION 2.6.4)

include ( "../../codes/Thread/CMakelists_Thead.txt" )

PROJECT (Test)

INCLUDE_DIRECTORIES (${REUSE_CODE_HEADERS } )

ADD_EXECUTABLE( Test main.cpp ${ REUSE_CODE_HEADERS } ${ REUSE_CODE_SRCS } )



When I try to run CMake on it, it returns the error that "IThread.h" was not found.

If I move the project files to the /codes/Thread/ folder (and update the path of the "include" in CMakelists.txt) it works fine.
So it seems that CMake is considering the path of CMakelists.txt to include the IThread.h, Runnable.h and Thread.cpp, and not the path of CMakelists_thread.txt.

Is there any way to solve this problem?

Thanks!

Renan














________________________________
AVISO LEGAL
Esta mensagem ? exclusivamente para a pessoa a quem se destina e pode conter informa??es confidenciais ou legalmente protegidas. A transmiss?o incorreta da mensagem n?o acarreta a perda de seu car?ter confidencial. Caso ela tenha sido recebida por engano, solicitamos que seja devolvida ao remetente e apagada de seu sistema imediatamente. ? vedado, a qualquer pessoa que n?o seja destinat?rio, usar, revelar, distribuir ou copiar qualquer parte desta mensagem.

DISCLAIMER
This message is destined exclusively to the intendend receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is receiveid by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not intendend receiver to use, reveal, distribute, or copy any part if this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100203/7be10d48/attachment-0001.htm>


More information about the CMake mailing list