From ad48e7c648eb9a09331b58b64273c3dc2123701b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eliseo=20Marti=CC=81nez?= Date: Thu, 3 Apr 2014 21:00:43 +0200 Subject: [PATCH] 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. --- CMakeLists.txt | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ffb7f44b92..61a54273c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)