[CMake] ADD_SUBDIRECTORY error

Xavier Larrode Xavier.Larrode at irisa.fr
Fri Jul 28 06:02:08 EDT 2006


Hi all,

I'm compiling a subDirectory ie : ( ${GVTROOTDIR}/src/test )  with this 
CMakeList.txt :
# get GVTROOT ENV VAR
SET(GVTROOTDIR $ENV{GVTROOT})
# keep all *.cpp files
FILE(GLOB CPPFILES  RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
MESSAGE("Fichiers à compiler ${CPPFILES}")
#EXE
SET(TARGET ${GVTROOTDIR}/lib/libTrace.so)
ADD_EXECUTABLE(${TARGET} ${CPPFILES})
#CFLAGS
SET(DEBUG_FLAGS "-g -Wall")
INCLUDE_DIRECTORIES(
  ${GVTROOTDIR}/src/include )
#LD
SET(LINK_FLAGS "-elf -shared")
#ADD CFLAGS TO TARGET
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS "${DEBUG_FLAGS}")
#ADD LDFLAGS TO TARGET
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LINK_FLAGS "${LINK_FLAGS}")


And i got a problem with the INCLUDE_DIRECTORIES and this error message :
ADD_SUBDIRECTORY A full source directory was specified that is not in 
the source tree but no binary directory was specified. If you specify an 
out of tree source directory then you must provide the binary directory 
as well.

Any idea how to do it ?

And actually, i'm trying to compile a library, so i had "-elf -shared"  
to the LINK_FLAGS but i don't know if it's the right solution...

Thanks .
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Xavier.Larrode.vcf
Type: text/x-vcard
Size: 169 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20060728/7aaea8cb/Xavier.Larrode.vcf


More information about the CMake mailing list