diff options
Diffstat (limited to 'test cases/cmake/11 cmake_module_path/subprojects')
-rw-r--r-- | test cases/cmake/11 cmake_module_path/subprojects/cmMod/CMakeLists.txt | 15 | ||||
-rw-r--r-- | test cases/cmake/11 cmake_module_path/subprojects/cmMod/gen.py | 9 |
2 files changed, 24 insertions, 0 deletions
diff --git a/test cases/cmake/11 cmake_module_path/subprojects/cmMod/CMakeLists.txt b/test cases/cmake/11 cmake_module_path/subprojects/cmMod/CMakeLists.txt new file mode 100644 index 0000000..88ba9bc --- /dev/null +++ b/test cases/cmake/11 cmake_module_path/subprojects/cmMod/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.5) + +project(cmMod) + +message(STATUS "CMAKE_MODULE_PATH: '${CMAKE_MODULE_PATH}'") + +find_package(SomethingLikePython REQUIRED) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/main.c" + COMMAND Python::Interpreter "${CMAKE_CURRENT_SOURCE_DIR}/gen.py" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" +) + +add_executable(main "${CMAKE_CURRENT_BINARY_DIR}/main.c") diff --git a/test cases/cmake/11 cmake_module_path/subprojects/cmMod/gen.py b/test cases/cmake/11 cmake_module_path/subprojects/cmMod/gen.py new file mode 100644 index 0000000..5c71646 --- /dev/null +++ b/test cases/cmake/11 cmake_module_path/subprojects/cmMod/gen.py @@ -0,0 +1,9 @@ +with open('main.c', 'w') as fp: + print(''' +#include <stdio.h> + +int main(void) { + printf(\"Hello World\"); + return 0; +} +''', file=fp) |