-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
35 lines (29 loc) · 1.05 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cmake_minimum_required(VERSION 3.0)
project(c-rez
VERSION 1.0.1
LANGUAGES C
DESCRIPTION "c-rez is a small tool to generate C arrays of data from files."
)
# Honor C_VISIBILITY_PRESET and CXX_VISIBILITY_PRESET
cmake_policy(PUSH)
cmake_policy(SET CMP0063 NEW)
if (NOT TARGET c-rez)
add_executable(c-rez src/c-rez.c)
add_executable(c-rez::c-rez ALIAS c-rez)
if (WIN32)
target_compile_definitions(c-rez PRIVATE -D_CRT_SECURE_NO_WARNINGS)
endif()
install(TARGETS c-rez EXPORT c-rez-targets RUNTIME DESTINATION bin)
endif()
include(src/c-rez-add-c-rez.cmake)
# Export c-rez-config
include(CMakePackageConfigHelpers)
write_basic_package_version_file("${CMAKE_BINARY_DIR}/c-rez-config-version.cmake" VERSION "${PROJECT_VERSION}" COMPATIBILITY AnyNewerVersion)
install(EXPORT c-rez-targets FILE c-rez-targets.cmake NAMESPACE c-rez:: DESTINATION lib/cmake/c-rez)
install(FILES
src/c-rez-config.cmake
src/c-rez-add-c-rez.cmake
${CMAKE_BINARY_DIR}/c-rez-config-version.cmake
DESTINATION lib/cmake/c-rez)
include(src/c-rez-cpack.cmake)
cmake_policy(POP)