Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake issue when compiling redis3m as submodule (use CMake add_subdirectory) #49

Open
zyy17 opened this issue Mar 2, 2017 · 0 comments

Comments

@zyy17
Copy link

zyy17 commented Mar 2, 2017

I use redis3m as git submodule in my project:

$ tree -L 1 ch1/
ch1/
├── build
├── CMakeCache.txt
├── CMakeFiles
├── cmake_install.cmake
├── CMakeLists.txt
├── gtest/
├── main.cc
├── Makefile
├── redis3m/
└── test

I add CMake add_subdirectory to compile redis3m:

add_subdirectory(redis3m)

Then I got the following error message:

[ 41%] Built target redis3m
make[2]: *** No rule to make target `Doxyfile', needed by `redis3m/docs'.  Stop.
make[1]: *** [redis3m/CMakeFiles/apidoc.dir/all] Error 2
make: *** [all] Error 2

I fix the error by changing CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR:

 FIND_PACKAGE(Doxygen QUIET)
 IF (DOXYGEN_FOUND)
-        SET(DOXYGEN_INPUT "${CMAKE_SOURCE_DIR}/Doxyfile")
+      SET(DOXYGEN_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile")
   SET(DOXYGEN_OUTPUT "docs")

I think CMAKE_CURRENT_SOURCE_DIR better than CMAKE_SOURCE_DIR when compiling redis3m in a project with multiple dependencies (When compiling redis3m alone, the two variable is same).

@zyy17 zyy17 changed the title CMake issue (when use add_subdirectory) CMake issue when compiling redis3m as submodule (when using CMake add_subdirectory) Mar 2, 2017
@zyy17 zyy17 changed the title CMake issue when compiling redis3m as submodule (when using CMake add_subdirectory) CMake issue when compiling redis3m as submodule (use CMake add_subdirectory) Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant