PROJECT(new-eden-route-derivation)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

IF(CMAKE_COMPILER_IS_GNUCC)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-missing-field-initializers -Og -g")
ENDIF()

FIND_PACKAGE(OpenMP)
IF(OPENMP_FOUND)
    SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF()

ADD_LIBRARY(eve_nerd SHARED src/dijkstra.cpp src/min_heap.cpp src/universe.cpp)
ADD_EXECUTABLE(eve_nerd_bin src/main.cpp)

INCLUDE_DIRECTORIES(include)

SET_TARGET_PROPERTIES(eve_nerd_bin PROPERTIES OUTPUT_NAME eve_nerd)

TARGET_LINK_LIBRARIES(eve_nerd_bin readline)
TARGET_LINK_LIBRARIES(eve_nerd_bin eve_nerd)

FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})

FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})

SET_SOURCE_FILES_PROPERTIES(eve_nerd.i PROPERTIES CPLUSPLUS ON)
SWIG_ADD_MODULE(eve_nerd python eve_nerd.i)
SWIG_LINK_LIBRARIES(eve_nerd eve_nerd)

PROJECT(new-eden-route-derivation)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-missing-field-initializers ")

IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -g")
ENDIF()

FIND_PACKAGE(OpenMP)
IF(OPENMP_FOUND)
    SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
ENDIF()

SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)

ADD_LIBRARY(eve_nerd SHARED src/dijkstra.cpp src/min_heap.cpp src/universe.cpp)
ADD_EXECUTABLE(eve_nerd_bin src/main.cpp)

INCLUDE_DIRECTORIES(include)

SET_TARGET_PROPERTIES(eve_nerd_bin PROPERTIES OUTPUT_NAME eve_nerd)

TARGET_LINK_LIBRARIES(eve_nerd_bin readline)
TARGET_LINK_LIBRARIES(eve_nerd_bin eve_nerd)

FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})

FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})

SET_SOURCE_FILES_PROPERTIES(eve_nerd.i PROPERTIES CPLUSPLUS ON)
SWIG_ADD_MODULE(eve_nerd python eve_nerd.i)
SWIG_LINK_LIBRARIES(eve_nerd eve_nerd)

Allow CMake to work with Clang++.
Allow CMake to work with Clang++.
