[CMake] Call multiple Makefile
Xavier Larrode
Xavier.Larrode at irisa.fr
Thu Jul 27 11:43:27 EDT 2006
Hi and thanks filipe,
> ADD_SUBDIRECTORY(src/common/share/folder1)
> ADD_SUBDIRECTORY(...)
>
> or
>
> SET(REPERTOIRES src/common/share/folder1 ...)
> FOREACH(folder ${REPERTOIRES})
> ADD_SUBDIRECTORY(${folder})
> ENDFOREACH(folder)
>
> for each one of these directories you have to create a CMakeLists.txt
> with commands to compile your sources (ADD_EXECUTABLE or ADD_LIBRARY)
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
I tried what you said with a simple example of mine.
1> on my folder root :
PROJECT(Test) #ProjetctName
# to see command line of gcc
SET(CMAKE_VERBOSE_MAKEFILE 1)
# to add Color on CMake Process
SET(CMAKE_COLOR_MAKEFILE ON)
SET(REPERTOIRES
/[...]/root/test )
FOREACH(folder ${REPERTOIRES})
ADD_SUBDIRECTORY(${folder})
ENDFOREACH(folder)
2> on [..]root/test :
INCLUDE(FindOpenSG.cmake)
# check if osg-config was found
IF(OPENSG_FOUND)
SET(CMAKE_CXX_FLAGS "${OPENSG_CXX_FLAGS}")
LINK_DIRECTORIES(${OPENSG_LINK_DIRECTORIES})
ADD_EXECUTABLE(test testCubeTexture.cpp) #Executable and file(s) to
compile
TARGET_LINK_LIBRARIES(test ${OPENSG_LIBRARIES})
ELSE(OPENSG_FOUND)
MESSAGE(STATUS "Cannot find osg-config anywhere on the system. Please
put the file into your path or specify it in CMAKE_OSG_CONFIG.")
ENDIF(OPENSG_FOUND)
But i got this error :
CMake Error: Error required internal CMake variable not set, cmake may
be not be built correctly.
Missing variable is:
CMAKE_SIZEOF_VOID_P
And CMAKE_INSTALL_PREFIX is ok
Any idea ?
-------------- 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/20060727/552cd1f7/Xavier.Larrode.vcf
More information about the CMake
mailing list