Skip to main content

Python bindings for CMake.

Project description

pycmake

python bindings for cmake.

how

1. write CMakeLists.py

from pycmake.cmake import *
from pycmake import utils
import os


cmake_cmake_minimum_required(CMAKE_VERSION, 3.6)
cmake_project("test")
cmake_add_executable("test")
cmake_target_sources("test", CMAKE_PRIVATE, "main.cpp")
cmake_target_link_libraries("test", "-framework Cocoa", "x")

cmake_add_subdirectory("test_subdir")
cmake_set("my_variable1", "test", CMAKE_CACHE, CMAKE_STRING, "This is my_variable")

cmake_target_sources(
    "test",
    CMAKE_PRIVATE,
    utils.find_files_in_dir_with_extensions(
        os.path.join(CMAKE_CURRENT_SOURCE_DIR, "src"),
        extensions="(h)|(cpp)",
        excluding_dirs="exclude_me",
    ),
)

cmake_if(CMAKE_NOT, "TEST_OPT")
cmake_include("test/CMakeLists.txt")
cmake_call("custom_fn", "p0", "p1")
cmake_endif()

2. python CMakeLists.py

run python CMakeLists.py to generate your CMakeLists.txt file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pycmake-0.1.1-py2.py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page