Support CMake build system
# Create build dir
mkdir build
cd build
# Config project(Use Qt6)
cmake ..
# Or assign Qt5
cmake -DQT_VERSION_MAJOR=5 ..
# Build
cmake --build .
# install (optional)
cmake --install .ACSS_BUILD_STATIC: Build static library (default is OFF, build shared library)ACSS_BUILD_EXAMPLES: Build example programs (default is ON)
cmake -DACSS_BUILD_STATIC=ON ..
cmake --build .cmake -DACSS_BUILD_EXAMPLES=OFF ..
cmake --build .If CMake cannot find Qt automatically, you can specify it manually:
cmake -DCMAKE_PREFIX_PATH="C:/Qt/6.5.0/msvc2019_64" ..cmake -DCMAKE_INSTALL_PREFIX=/path/to/install ..
cmake --build .
cmake --install .In your project's CMakeLists.txt:
find_package(QtAdvancedStylesheets REQUIRED)
add_executable(myapp main.cpp)
target_link_libraries(myapp
PRIVATE
QtAdvancedStylesheets::qtadvancedcss
)The original qmake build system remains unchanged and can be used as before.
Qt-Advanced-Stylesheets/
├── CMakeLists.txt # Main CMake file
├── cmake/ # CMake configuration file
│ └── QtAdvancedStylesheetsConfig.cmake.in
├── src/ # source
│ └── CMakeLists.txt
├── examples/ # Example Programs
│ ├── CMakeLists.txt
│ ├── exporter/
│ │ └── CMakeLists.txt
│ └── full_features/
│ └── CMakeLists.txt
└── styles/ # style files
- Minimum CMake version required: 3.16
- Support Qt5 and Qt6
- By default, shared libraries are built. The Debug version will have a 'd' suffix added.
- Output files:
- Library file:
build/lib/ - Executable file:
build/bin/
- Library file: