Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,22 @@ if(Boost_FOUND)
add_definitions(-DUSE_BOOST)
endif()

# NOTE: After updating cmake_minimum_required to 3.5,
# if we call check_function_exists() after set(CMAKE_EXE_LINKER_FLAGS), it returns function not found
# So, I moved this step upward to avoid the compilation errors due to not-found functions
##################################################################
# check existence of a few basic functions
##################################################################
include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
check_function_exists (gettimeofday HAVE_GETTIMEOFDAY)
check_function_exists (getrusage HAVE_GETRUSAGE)
check_function_exists (GlobalMemoryStatusEx HAVE_GLOBALMEMORYSTATUSEX)
check_function_exists (strndup HAVE_STRNDUP)
check_function_exists (strtok_r HAVE_STRTOK_R)
include (CheckIncludeFile)
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTDH)
find_package(Backtrace)

# The version number.
set (iqtree_VERSION_MAJOR 2)
set (iqtree_VERSION_MINOR 4)
Expand Down Expand Up @@ -672,19 +688,6 @@ elseif (CLANG AND NOT CLANG_UNDER_VS)
set(CMAKE_C_FLAGS_MEM "-g -O1")
endif()

##################################################################
# check existence of a few basic functions
##################################################################
include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
check_function_exists (gettimeofday HAVE_GETTIMEOFDAY)
check_function_exists (getrusage HAVE_GETRUSAGE)
check_function_exists (GlobalMemoryStatusEx HAVE_GLOBALMEMORYSTATUSEX)
check_function_exists (strndup HAVE_STRNDUP)
check_function_exists (strtok_r HAVE_STRTOK_R)
include (CheckIncludeFile)
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTDH)
find_package(Backtrace)

# configure a header file to pass some of the CMake settings
# to the source code
configure_file (
Expand Down
2 changes: 1 addition & 1 deletion cmaple