myx-cmake/CMakeLists.txt

19 lines
594 B
CMake
Raw Normal View History

2021-12-08 11:32:04 +00:00
cmake_minimum_required(VERSION 3.0)
2022-01-11 07:00:34 +00:00
project(myx-cmake VERSION 0.4.6 LANGUAGES)
2021-12-08 11:32:04 +00:00
include(GNUInstallDirs)
2021-12-09 11:41:26 +00:00
file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake
"set(MYX_CMAKE_PACKAGE_VERSION \"${PROJECT_VERSION}\")\n"
"if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)\n"
" set(PACKAGE_VERSION_COMPATIBLE FALSE)\n"
"else()\n"
" set(PACKAGE_VERSION_COMPATIBLE TRUE)\n"
" if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)\n"
" set(PACKAGE_VERSION_EXACT TRUE)\n"
" endif()\n"
"endif()\n"
)
2021-12-08 11:32:04 +00:00
install(DIRECTORY MyxCMake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake")