[89] | 1 | #################################################
|
---|
| 2 | # ___________ ____ ______ __ __ _____ #
|
---|
| 3 | # \____ \__ \ _/ ___\\____ \| | \/ ___/ #
|
---|
| 4 | # | |_> > __ \\ \___| |_> > | /\___ \ #
|
---|
| 5 | # | __(____ /\___ > __/|____//____ > #
|
---|
| 6 | # |__| \/ \/|__| \/ #
|
---|
| 7 | # #
|
---|
| 8 | #################################################
|
---|
| 9 |
|
---|
| 10 | # ========================================
|
---|
| 11 | # Output
|
---|
| 12 | # ========================================
|
---|
| 13 | set(PACPUS_DEFINITIONS "")
|
---|
| 14 | set(PACPUS_DEPENDENCIES_INC "")
|
---|
| 15 | set(PACPUS_DEPENDENCIES_LIB "")
|
---|
| 16 |
|
---|
[119] | 17 | if(NOT QT5)
|
---|
| 18 | find_package(Qt4)
|
---|
| 19 | if(NOT QT4_FOUND)
|
---|
| 20 | message(WARNING "Qt4 not found try to find Qt5")
|
---|
| 21 | set(QT5 TRUE)
|
---|
| 22 | endif()
|
---|
| 23 | endif()
|
---|
| 24 |
|
---|
| 25 | if(QT5)
|
---|
| 26 |
|
---|
[89] | 27 | # ========================================
|
---|
[92] | 28 | # All the Pacpus' modules depends from Qt5
|
---|
[89] | 29 | # However, since each module requires specific Qt's modules, they have to include their own QT_USE_FILE
|
---|
| 30 | # ========================================
|
---|
| 31 |
|
---|
| 32 | # Tell CMake to run moc when necessary:
|
---|
| 33 | #set(CMAKE_AUTOMOC ON)
|
---|
| 34 | # As moc files are generated in the binary dir, tell CMake
|
---|
| 35 | # to always look for includes there:
|
---|
| 36 | set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
---|
| 37 |
|
---|
| 38 | find_package(Qt5Widgets REQUIRED)
|
---|
| 39 | find_package(Qt5Core REQUIRED)
|
---|
| 40 | find_package(Qt5Xml REQUIRED)
|
---|
| 41 | find_package(Qt5Gui REQUIRED)
|
---|
| 42 | find_package(Qt5OpenGL REQUIRED)
|
---|
| 43 | find_package(Qt5Network REQUIRED)
|
---|
| 44 |
|
---|
| 45 | set(QT_DEFINITIONS
|
---|
| 46 | ${Qt5Widgets_DEFINITIONS}
|
---|
| 47 | ${Qt5Core_DEFINITIONS}
|
---|
| 48 | ${Qt5Xml_DEFINITIONS}
|
---|
| 49 | ${Qt5Gui_DEFINITIONS}
|
---|
| 50 | ${Qt5OpenGL_DEFINITIONS}
|
---|
| 51 | ${Qt5Network_DEFINITIONS}
|
---|
| 52 | )
|
---|
| 53 | set(QT_INCLUDE_DIR
|
---|
| 54 | ${Qt5Widgets_INCLUDE_DIRS}
|
---|
| 55 | ${Qt5Core_INCLUDE_DIRS}
|
---|
| 56 | ${Qt5Xml_INCLUDE_DIRS}
|
---|
| 57 | ${Qt5Gui_INCLUDE_DIRS}
|
---|
| 58 | ${Qt5OpenGL_INCLUDE_DIRS}
|
---|
| 59 | ${Qt5Network_INCLUDE_DIRS}
|
---|
| 60 | )
|
---|
| 61 |
|
---|
| 62 | set(QT_LIBRARIES
|
---|
| 63 | ${Qt5Widgets_LIBRARIES}
|
---|
| 64 | ${Qt5Core_LIBRARIES}
|
---|
| 65 | ${Qt5Xml_LIBRARIES}
|
---|
| 66 | ${Qt5Gui_LIBRARIES}
|
---|
| 67 | ${Qt5OpenGL_LIBRARIES}
|
---|
| 68 | ${Qt5Network_LIBRARIES}
|
---|
| 69 | )
|
---|
| 70 |
|
---|
| 71 | if(Qt5_POSITION_INDEPENDENT_CODE)
|
---|
| 72 | set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
---|
| 73 | endif()
|
---|
| 74 |
|
---|
[119] | 75 | else(QT5)
|
---|
| 76 |
|
---|
[89] | 77 | # ========================================
|
---|
[119] | 78 | # All the Pacpus' modules depends from Qt4
|
---|
| 79 | # However, since each module requires specific Qt's modules, they have to include their own QT_USE_FILE
|
---|
| 80 | # ========================================
|
---|
| 81 | find_package(Qt4 REQUIRED)
|
---|
| 82 |
|
---|
| 83 | endif(QT5)
|
---|
| 84 |
|
---|
| 85 | # ========================================
|
---|
[89] | 86 | # Boost
|
---|
| 87 | # Do not use compiled modules, include-only headers.
|
---|
| 88 | # ========================================
|
---|
| 89 | #find_package(Boost 1.49.0 REQUIRED)
|
---|
| 90 | #list(APPEND PACPUS_DEPENDENCIES_INC ${Boost_INCLUDE_DIRS})
|
---|
| 91 |
|
---|
| 92 | # ========================================
|
---|
| 93 | # log4cxx
|
---|
| 94 | # ========================================
|
---|
| 95 | if(PACPUS_USE_LOG)
|
---|
| 96 |
|
---|
| 97 | if(WIN32 AND MSVC AND IS_BUILDING_PACPUS)
|
---|
| 98 | set(LOG4CXX_ROOT ${PACPUS_3RD_PARTY_DIR}/apache-log4cxx)
|
---|
| 99 | endif()
|
---|
| 100 |
|
---|
| 101 | find_package(log4cxx REQUIRED)
|
---|
| 102 |
|
---|
| 103 | list(APPEND PACPUS_DEFINITIONS " -DPACPUS_USE_LOG ")
|
---|
| 104 | list(APPEND PACPUS_DEPENDENCIES_INC ${LOG4CXX_INCLUDE_DIRS})
|
---|
| 105 | list(APPEND PACPUS_DEPENDENCIES_LIB ${LOG4CXX_LIBRARIES})
|
---|
| 106 |
|
---|
| 107 | # If needed, install the dll of log4cxx
|
---|
| 108 | if(WIN32 AND MSVC AND IS_BUILDING_PACPUS)
|
---|
| 109 | pacpus_get_msvc(MSVC_VERSION)
|
---|
| 110 | pacpus_purge_backslash(LOG4CXX_ROOT)
|
---|
| 111 |
|
---|
| 112 | install(
|
---|
| 113 | FILES
|
---|
| 114 | ${LOG4CXX_ROOT}/bin/${MSVC_VERSION}/log4cxx.dll
|
---|
| 115 | ${LOG4CXX_ROOT}/bin/${MSVC_VERSION}/log4cxx_d.dll
|
---|
| 116 | DESTINATION
|
---|
| 117 | ${PACPUS_INSTALL_DIR}/bin
|
---|
| 118 | )
|
---|
| 119 | endif()
|
---|
| 120 | endif()
|
---|
| 121 |
|
---|
| 122 | # ========================================
|
---|
| 123 | # Doxygen
|
---|
| 124 | # ========================================
|
---|
| 125 | if(PACPUS_BUILD_DOC)
|
---|
| 126 | find_package(Doxygen)
|
---|
| 127 | if(NOT DOXYGEN_FOUND)
|
---|
| 128 | message(FATAL_ERROR "Doxygen is needed to build the documentation. Please install it correctly")
|
---|
| 129 | endif()
|
---|
| 130 | endif()
|
---|