xhawk18 / promise-cpp

C++ promise/A+ library in Javascript style.
MIT License
672 stars 92 forks source link

Project structure rearranged. #20

Closed 5cript closed 2 years ago

5cript commented 2 years ago

Sorry, I think I took out too much last PR with the PROMISE_BUILD_EXAMPLES option. I did go a bit further and rearranged the structure slightly. Now I can do the following

include(FetchContent)
FetchContent_Declare(
    promise
    GIT_REPOSITORY https://github.com/xhawk18/promise-cpp.git
    GIT_TAG        e41e25c9b078141ff2e499cd6a2678386b67311e
)
FetchContent_MakeAvailable(promise)

add_executable(myProgram ...)
target_link_library(myProgram PRIVATE promise)
#include <promise-cpp/promise.hpp>
// Notice that these are now directly available, and can be used when boost is found:
#include <promise-cpp/add_ons/asio/timer.hpp>

int main()
{
  setTimeout(...)
}
5cript commented 2 years ago

I cannot test the qt dependent target, but If I did it right using the QT part is equally easy with: target_link_library(myProgram PRIVATE promise_qt)