Commit 609ce2b0 authored by roangel's avatar roangel
Browse files

Reworked CMakeLists.txt, now compiling perfectly

parent d3491fa6
cmake_minimum_required(VERSION 2.8.3)
project(d_fall_pps)
# GUI -- CMakeLists.txt
include(${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/CMakeLists.txt)
## Add support for C++11, supported in ROS Kinetic and newer
# add_definitions(-std=c++11)
......@@ -15,47 +19,14 @@ find_package(catkin REQUIRED COMPONENTS
genmsg
)
# GUI -- Add precompiler definitions to include ROS things in GUI compilation
add_definitions(-DCATKIN_MAKE)
# GUI -- Things needed for Qt wrapper build process
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
# GUI -- Add Qt support
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
# GUI -- Add src and includes
set(MY_LIB_PATH_SRC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/src)
set(MY_LIB_PATH_INC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/include)
# #set the default path for built executables to the "bin" directory
# set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
# #set the default path for built libraries to the "lib" directory
# set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
# GUI -- need c++11 for some things
add_definitions(-std=c++11)
# GUI -- Special Qt sources that need to be wrapped before being compiled
# they have the Qt macro QOBJECT inside, the MOC cpp file needs to be done manually
set(SRC_HDRS_QOBJECT
${MY_LIB_PATH_INC}/crazyFlyZoneTab.h
${MY_LIB_PATH_INC}/myGraphicsScene.h
${MY_LIB_PATH_INC}/myGraphicsView.h
${MY_LIB_PATH_INC}/mainguiwindow.h
${MY_LIB_PATH_INC}/rosNodeThread.h
)
# GUI -- wrap UI file and QOBJECT files
qt5_wrap_ui(UIS_HDRS GUI_Qt/CrazyFlyGUI/src/mainguiwindow.ui)
qt5_wrap_cpp(SRC_MOC_HDRS ${SRC_HDRS_QOBJECT})
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
......@@ -179,7 +150,6 @@ catkin_package(
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
${MY_LIB_PATH_INC} # GUI -- include directory inside GUI folder
${catkin_INCLUDE_DIRS}
include
)
......@@ -204,38 +174,11 @@ add_executable(SafeControllerService src/SafeControllerService.cpp)
add_executable(CentralManagerService src/CentralManagerService.cpp)
# GUI -- add sources here
set(MY_CPP_SOURCES # compilation of sources
${MY_LIB_PATH_SRC}/mainguiwindow.cpp
${MY_LIB_PATH_SRC}/main.cpp
${MY_LIB_PATH_SRC}/cornergrabber.cpp
${MY_LIB_PATH_SRC}/crazyFlyZone.cpp
${MY_LIB_PATH_SRC}/crazyFlyZoneTab.cpp
${MY_LIB_PATH_SRC}/myGraphicsRectItem.cpp
${MY_LIB_PATH_SRC}/myGraphicsScene.cpp
${MY_LIB_PATH_SRC}/myGraphicsView.cpp
${MY_LIB_PATH_SRC}/tablePiece.cpp
${MY_LIB_PATH_SRC}/marker.cpp
${MY_LIB_PATH_SRC}/rosNodeThread.cpp
)
# GUI -- add executables here
add_executable(my_GUI ${MY_CPP_SOURCES} ${UIS_HDRS} ${SRC_MOC_HDRS})
qt5_use_modules(my_GUI Widgets)
add_dependencies(ViconDataPublisher d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(PPSClient d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(SafeControllerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(CentralManagerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(my_GUI d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
......@@ -263,17 +206,6 @@ target_link_libraries(SafeControllerService ${catkin_LIBRARIES})
target_link_libraries(CentralManagerService ${catkin_LIBRARIES})
# # GUI -- add libraries
# add_library(my_library ${MY_LIB_SOURCES})
# GUI -- link libraries
target_link_libraries(my_GUI Qt5::Widgets) # GUI -- let my_GUI have acesss to Qt stuff
# target_link_libraries(my_library Qt5::Widgets) # GUI -- let my_library have access to Qt stuff
# target_link_libraries(my_GUI my_library)
target_link_libraries(my_GUI ${catkin_LIBRARIES})
#############
## Install ##
#############
......
......@@ -195,8 +195,9 @@ add_executable(my_GUI ${MY_CPP_SOURCES} ${UIS_HDRS} ${SRC_MOC_HDRS})
qt5_use_modules(my_GUI Widgets)
# add dependencies
add_dependencies(my_GUI d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
# # Add libraries
# add_library(my_library ${MY_CPP_SOURCES})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment