Hello.

I'm using ExternalProject to build a CMakeLists.txt in a subdirectory.
This subdirectory is used by other applications, files are included
from that subdirectory directly, but that subdirectory doesn't install
anything but does contain the unit tests for the files in that
directory and I'd still like 'make test' to work properly from my top
level CMakeLists.txt that is including this ExternalProject.

So, I'm trying to override the INSTALL_COMMAND but it doesn't appear
to be working correctly.

#add_subdirectory(shared_cpp)
ExternalProject_Add(
    shared_cpp
    SOURCE_DIR ${CMAKE_SOURCE_DIR}/shared_cpp
    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
               -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
    TEST_COMMAND make test
    INSTALL_COMMMAND ""
)


I'm still seeing cmake calling 'make install' and this causes a build failure:

make[2]: Entering directory `/home/cmorgan/projects/external/build'
/usr/bin/cmake -E cmake_progress_report
/home/cmorgan/projects/external/build/CMakeFiles 18
[ 39%] Performing install step for 'shared_cpp'
cd /home/cmorgan/projects/external/build/shared_cpp-prefix/src/shared_cpp-build
&& make install
make[3]: Entering directory
`/home/cmorgan/projects/external/build/shared_cpp-prefix/src/shared_cpp-build'
make[3]: *** No rule to make target `install'.  Stop.
make[3]: Leaving directory
`/home/cmorgan/projects/external/build/shared_cpp-prefix/src/shared_cpp-build'
make[2]: *** [shared_cpp-prefix/src/shared_cpp-stamp/shared_cpp-install] Error 2
make[2]: Leaving directory `/home/cmorgan/projects/external/build'
make[1]: *** [CMakeFiles/shared_cpp.dir/all] Error 2
make[1]: Leaving directory `/home/cmorgan/projects/external/build'
make: *** [all] Error 2
[cmorgan@localhost build]$



Any ideas how I can fix this?

It may be that I've got something structurally wrong with the project,
for instance, because the shared_cpp/ CMakeLists.txt isn't installing
anything, so I'd welcome suggestions. The files in this directory are
used by several different applications (and the folder is itself a git
submodule). Should I be making this into a library?? I haven't been
able to find good cmake examples for large multi-executable projects
and I didn't really want to have separate git repositories for each of
our small executables that contained their own submodules of
shared_cpp, for instance.

Chris
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to