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

ADD RapidJSON #735

Open
bbrangeo opened this issue Nov 16, 2020 · 0 comments
Open

ADD RapidJSON #735

bbrangeo opened this issue Nov 16, 2020 · 0 comments

Comments

@bbrangeo
Copy link

I suggest to add in CMakeLists.txt


if(PKG_CONFIG_FOUND)
    pkg_check_modules(RapidJSON RapidJSON)
endif()

if(NOT RapidJSON_FOUND)
    # try old method

    # find_package without unsetting this var is not working correctly
    unset(RapidJSON_FOUND CACHE)
    find_package(RapidJSON REQUIRED)

    if(RapidJSON_FOUND)
        set(RapidJSON_LIBRARIES ${RapidJSON_LIBRARY})
        set(RapidJSON_INCLUDE_DIRS ${RapidJSON_INCLUDE_DIR})
        message(STATUS "RapidJSON library found the old way (w/o pkg-config)")
    endif()
endif()

if(NOT RapidJSON_FOUND)
    message(FATAL_ERROR "RapidJSON library not found")
endif()

include_directories(${RapidJSON_INCLUDE_DIRS})
link_directories(${RapidJSON_LIBRARY_DIRS})

And add -DRapidJSON_INCLUDE_DIRS='path'
-DRapidJSON_LIBRARY_DIRS='path'

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