Skip to content

Commit

Permalink
adding cmake support
Browse files Browse the repository at this point in the history
  • Loading branch information
fpoussin committed Jan 4, 2021
1 parent 4a9d338 commit 8c0210d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 42 deletions.
47 changes: 8 additions & 39 deletions .github/workflows/build_qmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,56 +56,25 @@ jobs:
modules: qtdeclarative qttools qtsvg
tools: 'tools_qtcreator,"${{ env.QT_CREATOR_VERSION }}"-0,qt.tools.qtcreator tools_qtcreator,"${{ env.QT_CREATOR_VERSION }}"-0,qt.tools.qtcreatordev'

- name: Configure
- name: Prepare
shell: cmake -P {0}
run: |
if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x")
execute_process(
COMMAND "${{ matrix.config.environment_script }}" && set
OUTPUT_FILE environment_script_output.txt
)
file(STRINGS environment_script_output.txt output_lines)
foreach(line IN LISTS output_lines)
if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$")
set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}")
# Set for other steps
message("::set-env name=${CMAKE_MATCH_1}::${CMAKE_MATCH_2}")
endif()
endforeach()
endif()
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/qtcreator" qtcreator_dir)
execute_process(
COMMAND qmake
$ENV{PLUGIN_PRO}
CONFIG+=release
QTC_SOURCE="${qtcreator_dir}"
QTC_BUILD="${qtcreator_dir}"
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status")
endif()
file(GLOB LIB_FILES "$ENV{GITHUB_WORKSPACE}/qtcreator/lib/qtcreator/*")
file(COPY "${LIB_FILES}" "$ENV{GITHUB_WORKSPACE}/qtcreator/dev/lib/")
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status")
endif()

- name: Build
shell: cmake -P {0}
run: |
if (NOT "${{ runner.os }}" STREQUAL "Windows")
set(ENV{LD_LIBRARY_PATH} "qtcreator/lib/Qt/lib:$ENV{LD_LIBRARY_PATH}")
endif()
set(ENV{CMAKE_PREFIX_PATH} "$ENV{GITHUB_WORKSPACE}/qtcreator/dev:ENV{Qt5_DIR}")
include(ProcessorCount)
ProcessorCount(N)
set(make_program make -j ${N})
if ("${{ runner.os }}" STREQUAL "Windows")
set(make_program "qtcreator/bin/jom")
endif()
execute_process(
COMMAND ${make_program}
COMMAND ${CMAKE_COMMAND}
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
Expand Down
30 changes: 30 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.10)

project(Doxygen)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

find_package(QtCreator COMPONENTS Core REQUIRED)

add_qtc_plugin(Doxygen
PLUGIN_DEPENDS QtCreator::Core QtCreator::CppTools QtCreator::CppEditor QtCreator::ProjectExplorer QtCreator::TextEditor
SOURCES
doxygenconstants.h
doxygenfilesdialog.h
doxygen_global.h
doxygen.h doxygenplugin.h
doxygensettings.h
doxygensettingsstruct.h
doxygensettingswidget.h
doxygen.cpp
doxygenfilesdialog.cpp
doxygenplugin.cpp
doxygensettings.cpp
doxygensettingsstruct.cpp
doxygensettingswidget.cpp
)
7 changes: 4 additions & 3 deletions doxygen.pro
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ RESOURCES += doxygen.qrc

## set the QTC_SOURCE variable to override the setting here
QTCREATOR_SOURCES = $$QTC_SOURCE
unix:isEmpty(QTCREATOR_SOURCES):QTCREATOR_SOURCES=$$(HOME)/src/qt-creator-opensource-src-4.10.0
win32:isEmpty(QTCREATOR_SOURCES):QTCREATOR_SOURCES=C:\src\qt-creator-opensource-src-4.10.0
unix:isEmpty(QTCREATOR_SOURCES):QTCREATOR_SOURCES=$$(HOME)/Qt/Tools/QtCreator/dev/include
win32:isEmpty(QTCREATOR_SOURCES):QTCREATOR_SOURCES=C:\Qt\Tools\QtCreator\dev\include

## set the QTC_BUILD variable to override the setting here
IDE_BUILD_TREE = $$QTC_BUILD
unix:isEmpty(IDE_BUILD_TREE):IDE_BUILD_TREE=$$(HOME)/Qt/Tools/QtCreator
win32:isEmpty(IDE_BUILD_TREE):IDE_BUILD_TREE=C:\src\build-qtcreator-Desktop_Qt_5_11_2_MSVC2015_32bit2-Release
win32:isEmpty(IDE_BUILD_TREE):IDE_BUILD_TREE=C:\Qt\Tools\QtCreator\dev\lib\qtcreator

## set the QTC_LIB_BASENAME variable to override the setting here
## this variable points to the library installation path, relative to IDE_BUILD_TREE,
Expand Down Expand Up @@ -76,5 +76,6 @@ include($$QTCREATOR_SOURCES/src/qtcreatorplugin.pri)
DEFINES -= QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII

DISTFILES += \
CMakeLists.txt \
Doxygen.json.in

0 comments on commit 8c0210d

Please sign in to comment.