Skip to content

Instantly share code, notes, and snippets.

View mikedld's full-sized avatar

Mike Gelfand mikedld

View GitHub Profile
@mikedld
mikedld / CMakeLists.txt
Created October 5, 2021 20:46
Find all CMake targets declared in a directory (recursively)
function(print_all_targets DIR)
get_property(TGTS DIRECTORY "${DIR}" PROPERTY BUILDSYSTEM_TARGETS)
foreach(TGT IN LISTS TGTS)
message(STATUS "Target: ${TGT}")
# TODO: Do something about it
endforeach()
get_property(SUBDIRS DIRECTORY "${DIR}" PROPERTY SUBDIRECTORIES)
foreach(SUBDIR IN LISTS SUBDIRS)
print_all_targets("${SUBDIR}")
@mikedld
mikedld / CMakeLists.txt
Created September 8, 2021 19:52
CMake + PCH example
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(test_pch LANGUAGES CXX)
add_library(test_pch STATIC
test_pch.cpp)
target_precompile_headers(test_pch
PRIVATE
test_pch.h)
@mikedld
mikedld / CMakeLists.txt
Last active August 30, 2021 06:32
freetype + harfbuzz cmake example
cmake_minimum_required(VERSION 3.0)
project(freetype_harfbuzz)
message(STATUS "-------------------------------------------------------------------")
execute_process(
COMMAND git init .
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
execute_process(
@mikedld
mikedld / compare.ps1
Last active January 31, 2020 20:55
Compare object files from two revisions (MSVC)
param(
[Parameter(Mandatory=$True)] [String] $SourceDir,
[Parameter(Mandatory=$True)] [String] $OldRevision,
[Parameter(Mandatory=$True)] [String] $NewRevision
)
$SourceDir = (Get-Item $SourceDir).FullName
$BuildDir = (Get-Item .).FullName
$BuildConfig = 'RelWithDebInfo'
@mikedld
mikedld / 1. qt.cmd
Last active February 18, 2017 12:49
Build Qt on Windows
@echo off
setlocal
setlocal enabledelayedexpansion
set R=%CD%
set EXPATVER=2.1.0
set DBUSVER=1.10.6
set ZLIBVER=1.2.8
@mikedld
mikedld / PocoFoundationTargets-relwithdebinfo.cmake
Created September 19, 2015 21:25
More info for POCO issue #944
#----------------------------------------------------------------
# Generated CMake target import file for configuration "RelWithDebInfo".
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "Poco::Foundation" for configuration "RelWithDebInfo"
set_property(TARGET Poco::Foundation APPEND PROPERTY IMPORTED_CONFIGURATIONS RELWITHDEBINFO)
set_target_properties(Poco::Foundation PROPERTIES
@mikedld
mikedld / gist:078dc95e3ecf5fe35e13
Last active August 29, 2015 14:02
Empty path components statistics (TPB torrents)

===================================== ======== ======= ======== ======= ====== Creator Count #1 #2 #3 #4 ===================================== ======== ======= ======== ======= ====== Unknown (no "created by" field) 91 16 73 2 18 (hdreactor.org) 1 1 Azureus/2.5.0.0 1 1 Azureus/4.7.0.2 16 1 9 15 Azureus/4.7.1.2 7 3 3 4 BitComet/0.56 40 40 BitComet/0.57 10 10