W
W
warchant2016-12-13 01:24:56
C++ / C#
warchant, 2016-12-13 01:24:56

How to build and test ExternalProject (Makefile) in cmake?

Good evening.
My project includes as a module (git submodule) another project. My project uses CMake, the connected project uses Makefile. This Makefile has two targets: all, test. I want to run make test in this module while running CTest on my project. How to do it right?
Something like this now

SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/test_bin)

SET(GTEST_INCLUDE_DIR ${PROJECT_BINARY_DIR}/gtest/src/googletest/googletest/include)
SET(ED25519_PATH "${PROJECT_SOURCE_DIR}/core/vendor/ed25519")


include(ExternalProject)

ExternalProject_Add(
    ed25519
    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/modules
    SOURCE_DIR ${ED25519_PATH}
    BUILD_COMMAND make -f ${ED25519_PATH}/Makefile
    TEST_COMMAND make test -f ${ED25519_PATH}/Makefile
    INSTALL_COMMAND ""
)

But he writes to me
CMake Error: The source directory "somepath/core/vendor/ed25519" does not appear to contain CMakeLists.txt.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question