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

CMake Error at CMakeLists.txt:35 (add_subdirectory) #38

Closed
0ric1 opened this issue May 6, 2019 · 4 comments
Closed

CMake Error at CMakeLists.txt:35 (add_subdirectory) #38

0ric1 opened this issue May 6, 2019 · 4 comments

Comments

@0ric1
Copy link

0ric1 commented May 6, 2019

After downloading the zip release 3.1 and unpacking I did md build and cd build and called cmake .. and got the following error:

-- Building for: Visual Studio 15 2017
-- The CXX compiler identification is MSVC 19.16.27030.1
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:35 (add_subdirectory):
The source directory

T:/temp/utfcpp31/extern/gtest

does not contain a CMakeLists.txt file.

-- Configuring incomplete, errors occurred!
See also "T:/temp/utfcpp31/build/CMakeFiles/CMakeOutput.log".

It seems gtest is missing.

@matlo607
Copy link

You should either disable the build of tests using -DUTF8_TESTS=off or run git submodule update --init at the root of the project to clone googletest's repository into extern/gtest.

@nemtrif
Copy link
Owner

nemtrif commented May 11, 2019

The zip does not contain the google test library. It's really intended for CI runs only.

@nemtrif nemtrif closed this as completed May 11, 2019
@0ric1
Copy link
Author

0ric1 commented May 11, 2019

I would expect that googletest is included in the zip too or downloaded automatically, other libraries contain everything to build too or download on demand e.g. googlebenchmark https://github.com/google/benchmark that adds googletest on demand with cmake ExternalProject_Add .

@matlo607
Copy link

@blonder : including the sources of a third party in a project is, in my opinion, not a good idea for several reasons (build systems' incompatibility, forking prevent you from getting update, new features and bug fixes easily, ...).

Using a package manager to pull the dependencies is a preferable approach. C++ does not offer an official one yet. I would advise you to have a look at Conan.

git-submodule has a good reason to exist for big projects. That allows to add modularity to the project and also avoid to hit Git's performance issues when you have millions of files. This approach has an important drawback, it only works if the build systems of the projects are the same (unless you write an adapter yourself, good luck with that).

ExternalProject_Add is not a good idea too. CMake is a build system, not a package manager. People want to do everything with it, I think it's an error.

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

3 participants