This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.29) | |
project(find_perm LANGUAGES NONE) | |
set(noread_shared ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}noread_shared${CMAKE_SHARED_LIBRARY_SUFFIX}) | |
set(noread_static ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}noread_static${CMAKE_STATIC_LIBRARY_SUFFIX}) | |
# EXISTS requires read permissions | |
# https://cmake.org/cmake/help/latest/command/if.html#exists | |
# no read permissions means can't touch the file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.20) | |
project(lang LANGUAGES C) | |
include(CheckSourceRuns) | |
include(CheckTypeSize) | |
check_type_size("time_t" TIME_T_SIZE) | |
if(NOT TIME_T_SIZE GREATER_EQUAL 8) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import pypylon | |
from matplotlib.pyplot import figure,draw,pause | |
# | |
Nblock = 10 # TODO workaround for Basler too many frames error | |
Nblocks = 100 # arbitrary number of frames to plot | |
def connect(camdev,camind=0): | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.19) | |
project(MUMPS_example | |
LANGUAGES C Fortran | |
) | |
enable_testing() | |
file(GENERATE OUTPUT ${PROJECT_BINARY_DIR}/.gitignore CONTENT "*") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.18) | |
project(CursesDemo LANGUAGES C) | |
include(curses.cmake) | |
add_executable(test_curses test_curses.c) | |
target_link_libraries(test_curses PRIVATE Curses::Curses) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Toy example--execute_process() on Windows is challenging to handle paths with spaces | |
# Non-Winows sh -c just works. | |
set(setvars "set CC=gcc") | |
set(cmd "cc main.c") | |
set(cmd $ENV{COMSPEC} /c "${setvars} && ${cmd}") | |
string(REPLACE "C:/Program Files/" "C:/Progra~1/" cmd "$cmd}") | |
string(REPLACE "C:/Program Files (x86)/" "C:/Progra~2/" cmd "${cmd}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.buildtool/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.15) | |
project(SleepDemo LANGUAGES C CXX) | |
enable_testing() | |
include(CheckSymbolExists) | |
set(CMAKE_C_STANDARD 11) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.19...3.31) | |
project(InstructionSet LANGUAGES CXX) | |
set(CMAKE_CXX_SCAN_FOR_MODULES OFF) | |
include(CheckIncludeFileCXX) | |
set(CMAKE_CXX_STANDARD 11) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.15) | |
project(opt LANGUAGES Fortran) | |
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | |
# https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2024-2/warn.html | |
# SHELL: allows using | |
# * spaces in compiler options (especially important for Intel oneAPI | |
# * repeated option prefix, that might otherwise get deduplicated incorrectly |
NewerOlder