FANDOM


Finding linked library in executableEdit

ffmpegEdit

autotoolsEdit

MakefileEdit

  • Popular build system backend.
  • Used to for building project with toolchain that isn't supported by autotools or CMake.
  • to override the variable pass "VAR=VALUE" after make command. If you set in before the command it will just override the env variable.
  • GNU make reference

NinjaEdit

  • repository
  • Small and fast build system like Makefile
  • Can be generated by CMake

CMakeEdit

CTestEdit

CPackEdit

  • packager for CMake
  • Using with CMake
  • building target "package" will create the package.

GeneratorEdit

  • Makefile
  • Visual Studio
  • Ninja
  • Xcode

selecting filesEdit

  • Use aux_source_directory() to select all the supported source file
  • Use "file()" function to select particular files
    • GLOB: just wildcard target directory
    • GLOB_RECURSE: wildcard file recursively

Uninstall commandEdit

Using DEdit

Running external program Edit

  • If it wanted to be run in CMakeLists.txt parse time, use execute_process()
    • use OUTPUT_STRIP_TRAILING_WHITESPACE for unwanted newline
  • If you want to have a code generator use add_custom_command()
  • If you want custom command in Makefile use add_custom_target()

Build type Edit

  • use ${CMAKE_BUILD_TYPE}
    • RELEASE
    • DEBUG

Generating File Edit

  • use file() function's WRITE and APPEND.
    • WRITE: like > redirect. clear file and write the passed string.
    • APPEND: like >> redirect. append the passed string to the file.
    • '\n' works as a new line.
  • If you want configuration file like autotools use configure_file()
    • "@VAR@" will be replace by CMake variable "${VAR}"

naming styleEdit

  • use camel case.
  • case
    • function name: lower
    • variable name: upper

MacPortsEdit

  • enabling default variants
    • write variants to "/opt/local/etc/macports/variants.conf"
    • +universal: build universal binary
    • +no_x11: don't use x11
    • +quartz: use quartz as a rendering backend
  • universal binary
    • set "universal_archs" variable to change the architectures
    • ppc, ppc64: deprecated architecture. used in old Mac OS X
    • i386: IA32
    • x86_64: amd64
  • changing compiler
    • add configure.compiler=$CC

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.