cmake_minimum_required(VERSION 2.8.3)
project(parking)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
#SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -fsanitize=address")
#SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall -fsanitize=address")
find_package(catkin REQUIRED COMPONENTS
  roscpp
  rosbag
  std_msgs
  sensor_msgs
  serial
  message_generation
)

add_message_files(
   FILES
   GPS.msg
 )
generate_messages(DEPENDENCIES
  sensor_msgs
  std_msgs
)
catkin_package(
  CATKIN_DEPENDS message_runtime
)


find_package(Eigen3 REQUIRED)

#find_package (GeographicLib REQUIRED)

include_directories(
    include
      ${catkin_INCLUDE_DIRS}
      ${EIGEN3_INCLUDE_DIR}
)

catkin_package(
            CATKIN_DEPENDS roscpp std_msgs sensor_msgs
            DEPENDS EIGEN3 
            INCLUDE_DIRS include)

#set(CMAKE_CXX_STANDARD 11)
#set(CMAKE_CXX_STANDARD_REQUIRED ON)
#set(CMAKE_CXX_EXTENSIONS OFF)

add_executable(parking src/ert_main.cpp src/AutoPark.cpp)
target_link_libraries(parking stdc++fs   ${catkin_LIBRARIES} )
add_dependencies(parking ${catkin_EXPORTED_TARGETS}  ${${PROJECT_NAME}_EXPORTED_TARGETS}  )
