Skip to content

Compilation failing on OSX 10.15.6 (Catalina) with error "<rapidjson/prettywriter.h> not found" #964

Open
@rohan-kekatpure

Description

@rohan-kekatpure

I'm new to CMake but familiar with compilation of C++ projects from source. When trying to compile pythonocc from source on OSX-catalina, the compilation fails with the following error

In file included from /.../pythonocc/pythonocc-core/cmake-build/Darwin/x86_64-Release-/RWGltfPYTHON_wrap.cxx:4875:
In file included from /.../pythonocc/pythonocc-core/src/SWIG_files/headers/RWGltf_module.hxx:34:
/usr/local/include/opencascade/RWGltf_GltfOStreamWriter.hxx:17:10: fatal error: 'rapidjson/prettywriter.h' file not found
#include <rapidjson/prettywriter.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~

I installed rapidjson using brew install rapidjson and confirmed that the required files (specifically prettywriter.h) was present in the include directories. Yet CMake was not including the header files in /usr/local/include (my guess).

EDIT
Adding

include_directories("/usr/local/include") 

inside the

if(APPLE)
endif(APPLE)

solved the issue.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions