How to use ExternalProject_Add to compile assimp's dynamic link library
- User
How to use ExternalProject_Add to compile assimp's dynamic link library
- Assistant
To use
ExternalProject_Addto compile Assimp's dynamic link library, you can follow these steps:-
Create a
CMakeLists.txtfile in your project's root directory. This file will contain the build instructions for your project. -
Use the
ExternalProject_Addfunction to define a separate compilation project for Assimp.include(ExternalProject) ExternalProject_Add( assimp PREFIX ${CMAKE_BINARY_DIR}/assimp URL https://github.com/assimp/assimp/archive/master.zip SOURCE_SUBDIR ./assimp-master CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/assimp )
-
- User
CMake Error at /home/chase/miniconda3/envs/py39/lib/python3.9/site-packages/cmake/data/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler
"/usr/bin/ccache"is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/chase/dexforce/bk/rlia/build/assimp/src/ext_assimp-build/CMakeFiles/CMakeScratch/TryCompile-pvCuIf Run Build Command(s):/home/chase/miniconda3/envs/py39/lib/python3.9/site-packages/cmake/data/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_faffb/fast && make[4]: Entering directory '/home/chase/dexforce/bk/rlia/build/assimp/src/ext_assimp-build/CMakeFiles/CMakeScratch/TryCompile-pvCuIf' /usr/bin/make -f CMakeFiles/cmTC_faffb.dir/build.make CMakeFiles/cmTC_faffb.dir/build make[5]: Entering directory '/home/chase/dexforce/bk/rlia/build/assimp/src/ext_assimp-build/CMakeFiles/CMakeScratch/TryCompile-pvCuIf' Building C object CMakeFiles/cmTC_faffb.dir/testCCompiler.c.o /usr/bin/ccache -o CMakeFiles/cmTC_faffb.dir/testCCompiler.c.o -c /home/chase/dexforce/bk/rlia/build/assimp/src/ext_assimp-build/CMakeFiles/CMakeScratch/TryCompile-pvCuIf/testCCompiler.c ccache: error: missing equal sign in "CMakeFiles/cmTC_faffb.dir/testCCompiler.c.o" make[5]: *** [CMakeFiles/cmTC_faffb.dir/build.make:78: CMakeFiles/cmTC_faffb.dir/testCCompiler.c.o] Error 1 make[5]: Leaving directory '/home/chase/dexforce/bk/rlia/build/assimp/src/ext_assimp-build/CMakeFiles/CMakeScratch/TryCompile-pvCuIf' make[4]: *** [Makefile:127: cmTC_faffb/fast] Error 2 make[4]: Leaving directory '/home/chase/dexforce/bk/rlia/build/assimp/src/ext_assimp-build/CMakeFiles/CMakeScratch/TryCompile-pvCuIf' - Assistant
The error message indicates that CMake is unable to compile a simple test program using the C compiler
/usr/bin/ccache. This could be due to a configuration issue with your C compiler setup.To resolve this issue, you can try the following steps:
-
Check if
/usr/bin/ccacheis the correct C compiler path. You can verify this by running the commandwhich ccachein your terminal. If it returns a different path, update theccachevariable in your CMake configuration accordingly. -
Ensure that your C compiler is installed correctly and accessible. You can do this by running
gcc --versionin your terminal. If it's not installed, install it using your package manager (e.g., for Ubuntu).
-