Sharing private CMake modules on Linux (Ubuntu 16)
I've written some CMake stuff that I need to share with my fellow workers.
We are working on Linux and we all use CMake version 3.11.4.
Here is the way I use my cmake module (from my CMakeLists.txt):
cmake_minimum_required(VERSION 3.11)
message(STATUS "CMake modules path: ${CMAKE_ROOT}/Modules")
message(STATUS "CMake prefix path ${CMAKE_PREFIX_PATH}")
project(world
VERSION 1.0.0
DESCRIPTION "My sample project")
set(CMAKE_CXX_STANDARD 14)
option(BUILD_TESTS "disable TESTS" ON)
# This is my special CMake module
include(mystuff)
# My targets here after...
To use it I run this command:
cmake -DCMAKE_MODULE_PATH=/tmp/cmake ..
The module is found and used. The command line argument CMAKE_MODULE_PATH is not a very cool way to indicate where my modules are to be searched for.
I've tried to relocate my stuff in :
- <prefix>/(lib/<arch>|lib|share)/cmake/<name>*/ (U)
- <prefix>/(lib/<arch>|lib|share)/<name>*/ (U)
- <prefix>/(lib/<arch>|lib|share)/<name>*/(cmake|CMake)/ (U)
Without success.
So here are my questions:
- what variable sets and what is it's default value ?
- whare does stand for ? Is name mystuff ?
My module mystuff.cmake
message(STATUS "Hello, this is my stuff...")
Edited by Herbert Koelman