################################################# # ___________ ____ ______ __ __ _____ # # \____ \__ \ _/ ___\\____ \| | \/ ___/ # # | |_> > __ \\ \___| |_> > | /\___ \ # # | __(____ /\___ > __/|____//____ > # # |__| \/ \/|__| \/ # # # ################################################# # ======================================== # Output # ======================================== set(PACPUS_DEFINITIONS "") set(PACPUS_DEPENDENCIES_INC "") set(PACPUS_DEPENDENCIES_LIB "") set(PACPUS_USE_QT5 FALSE CACHE BOOL "Whether to use Qt5") if(NOT PACPUS_USE_QT5) find_package(Qt4) if(NOT QT4_FOUND) message(WARNING "Qt4 not found try to find Qt5") set(PACPUS_USE_QT5 TRUE) endif() endif() if(PACPUS_USE_QT5) message(STATUS "Set CMake variable 'CMAKE_PREFIX_PATH' to the path like '%QT_BIN%/../lib/cmake'") # ======================================== # All the Pacpus modules depend on Qt5 # However, since each module requires specific Qt's modules, they have to include their own QT_USE_FILE # ======================================== # Tell CMake to run moc when necessary: #set(CMAKE_AUTOMOC ON) # As moc files are generated in the binary dir, tell CMake # to always look for includes there: set(CMAKE_INCLUDE_CURRENT_DIR ON) find_package(Qt5Widgets REQUIRED) find_package(Qt5Core REQUIRED) find_package(Qt5Xml REQUIRED) find_package(Qt5Gui REQUIRED) find_package(Qt5OpenGL REQUIRED) find_package(Qt5Network REQUIRED) find_package(Qt5SerialPort REQUIRED) set(QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS} ${Qt5Core_DEFINITIONS} ${Qt5Xml_DEFINITIONS} ${Qt5Gui_DEFINITIONS} ${Qt5OpenGL_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5SerialPort_DEFINITIONS} ) set(QT_INCLUDE_DIR ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5SerialPort_INCLUDE_DIRS} ) set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5SerialPort_LIBRARIES} ) if(Qt5_POSITION_INDEPENDENT_CODE) set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() else() # ======================================== # All the Pacpus modules depend on Qt4 # However, since each module requires specific Qt modules, they have to include their own QT_USE_FILE # ======================================== find_package(Qt4 REQUIRED) endif() # ======================================== # Boost # Do not use compiled modules, include-only headers. # ======================================== if(PACPUS_USE_LOG) list(APPEND PACPUS_DEFINITIONS " -DPACPUS_USE_LOG ") list(APPEND PACPUS_DEFINITIONS " -DBOOST_ALL_DYN_LINK ") find_package(Boost 1.54.0 REQUIRED COMPONENTS log log_setup ) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${Boost_LIBRARY_DIRS}) list(APPEND PACPUS_DEPENDENCIES_INC ${Boost_INCLUDE_DIRS}) list(APPEND PACPUS_DEPENDENCIES_LIB ${Boost_LIBRARIES}) #message("\${PACPUS_DEPENDENCIES_LIB} = ${PACPUS_DEPENDENCIES_LIB}") endif() # ======================================== # Doxygen # ======================================== if(PACPUS_BUILD_DOC) find_package(Doxygen) if(NOT DOXYGEN_FOUND) message(FATAL_ERROR "Doxygen is needed to build the documentation. Please install it correctly") endif() endif()