[CMake] Is this the rigth way to build a shared library?

2019-06-27 Thread dexter810
This is my CMakeLists.txt which is successfully building a shared library, I just wanted to confirm if it's the right way and it: cmake_minimum_required(VERSION 3.6) project(main) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include

Re: [CMake] Write CMakeLists.txt for this C++ program

2019-06-23 Thread dexter810
I built this C++ executable using CMake 3.10.2 in Ubuntu 18.04 and it was built successfully using the first approach. I'm now trying to build it using the same CMakeLists.txt and folder structure in Android Studio which is also using CMake 3.10.2, this time a library not an executable, that being

[CMake] Building a c++ library using CMake in Android Studio

2019-06-21 Thread dexter810
I built this C++ library using CMake 3.10.2 in Ubuntu 18.04 and it was built successfully. I'm trying to build it using the same CMakeLists.txt and folder structure in Android Studio which is also using Cmake 3.10.2. On running inspection results inside Android Studio, inside C++, declaration

Re: [CMake] Write CMakeLists.txt for this C++ program

2019-06-19 Thread dexter810
*Approach 1:* CMakeLists.txt: cmake_minimum_required(VERSION 3.6) project(main CXX C) add_executable(main main.cpp) target_include_directories(main PRIVATE include build/deps/yara/src/yara/libyara/include) target_link_libraries (main -Lbuild/src/

[CMake] Write CMakeLists.txt for this C++ program

2019-06-19 Thread dexter810
This is the program I want to run, main.cpp: #include #include "yaracpp/yaracpp.h" int main() { yaracpp::YaraDetector yara; yara.addRules(R"( rule example { strings: $s = "Hello" condition: $s })"); if