Skip to content

Commit 58ff5ee

Browse files
authored
Merge pull request #121 from saxbophone/josh/119-version-dependent-headers
Add version dependent headers
2 parents 62221b0 + d50cb2f commit 58ff5ee

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

CMakeLists.txt

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ if(CMAKE_SIZEOF_VOID_P LESS 8)
5050
message(
5151
WARNING
5252
"It looks like this system's architecture is not at least 64-bit.\n"
53-
"libsaxbospiral requires a system with an architecture of at least 64 bits!")
53+
"libsaxbospiral requires a system with an architecture of at least 64 bits!\n"
54+
"We'll continue trying to compile anyway, be sure to run the unit tests after."
55+
)
5456
endif()
5557

5658
# pass in version of library as preprocessor definitions
@@ -123,15 +125,37 @@ install(
123125
LIBRARY DESTINATION lib
124126
RUNTIME DESTINATION bin
125127
)
126-
# Install main library header files
128+
129+
# Generate rough (nearest major) version-dependent header installation folder
130+
set(
131+
LIBSAXBOSPIRAL_ROUGH_HEADER_DESTINATION
132+
"saxbospiral-${PROJECT_VERSION_MAJOR}"
133+
)
134+
# Generate precise (major and minor) version-dependent header installation folder
135+
set(
136+
LIBSAXBOSPIRAL_PRECISE_HEADER_DESTINATION
137+
"saxbospiral-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
138+
)
139+
140+
# Install main library header files, both to rough and precise install locations
141+
install(
142+
FILES ${LIB_SAXBOSPIRAL_HEADERS}
143+
DESTINATION "include/${LIBSAXBOSPIRAL_ROUGH_HEADER_DESTINATION}"
144+
)
145+
# Install render_backends header files
146+
install(
147+
FILES ${LIB_SAXBOSPIRAL_RENDER_BACKENDS_HEADERS}
148+
DESTINATION "include/${LIBSAXBOSPIRAL_ROUGH_HEADER_DESTINATION}/render_backends"
149+
)
150+
127151
install(
128152
FILES ${LIB_SAXBOSPIRAL_HEADERS}
129-
DESTINATION include/saxbospiral
153+
DESTINATION "include/${LIBSAXBOSPIRAL_PRECISE_HEADER_DESTINATION}"
130154
)
131155
# Install render_backends header files
132156
install(
133157
FILES ${LIB_SAXBOSPIRAL_RENDER_BACKENDS_HEADERS}
134-
DESTINATION include/saxbospiral/render_backends
158+
DESTINATION "include/${LIBSAXBOSPIRAL_PRECISE_HEADER_DESTINATION}/render_backends"
135159
)
136160

137161
enable_testing()

0 commit comments

Comments
 (0)