[CMake] How to install external project
Martin Vymazal
martin.vymazal at vki.ac.be
Mon Jul 16 07:44:00 EDT 2012
Hello,
I'm sorry but I don't understand what 'target' you're talking about. I only
define the name of the target executable, but the library name blas_LINUX.a is
defined by the Makefile of blas.
I forgot to paste the 2 last lines of my CMakeLists.txt. The whole thing looks
like this:
cmake_minimum_required(VERSION 2.8)
project(OpenBlasTest)
include(ExternalProject)
ExternalProject_Add(Blas
SOURCE_DIR ${CMAKE_SOURCE_DIR}/contrib/blas
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
BUILD_COMMAND make
INSTALL_DIR ${CMAKE_BINARY_DIR}/install
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/install
)
add_executable(test blas_test.cpp)
target_link_libraries(test ${CMAKE_BINARY_DIR}/install/blas_LINUX.a)
Martin Vymazal
On Sunday 15 of July 2012 10:20:28 joewan wrote:
> hi,
> I think you should modify the target file name "blas_LINUX.a",changing it to
> your real target file name.
>
> Martin Vymazal <martin.vymazal at vki.ac.be>编写:
>
> >Hello,
> >
> > thanks for your advice. Unfortunately, I must still be doing something
> >
> >wrong. Now I have this:
> > make[3]: *** No rule to make target `install'. Stop.
> >
> > My CMakeLists.txt is below.
> >
> >cmake_minimum_required(VERSION 2.8)
> >project(OpenBlasTest)
> >
> >include(ExternalProject)
> >ExternalProject_Add(Blas
> >
> > SOURCE_DIR ${CMAKE_SOURCE_DIR}/contrib/blas
> > BUILD_IN_SOURCE 1
> > CONFIGURE_COMMAND ""
> > BUILD_COMMAND make
> > INSTALL_DIR ${CMAKE_BINARY_DIR}/install
> > CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/install
> >
> >)
> >
> >
More information about the CMake
mailing list