0

Here's the problem. I am on a Mac running OSX 10.9.1. I have a small c++ file, which I want to compile and run. I have run

    cmake . 

with the following CMakeList.txt:

    cmake_minimum_required(VERSION 2.8)
    project(fileparser)
    find_package(Boost REQUIRED)
    find_package(Xapian REQUIRED)
    aux_source_directory(. SRC_LIST)
    add_executable(${PROJECT_NAME} ${SRC_LIST})
    target_link_libraries(${PROJECT_NAME} ${XAPIAN_LIBRARIES} ${Boost_LIBRARIES}) 

as well as this one:

    cmake_minimum_required(VERSION 2.8.12.2)
    project(fileparser)
    find_package(Boost REQUIRED)
    find_package(Xapian REQUIRED)
    aux_source_directory(. SRC_LIST)
    add_executable(${PROJECT_NAME} ${SRC_LIST})
    target_link_libraries(${PROJECT_NAME} ${XAPIAN_LIBRARIES} ${Boost_LIBRARIES})

And when I thereafter try to

    make

I get an infinite loop containing this:

    /usr/bin/make: line 5: default_target:: command not found
    /usr/bin/make: line 6: .PHONY: command not found
    /usr/bin/make: line 12: .SUFFIXES:: command not found
    /usr/bin/make: line 15: SUFFIXES: command not found
    /usr/bin/make: line 17: .SUFFIXES:: command not found
    /usr/bin/make: line 20: VERBOSE: command not found
    /usr/bin/make: line 20: .SILENT:: command not found
    /usr/bin/make: line 23: cmake_force:: command not found
    /usr/bin/make: line 24: .PHONY: command not found
    /usr/bin/make: line 30: SHELL: command not found
    /usr/bin/make: line 33: CMAKE_COMMAND: command not found
    RM: =: No such file or directory
    RM: /usr/local/Cellar/cmake/2.8.10.2/bin/cmake: No such file or directory
    RM: -E: No such file or directory
    RM: remove: No such file or directory
    RM: -f: No such file or directory
    /usr/bin/make: line 39: EQUALS: command not found
    /usr/bin/make: line 42: CMAKE_EDIT_COMMAND: command not found
    /usr/bin/make: line 45: CMAKE_SOURCE_DIR: command not found
    /usr/bin/make: line 48: CMAKE_BINARY_DIR: command not found
    /usr/bin/make: line 54: edit_cache:: command not found
    /usr/bin/make: line 55: CMAKE_COMMAND: command not found
    /usr/bin/make: line 55: COLOR: command not found
    /usr/bin/make: line 55: @: command not found
    /usr/bin/make: line 56: CMAKE_SOURCE_DIR: command not found
    /usr/bin/make: line 56: CMAKE_BINARY_DIR: command not found
    /usr/bin/make: line 56: /usr/local/Cellar/cmake/2.8.10.2/bin/ccmake: No such file or directory
    /usr/bin/make: line 57: .PHONY: command not found
    /usr/bin/make: line 60: edit_cache/fast:: No such file or directory
    /usr/bin/make: line 61: .PHONY: command not found
    /usr/bin/make: line 64: rebuild_cache:: command not found
    /usr/bin/make: line 65: CMAKE_COMMAND: command not found
    /usr/bin/make: line 65: COLOR: command not found
    /usr/bin/make: line 65: @: command not found
    /usr/bin/make: line 66: CMAKE_SOURCE_DIR: command not found
    /usr/bin/make: line 66: CMAKE_BINARY_DIR: command not found
    /usr/bin/make: line 66: /usr/local/Cellar/cmake/2.8.10.2/bin/cmake: No such file or directory
    /usr/bin/make: line 67: .PHONY: command not found
    /usr/bin/make: line 70: rebuild_cache/fast:: No such file or directory
    /usr/bin/make: line 71: .PHONY: command not found
    /usr/bin/make: line 74: all:: command not found
    /usr/bin/make: line 75: CMAKE_COMMAND: command not found
    /usr/bin/make: line 75: -E: command not found
    /usr/bin/MAKE: line 5: default_target:: command not found
    /usr/bin/MAKE: line 6: .PHONY: command not found

repeated over and over again. An obvious difference between my system and the print is that my cmake version is 2.8.12.2 and not 2.8.10.2, but I don't know how to change that, and assumed that cmake would recognize my version.

I have googled the problem but can't find anything applicable.

I have tried uninstalling and reinstalling cmake several times.

0 Answers0