Skip to content

Commit

Permalink
fix cmake settings (helios-base#12)
Browse files Browse the repository at this point in the history
* fix cmake configurations.

* replace CheckSymbolExists with CheckCXXSymbolExists

* fix a cmake problem. add a missing header file.
  • Loading branch information
hidehisaakiyama authored Jan 11, 2022
1 parent 02d7c76 commit 13de9c4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(CMAKE_CXX_FLAGS "-W -Wall")

# install destination
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "Install destination path" FORCE)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/local" CACHE PATH "Install destination path" FORCE)
endif()

include(GNUInstallDirs)
Expand All @@ -38,6 +38,15 @@ check_include_file("sys/socket.h" HAVE_SYS_SOCKET_H)
check_include_file("sys/time.h" HAVE_SYS_TIME_H)
check_include_file("unistd.h" HAVE_UNISTD_H)

# check funcs
include(CheckCXXSymbolExists)
check_cxx_symbol_exists(inet_addr arpa/inet.h HAVE_INET_ADDR)
check_cxx_symbol_exists(getaddrinfo netdb.h HAVE_GETADDRINFO)
check_cxx_symbol_exists(gethostbyname netdb.h HAVE_GETHOSTBYNAME)
check_cxx_symbol_exists(gettimeofday sys/time.h HAVE_GETTIMEOFDAY)
check_cxx_symbol_exists(select sys/select.h HAVE_SELECT)
check_cxx_symbol_exists(socket sys/socket.h HAVE_SOCKET)

# boost
find_package(Boost 1.36.0 COMPONENTS system REQUIRED)
if(NOT Boost_FOUND)
Expand Down
12 changes: 12 additions & 0 deletions cmake-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@
#cmakedefine HAVE_SYS_TIME_H

#cmakedefine HAVE_UNISTD_H

#cmakedefine HAVE_INET_ADDR

#cmakedefine HAVE_GETADDRINFO

#cmakedefine HAVE_GETHOSTBYNAME

#cmakedefine HAVE_GETTIMEOFDAY

#cmakedefine HAVE_SELECT

#cmakedefine HAVE_SOCKET
1 change: 1 addition & 0 deletions rcsc/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ install(FILES
online_client.h
player_param.h
player_type.h
role_type.h
say_message.h
say_message_parser.h
server_param.h
Expand Down

0 comments on commit 13de9c4

Please sign in to comment.