Xavier Larrode wrote: > 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 .
FILE(GLOB CPPFILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) IF(CMAKE_COMPILER_IS_GNUCXX) SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall") ENDIF(CMAKE_COMPILER_IS_GNUCXX) ADD_LIBRARY(Trace ${CPPFILES}) -- Filipe Sousa
signature.asc
Description: OpenPGP digital signature
_______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake