Sqlite_orm: This error occurred when I executed the cmake instruction。How to solve this problem?plz

Created on 29 Sep 2019  Â·  5Comments  Â·  Source: fnc12/sqlite_orm

CMake Error at tests/CMakeLists.txt:21 (find_package):
By not providing "FindCatch2.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Catch2", but
CMake did not find one.

Could not find a package configuration file provided by "Catch2" with any
of the following names:

Catch2Config.cmake
catch2-config.cmake

Add the installation prefix of "Catch2" to CMAKE_PREFIX_PATH or set
"Catch2_DIR" to a directory containing one of the above files. If "Catch2"
provides a separate development package or SDK, be sure it has been
installed.

help wanted

All 5 comments

How does this work on travis and appveyor?

You need to install Catch2 on your system.
Linux/Mac it's installed via a package manager(brew/apt, etc)
Windows is via vcpkg.

Ok I see. If someone can please make a PR with fix cause I am not a pro in CMake =(

I am still learning CMake but I don't think this is a bug. If you want to build the tests you need to install Catch2. You can pass -DSqliteOrm_BuildTests=OFF to cmake if you don't want to build them and you shouldn't get that error. Also, the default behavior can be changed to not build the tests and add building tests option to CI only.

Well, in line 39 of your appveyor. yml file, there are instructions for "vcpkg install catch2" installation.

If I don't use the "vcpkg" tool, I won't install "catch2" before compiling.

However, my compilation environment is Ubuntu Trusty 14.04. Installation of vcpkg will fail, and I may need to upgrade to Ubuntu Xenial (16.04) for online access.

You can also set "option" (SqliteOrm_BuildTests "Build sqlite_orm unit tests" OFF) in MakeFile.txt.

Anyway, thank you for your help.(~ ̄▽ ̄)~

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kungfu-origin picture kungfu-origin  Â·  10Comments

meghasemim1999 picture meghasemim1999  Â·  10Comments

ncoder-1 picture ncoder-1  Â·  5Comments

leonyu1010 picture leonyu1010  Â·  9Comments

jakemumu picture jakemumu  Â·  9Comments