Fix #451: Build broken on OSX.

Problem:  Build breaks in OSX if macports ncurses present, due to
          header conflict involving 'term.h'.
Solution: Modify include search order.
This commit is contained in:
Eliseo Martínez 2014-04-03 21:00:43 +02:00
parent d9914a038a
commit ad48e7c648

View File

@ -37,9 +37,23 @@ if(USE_GCOV)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage")
endif()
include_directories("${PROJECT_BINARY_DIR}/config")
include_directories("${PROJECT_SOURCE_DIR}/src")
# Modules used by platform auto-detection
include(CheckLibraryExists)
find_package(LibUV REQUIRED)
include_directories(${LIBUV_INCLUDE_DIRS})
find_package(LuaJit REQUIRED)
include_directories(${LUAJIT_INCLUDE_DIRS})
find_package(LibIntl)
if(LibIntl_FOUND)
include_directories(${LibIntl_INCLUDE_DIR})
endif()
# Determine platform's threading library. Set CMAKE_THREAD_PREFER_PTHREAD
# explicitly to indicate a strong preference for pthread. It is an error to not
# have pthread installed even if, for example, the Win32 threading API is found.
@ -49,20 +63,6 @@ if(NOT CMAKE_USE_PTHREADS_INIT)
message(SEND_ERROR "The pthread library must be installed on your system.")
endif(NOT CMAKE_USE_PTHREADS_INIT)
find_package(LibIntl)
if(LibIntl_FOUND)
include_directories(${LibIntl_INCLUDE_DIR})
endif()
find_package(LibUV REQUIRED)
include_directories(${LIBUV_INCLUDE_DIRS})
find_package(LuaJit REQUIRED)
include_directories(${LUAJIT_INCLUDE_DIRS})
include_directories ("${PROJECT_BINARY_DIR}/config")
include_directories ("${PROJECT_SOURCE_DIR}/src")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_subdirectory(config)