Blame addon/doxywizard/CMakeLists.txt

Packit 1c1d7e
# search for Qt5
Packit 1c1d7e
if (NOT force_qt4)
Packit 1c1d7e
  find_package(Qt5Core QUIET CONFIG)
Packit 1c1d7e
  if (Qt5Core_FOUND)
Packit 1c1d7e
    message(STATUS "Using Qt5")
Packit 1c1d7e
    find_package(Qt5 COMPONENTS Widgets Gui Xml)
Packit 1c1d7e
    macro(qt_use_modules)
Packit 1c1d7e
        qt5_use_modules(${ARGN})
Packit 1c1d7e
    endmacro()
Packit 1c1d7e
    macro(qt_wrap_cpp)
Packit 1c1d7e
        qt5_wrap_cpp(${ARGN})
Packit 1c1d7e
    endmacro()
Packit 1c1d7e
    macro(qt_add_resources)
Packit 1c1d7e
        qt5_add_resources(${ARGN})
Packit 1c1d7e
    endmacro()
Packit 1c1d7e
  endif()
Packit 1c1d7e
endif()
Packit 1c1d7e
# fallback to Qt4
Packit 1c1d7e
if (NOT Qt5Core_FOUND)
Packit 1c1d7e
  if (NOT force_qt4)
Packit 1c1d7e
    message(STATUS "Qt5 not found, searching for Qt4 instead...")
Packit 1c1d7e
  else()
Packit 1c1d7e
    message(STATUS "Using Qt4")
Packit 1c1d7e
  endif()
Packit 1c1d7e
  find_package(Qt4 REQUIRED COMPONENTS QtCore QtXml QtGui)
Packit 1c1d7e
  macro(qt_use_modules)
Packit 1c1d7e
  endmacro()
Packit 1c1d7e
  macro(qt_wrap_cpp)
Packit 1c1d7e
      qt4_wrap_cpp(${ARGN})
Packit 1c1d7e
  endmacro()
Packit 1c1d7e
  macro(qt_add_resources)
Packit 1c1d7e
      qt4_add_resources(${ARGN})
Packit 1c1d7e
  endmacro()
Packit 1c1d7e
endif()
Packit 1c1d7e
Packit 1c1d7e
include_directories(
Packit 1c1d7e
	.
Packit 1c1d7e
	${CMAKE_SOURCE_DIR}/src
Packit 1c1d7e
	${CMAKE_SOURCE_DIR}/qtools
Packit 1c1d7e
	${GENERATED_SRC}
Packit 1c1d7e
)
Packit 1c1d7e
Packit 1c1d7e
set(GENERATED_SRC_WIZARD ${GENERATED_SRC}/doxywizard)
Packit 1c1d7e
file(MAKE_DIRECTORY ${GENERATED_SRC_WIZARD})
Packit 1c1d7e
Packit 1c1d7e
add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DUNICODE)
Packit 1c1d7e
if (NOT Qt5Core_FOUND)
Packit 1c1d7e
  include(${QT_USE_FILE})
Packit 1c1d7e
endif()
Packit 1c1d7e
Packit 1c1d7e
# generate settings.h
Packit 1c1d7e
file(GENERATE OUTPUT ${GENERATED_SRC_WIZARD}/settings.h
Packit 1c1d7e
CONTENT "#ifndef SETTINGS_H
Packit 1c1d7e
#define SETTINGS_H
Packit 1c1d7e
#define USE_SQLITE3 ${sqlite3}
Packit 1c1d7e
#define USE_LIBCLANG ${clang}
Packit 1c1d7e
#define IS_SUPPORTED(x) \\
Packit 1c1d7e
  ((USE_SQLITE3  && strcmp(\"USE_SQLITE3\",(x))==0)  || \\
Packit 1c1d7e
   (USE_LIBCLANG && strcmp(\"USE_LIBCLANG\",(x))==0) || \\
Packit 1c1d7e
  0)
Packit 1c1d7e
#endif" )
Packit 1c1d7e
set_source_files_properties(${GENERATED_SRC_WIZARD}/settings.h PROPERTIES GENERATED 1)
Packit 1c1d7e
Packit 1c1d7e
# generate version.cpp
Packit 1c1d7e
file(GENERATE OUTPUT ${GENERATED_SRC_WIZARD}/version.cpp
Packit 1c1d7e
    CONTENT "char versionString[]=\"${VERSION}\";"
Packit 1c1d7e
)
Packit 1c1d7e
set_source_files_properties(${GENERATED_SRC_WIZARD}/version.cpp PROPERTIES GENERATED 1)
Packit 1c1d7e
Packit 1c1d7e
# generate configdoc.cpp
Packit 1c1d7e
add_custom_command(
Packit 1c1d7e
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -wiz ${CMAKE_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC_WIZARD}/configdoc.cpp
Packit 1c1d7e
OUTPUT ${GENERATED_SRC_WIZARD}/configdoc.cpp
Packit 1c1d7e
)
Packit 1c1d7e
set_source_files_properties(${GENERATED_SRC_WIZARD}/configdoc.cpp PROPERTIES GENERATED 1)
Packit 1c1d7e
Packit 1c1d7e
FLEX_TARGET(config_doxyw config_doxyw.l ${GENERATED_SRC_WIZARD}/config_doxyw.cpp COMPILE_FLAGS "${LEX_FLAGS}")
Packit 1c1d7e
Packit 1c1d7e
qt_wrap_cpp(doxywizard_MOC
Packit 1c1d7e
doxywizard.h
Packit 1c1d7e
expert.h
Packit 1c1d7e
helplabel.h
Packit 1c1d7e
inputint.h
Packit 1c1d7e
inputbool.h
Packit 1c1d7e
inputstring.h
Packit 1c1d7e
inputstrlist.h
Packit 1c1d7e
wizard.h
Packit 1c1d7e
)
Packit 1c1d7e
Packit 1c1d7e
qt_add_resources(doxywizard_RESOURCES_RCC doxywizard.qrc)
Packit 1c1d7e
Packit 1c1d7e
add_executable(doxywizard WIN32
Packit 1c1d7e
doxywizard.cpp
Packit 1c1d7e
expert.cpp
Packit 1c1d7e
wizard.cpp
Packit 1c1d7e
inputbool.cpp
Packit 1c1d7e
inputstring.cpp
Packit 1c1d7e
inputint.cpp
Packit 1c1d7e
inputstrlist.cpp
Packit 1c1d7e
${GENERATED_SRC_WIZARD}/settings.h
Packit 1c1d7e
${GENERATED_SRC_WIZARD}/version.cpp
Packit 1c1d7e
${GENERATED_SRC_WIZARD}/config_doxyw.cpp
Packit 1c1d7e
${GENERATED_SRC_WIZARD}/configdoc.cpp
Packit 1c1d7e
${doxywizard_MOC}
Packit 1c1d7e
${doxywizard_RESOURCES_RCC}
Packit 1c1d7e
)
Packit 1c1d7e
qt_use_modules(doxywizard Core Gui Widgets Xml)
Packit 1c1d7e
target_link_libraries(doxywizard
Packit 1c1d7e
${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}
Packit 1c1d7e
)
Packit 1c1d7e
Packit 1c1d7e
install(TARGETS doxywizard DESTINATION bin)