[Cmake] (no subject)

Brad King brad . king at kitware . com
Thu, 9 Oct 2003 16:11:15 -0400 (EDT)


On Thu, 9 Oct 2003, Shannon Hastings wrote:

> Is there a way to reset the COMPILER that is used in cmake to something
> different for particular subdirs?
>
> For example:
>    Directories:
> 	--Src
> 	   --Parallel (to be built with mpicc)
> 	   --Core (to be built with gcc)
>
> And still be able to use the ADD_LIBRARY and ADD_EXECUTABLE commands?

I'm not aware of any way to do this, but you do not need mpicc to use MPI.
Just put this code in Parallel/CMakeLists.txt:

FIND_PACKAGE(MPI)

INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH})

ADD_LIBRARY(mylib ...)

TARGET_LINK_LIBRARIES(mylib ${MPI_LIBRARY})

-Brad