|
| 1 | +# Version 3.2 is needed to be able to have support of target_compile_features for AppleClang |
| 2 | +cmake_minimum_required(VERSION 3.2.0 FATAL_ERROR) |
| 3 | + |
| 4 | +# Sets the name of the project, and stores it in the variable PROJECT_NAME. When called from the top-level CMakeLists.txt also stores the project name in the variable CMAKE_PROJECT_NAME. |
| 5 | +project(Mach7) |
| 6 | + |
| 7 | +# Adds a subdirectory to the build. The source_dir specifies the directory in which the source CMakeLists.txt and code files are located. |
| 8 | +project(Mach7) |
| 9 | + |
| 10 | +add_subdirectory(code/test) |
| 11 | + |
| 12 | +# Define the library target |
| 13 | +add_library(Mach7 INTERFACE) |
| 14 | +add_library(Mach7::Mach7 ALIAS Mach7) |
| 15 | + |
| 16 | +install(TARGETS Mach7 |
| 17 | + EXPORT Mach7Targets |
| 18 | + LIBRARY DESTINATION lib COMPONENT Runtime |
| 19 | + ARCHIVE DESTINATION lib COMPONENT Development |
| 20 | + RUNTIME DESTINATION bin COMPONENT Runtime |
| 21 | + PUBLIC_HEADER DESTINATION include COMPONENT Development |
| 22 | + BUNDLE DESTINATION bin COMPONENT Runtime |
| 23 | +) |
| 24 | + |
| 25 | +include(CMakePackageConfigHelpers) |
| 26 | +configure_package_config_file( |
| 27 | + "${PROJECT_SOURCE_DIR}/cmake/Mach7Config.cmake.in" |
| 28 | + "${PROJECT_BINARY_DIR}/Mach7Config.cmake" |
| 29 | + INSTALL_DESTINATION lib/cmake/Mach7 |
| 30 | +) |
| 31 | + |
| 32 | +install(EXPORT Mach7Targets DESTINATION lib/cmake/Mach7) |
| 33 | +install(FILES |
| 34 | + "${PROJECT_BINARY_DIR}/Mach7Config.cmake" |
| 35 | + DESTINATION lib/cmake/Mach7) |
| 36 | + |
| 37 | + |
| 38 | +# for linux: copy header files to /usr/local/ by default |
| 39 | +# for windows: copy header fiels to c:/Program Files by default |
| 40 | +install( |
| 41 | + DIRECTORY ${CMAKE_SOURCE_DIR}/code/mach7/ |
| 42 | + DESTINATION include/mach7) |
| 43 | +install( |
| 44 | + DIRECTORY ${CMAKE_SOURCE_DIR}/code/xtl/ |
| 45 | + DESTINATION include/xtl) |
| 46 | +install( |
| 47 | + DIRECTORY ${CMAKE_SOURCE_DIR}/code/cppft/ |
| 48 | + DESTINATION include/cppft) |
0 commit comments