tpaviot / oce

OpenCASCADE Community Edition (OCE): a community driven fork of the Open CASCADE library.
http://groups.google.com/group/oce-dev
GNU Lesser General Public License v2.1
808 stars 284 forks source link

ADD RapidJSON #735

Open bbrangeo opened 3 years ago

bbrangeo commented 3 years ago

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'