]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
2 | index c29d9bf..fc66b85 100644 | |
3 | --- a/CMakeLists.txt | |
4 | +++ b/CMakeLists.txt | |
5 | @@ -1,5 +1,7 @@ | |
6 | cmake_minimum_required(VERSION 2.6) | |
7 | ||
8 | +project(soil C) | |
9 | + | |
10 | include_directories(inc) | |
11 | ||
12 | ADD_LIBRARY( soil STATIC | |
13 | @@ -8,3 +10,31 @@ ADD_LIBRARY( soil STATIC | |
14 | src/image_DXT.c | |
15 | src/SOIL.c | |
16 | ) | |
17 | + | |
18 | +target_include_directories(soil INTERFACE $<INSTALL_INTERFACE:include>) | |
19 | + | |
20 | +install(TARGETS soil | |
21 | + EXPORT soilTargets | |
22 | + ARCHIVE DESTINATION lib | |
23 | + LIBRARY DESTINATION lib) | |
24 | + | |
25 | +install(FILES inc/SOIL/SOIL.h | |
26 | + DESTINATION include/SOIL) | |
27 | + | |
28 | +# Prepare and install package files | |
29 | +set(soil_VERSION "2021.4.22") | |
30 | + | |
31 | +export(TARGETS soil FILE "${PROJECT_BINARY_DIR}/soilTargets.cmake") | |
32 | + | |
33 | +export(PACKAGE soil) | |
34 | +# Create the soilConfig.cmake and soilConfigVersion files | |
35 | +configure_file(soilConfig.cmake.in "${PROJECT_BINARY_DIR}/soilConfig.cmake" @ONLY) | |
36 | +configure_file(soilConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/soilConfigVersion.cmake" @ONLY) | |
37 | +# Install the soilConfig.cmake and soilConfigVersion.cmake | |
38 | +install(FILES | |
39 | + "${PROJECT_BINARY_DIR}/soilConfig.cmake" | |
40 | + "${PROJECT_BINARY_DIR}/soilConfigVersion.cmake" | |
41 | + DESTINATION "share/soil") | |
42 | +# Install the export set for use with the install-tree | |
43 | +install(EXPORT soilTargets DESTINATION | |
44 | + "share/soil") | |
45 | \ No newline at end of file |