조회 수 2388 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

Qbs프로젝트파일에서 가장먼저 해줘야 할일은 다음과 같이 qbs를 포함해줘야한다.

import qbs

 

Product

Product는 프로젝트에서 가장 기본이되는 요소이다. 왜냐하면 Product은 일반적으로 빌드 프로세스의 결과물을 나타내기 때문이다. 일반적인 응용프로그램을 개발한다고 가정했을 때 우리는 Application이라는 Product의 일종을 사용하게 될것이다. 

 

product.png

▲Product 의 관계도

 

Application

응용프로그램 형태의 Product이다. 

 

CppApplication

일반적인 C/C++응용프로그램을 나타낸다.

CppApplication은 cpp 모듈에 종속 된 Product이다. 즉, 다음은 CppApplication과 완전히 같다.

Application {
    Depends { name: "cpp" }

    files: "main.cpp"
}

또는 다음과 같다.

Product {
    type: "application"
    Depends { name: "cpp" }
    files: "main.cpp"
}

간편하게 다음과 같이 사용할 수 있다.

CppApplication {
    files: "main.cpp"
}

 

QtApplication

QtApplication은 Qt.core 모듈에 종속 된 C++ 애플리케이션이다. 즉, CppApplication의 일종이다. 그러므로 다음과 완전히 같다.

CppApplication {
    Depends { name: "Qt.core" }
}

간편하게 다음과 같이 사용할 수 있다.

QtApplication {

}

 

Project

하나의 프로젝트파일(*.qbs)에는 하나의 Project 만 사용할 수 있으며 Project 는 여러 Product 를 포함할 수 있다. 만약 하나의 Product 로만 구성된 경우라면 Project 는 생략가능하다.

Project 는 Product 의 아이템이 될 수 없다는 점에 주의해야한다. 다음과 같이 사용할 수 있다.

Project{
    Application {
        Depends { name: "cpp" }
        files: [
            "main.cpp",
        ]
    }

    Product{
        name: "mylib"
        type: "staticlibrary"
        Depends { name: "cpp"; }
    }
}

또는 다음과 같이 다른 *qbs를 포함할 수 도 있다.

Project {
    references: [
        "product1/product1.qbs",
        "product2/product2.qbs"
    ]
}

 

Depends

Product 와 Module 간의 종속성을 나타낸다. 예를 들어 다음 제품은 cpp 모듈을로드한다.

Depends { name: "cpp" }

 

Module

Module 은 Product 빌드에 기여하기위한 아이템들 정의할 수 있다. Product 는 로드 된 모듈에서 속성을 읽고 쓸 수 있다. 모듈에는 다음 아이템들을 사용할 수 있다.

Depends
FileTagger
Group
JobLimit
Parameter
Probe
PropertyOptions
Rule
Scanner

Product 가 Module 에 대한 종속성을(Depends) 표현하면 Qbs는 Product 범위에서 Module 의 인스턴스를 만든다.

Product 는 다른 Product 의 속성에 엑세스 할 수 없지만 Export 을 사용하여 모듈의 종속성 및 속성을 다른 Product에 전달할 수 있다.

 

Group

파일을 그룹화하는 데 사용한다. Product 에 첨부되어있으며 아래 예제와 같이 여러 Group을 추가할 수 도 있다.

Application {
    Group {
        name: "common files"
        files: ["myclass.h", "myclass_common_impl.cpp"]
    }
    Group {
        name: "Windows files"
        condition: qbs.targetOS.contains("windows")
        files: "myclass_win_impl.cpp"
    }
    Group {
        name: "Unix files"
        condition: qbs.targetOS.contains("unix")
        files: "unixhelper.cpp"
        Group {
            name: "Linux files"
            condition: qbs.targetOS.contains("linux")
            files: "myclass_linux_impl.cpp"
        }
        Group {
            name: "FreeBSD files"
            condition: qbs.targetOS.contains("freebsd")
            files: "myclass_freebsd_impl.cpp"
        }
    }
    Group {
        name: "Files to install"
        qbs.install: true
        qbs.installDir: "share"
        files: "runtime_resource.txt"
    }
}

 

DynamicLibrary

동적 라이브러리를 만든다. 프로젝트에 응용프로그램과 동적라이브러리를 함께 빌드하려는 경우 다음과 같이 사용할 수 있다.

Project {
    CppApplication {
        name : "the-app"
        files : [ "main.cpp" ]
        Depends { name: "the-lib" }
    }
    DynamicLibrary {
        name: "the-lib"
        Depends { name: "cpp" }
        files: [
            "lib.cpp",
            "lib.h",
        ]
        Export {
            Depends { name: "cpp" }
            cpp.includePaths: [product.sourceDirectory]
       }
    }
}

 

StaticLibrary

정적 라이브러리를 만든다.

 

 

Qbs 모든 아이템들 : https://doc-snapshots.qt.io/qbs-1.14/list-of-items.html

TAG •

  1. No Image notice

    Qt프로그래밍(QtQuick) Beginner를 위한 글 읽는 순서

    Date2019.01.05 CategoryQML and Qt Quick By운영자 Views110094
    read more
  2. Qt의 오픈소스 라이센스 소개

    Date2019.12.15 CategoryGeneral and Desktop Bymakersweb Views16501
    Read More
  3. No Image

    Qt for MCU 1.0 릴리즈

    Date2019.12.10 CategoryMobile and Embedded Bymakersweb Views4085
    Read More
  4. No Image

    Qt Marketplace 발표

    Date2019.12.02 CategoryGeneral and Desktop Bymakersweb Views2867
    Read More
  5. No Image

    QScopedPointer 소개 및 사용법

    Date2019.11.29 CategoryC++ Class Bymakersweb Views3253
    Read More
  6. QOpenVirtualkeyboard(Qt 5용 한글 및 영문, 숫자 가상키보드)

    Date2019.11.27 CategoryGeneral and Desktop Bymakersweb Views5312
    Read More
  7. Qt3D의 QML 타입으로 3D렌더링

    Date2019.11.20 CategoryQML and Qt Quick Bymakersweb Views4855
    Read More
  8. No Image

    라즈베리파이3에서 Boot to Qt 실행해보기

    Date2019.11.13 CategoryMobile and Embedded Bymakersweb Views4426
    Read More
  9. No Image

    Qt애플리케이션 객체(QCoreApplication, QGuiApplication, QApplication) 에 대해서

    Date2019.11.11 CategoryC++ Class Bymakersweb Views13929
    Read More
  10. No Image

    Qt Quick 3D 소개

    Date2019.11.09 CategoryQML and Qt Quick Bymakersweb Views3613
    Read More
  11. QPushButton 의 커스텀 이미지버튼

    Date2019.11.05 CategoryC++ Class Bymakersweb Views9371
    Read More
  12. qbs 사용 방법(Helloworld)

    Date2019.10.23 CategoryInstallation and Deployment Bymakersweb Views5191
    Read More
  13. 웹기반 Qt Design Viewer

    Date2019.10.23 CategoryQML and Qt Quick Bymakersweb Views3771
    Read More
  14. Qt Creator에서 Qt의존성 라이브러리 자동복사하기

    Date2019.10.19 CategoryInstallation and Deployment Bymakersweb Views5368
    Read More
  15. No Image

    Qt for Embedded Linux 화면출력

    Date2019.10.17 CategoryMobile and Embedded Bymakersweb Views3922
    Read More
  16. Windows에서 Qt 설치 따라하기

    Date2019.10.14 CategoryInstallation and Deployment Bymakersweb Views34507
    Read More
  17. Qbs 프로젝트를 정의하기 위해 사용되는 몇가지 중요한 아이템들

    Date2019.10.13 CategoryInstallation and Deployment Bymakersweb Views2388
    Read More
  18. No Image

    많은 리소스를 사용하는 Qt프로젝트에서 고려해봐야 할 qmake 옵션

    Date2019.10.11 CategoryGeneral and Desktop Bymakersweb Views4179
    Read More
  19. No Image

    Qbs에 대한 소개와 설치하는 방법

    Date2019.10.09 CategoryInstallation and Deployment Bymakersweb Views3634
    Read More
  20. OpenGL 렌더링을 QtQuick과 통합하는 방법

    Date2019.10.01 CategoryQML and Qt Quick Bymakersweb Views4638
    Read More
  21. No Image

    QML내에서의 시그널, 슬롯 시스템

    Date2019.09.29 CategoryQML and Qt Quick Bymakersweb Views9247
    Read More
Board Pagination Prev 1 3 4 5 6 7 9 Next
/ 9