From 61a024e1822f88f669744d99c55a775d1dc8466b Mon Sep 17 00:00:00 2001 From: Brannon King Date: Fri, 19 Jul 2019 11:27:24 -0600 Subject: [PATCH] moved cmake build to a subfolder --- README.md | 9 +++++++++ CMakeLists.txt => contrib/cmake/CMakeLists.txt | 6 +++--- {cmake => contrib/cmake/cmake}/CPM.cmake | 0 {cmake => contrib/cmake/cmake}/FindBerkeleyDB.cmake | 0 {cmake => contrib/cmake/cmake}/FindLibevent.cmake | 0 5 files changed, 12 insertions(+), 3 deletions(-) rename CMakeLists.txt => contrib/cmake/CMakeLists.txt (96%) rename {cmake => contrib/cmake/cmake}/CPM.cmake (100%) rename {cmake => contrib/cmake/cmake}/FindBerkeleyDB.cmake (100%) rename {cmake => contrib/cmake/cmake}/FindLibevent.cmake (100%) diff --git a/README.md b/README.md index ee9ebf776..c4e4b4383 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,15 @@ cd lbrycrd If you encounter any errors, please check `doc/build-*.md` for further instructions. If you're still stuck, [create an issue](https://github.com/lbryio/lbrycrd/issues/new) with the output of that command, your system info, and any other information you think might be helpful. The scripts in the packaging folder are simple and will grant extra light on the build process as needed. +#### Use with CLion: +CLion has not traditionally supported Autotools projects, although some progress on that is now in the works. We do include a cmake build file for compiling lbrycrd. See contrib/cmake. Alas, CLion doesn't support external projects in cmake, so that particular approach is also insufficient. CLion does support "compile_commands.json" projects. Fortunately, this can be easily generated for lbrycrd like so: +``` +pip install --user compiledb +./autogen.sh && ./configure --enable-static=no --enable-shared --with-pic --without-gui CXXFLAGS="-O0 -g" CFLAGS="-O0 -g" # or whatever normal lbrycrd config +compiledb make -j10 +``` +Then open the newly generated compile_commands.json file as a project in CLion. Debugging is supported if you compiled with `-g`. To enable that you will need to create a target in CLion by going to File -> Settings -> Build -> Custom Build Targets. Add an empty target with your choice of name. From there you can go to "Edit Configurations", typically found in a drop-down at the top of the editor. Add a Custom Build Application, select your new target, select the compiled file (i.e. test_lbrycrd or lbrycrdd, etc), and then add any necessary command line parameters. Ensure that there is nothing in the "Before launch" section. + ## Contributing Contributions to this project are welcome, encouraged, and compensated. For more details, see [https://lbry.tech/contribute](https://lbry.tech/contribute) diff --git a/CMakeLists.txt b/contrib/cmake/CMakeLists.txt similarity index 96% rename from CMakeLists.txt rename to contrib/cmake/CMakeLists.txt index 3be979e59..e1e1e96c2 100644 --- a/CMakeLists.txt +++ b/contrib/cmake/CMakeLists.txt @@ -177,9 +177,9 @@ separate_arguments(OPTIONS) ExternalProject_Add(lbrycrdd PREFIX lbrycrdd DEPENDS ${DEPENDS} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/autogen.sh - && ${CMAKE_CURRENT_SOURCE_DIR}/configure ${OPTIONS} CPPFLAGS=${CPPFLAGS} LDFLAGS=${LDFLAGS} --prefix= + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../.. + CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../../autogen.sh + && ${CMAKE_CURRENT_SOURCE_DIR}/../../configure ${OPTIONS} CPPFLAGS=${CPPFLAGS} LDFLAGS=${LDFLAGS} --prefix= BUILD_IN_SOURCE 1 BUILD_ALWAYS 1 ) diff --git a/cmake/CPM.cmake b/contrib/cmake/cmake/CPM.cmake similarity index 100% rename from cmake/CPM.cmake rename to contrib/cmake/cmake/CPM.cmake diff --git a/cmake/FindBerkeleyDB.cmake b/contrib/cmake/cmake/FindBerkeleyDB.cmake similarity index 100% rename from cmake/FindBerkeleyDB.cmake rename to contrib/cmake/cmake/FindBerkeleyDB.cmake diff --git a/cmake/FindLibevent.cmake b/contrib/cmake/cmake/FindLibevent.cmake similarity index 100% rename from cmake/FindLibevent.cmake rename to contrib/cmake/cmake/FindLibevent.cmake