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

[BUG] Failed to execute cmake at client_server directory. #942

Closed
nieyuyao opened this issue Mar 26, 2022 · 5 comments · Fixed by #1285
Closed

[BUG] Failed to execute cmake at client_server directory. #942

nieyuyao opened this issue Mar 26, 2022 · 5 comments · Fixed by #1285
Labels
bug dont-close This issue/pull request shouldn't be closed

Comments

@nieyuyao
Copy link

Description

An error is occurred when i execute cmake . at client_server directory.

cmake .
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is AppleClang 13.0.0.13000029
-- The CXX compiler identification is AppleClang 13.0.0.13000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:4 (check_include_file):
  Unknown CMake command "check_include_file".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.22)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

Expected behavior

Generate makefile successfully

Actual behavior

Failed to generate makefile

Possible fix

No response

Steps to reproduce

  1. cd client_server
  2. cmake .

Context

I was trying to understand the implementation of tcp and udp server

Additional information

No response

@nieyuyao nieyuyao added the bug label Mar 26, 2022
@nieyuyao
Copy link
Author

Executed successfully when i add include(CheckIncludeFile) to client_server/CMakeLists.

include(CheckIncludeFile)

if(WIN32)
    check_include_file(winsock2.h WINSOCK_HEADER)
else()
    check_include_file(arpa/inet.h ARPA_HEADERS)
endif()

@mucahitdemir
Copy link

I would also advise the same way you did.

@github-actions
Copy link
Contributor

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label May 25, 2022
@Panquesito7 Panquesito7 reopened this Oct 4, 2022
@Panquesito7 Panquesito7 added dont-close This issue/pull request shouldn't be closed and removed Stale labels Oct 4, 2022
@rbevin777
Copy link
Contributor

Anyone mind if I take a look at this?

@rbevin777
Copy link
Contributor

PR ready for review here: #1285

@Panquesito7 Panquesito7 linked a pull request Jul 19, 2023 that will close this issue
7 tasks
Panquesito7 pushed a commit that referenced this issue Jul 19, 2023
* fix: missing include file for cmake function

* fix: using newer version of check include file

---------

Co-authored-by: rbevin777 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dont-close This issue/pull request shouldn't be closed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants