-
Notifications
You must be signed in to change notification settings - Fork 18
/
CMakeLists.txt
52 lines (43 loc) · 1.73 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
cmake_minimum_required(VERSION 2.8.12)
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif (POLICY CMP0048)
project(base16384 VERSION 2.3.1)
add_definitions(-DBASE16384_VERSION="${PROJECT_VERSION}")
add_definitions(-DBASE16384_VERSION_DATE="April 7th 2024")
message(STATUS "Testing endian...")
include(TestBigEndian)
test_big_endian(isBigEndian)
message(STATUS "Is big endian: ${isBigEndian}.")
if (${isBigEndian})
add_definitions(-DWORDS_BIGENDIAN)
endif ()
if (BUILD STREQUAL "test")
add_definitions(-DBASE16384_BUFSZ_FACTOR=1)
endif ()
add_executable(base16384_b base16384.c)
IF ((NOT FORCE_32BIT) AND CMAKE_SIZEOF_VOID_P EQUAL 8)
message(STATUS "Adding 64bit libraries...")
add_definitions(-DIS_64BIT_PROCESSOR)
add_library(base16384 SHARED wrap.c file.c base1464.c)
add_library(base16384_s STATIC wrap.c file.c base1464.c)
ELSE ()
message(STATUS "Adding 32bit libraries...")
add_library(base16384 SHARED wrap.c file.c base1432.c)
add_library(base16384_s STATIC wrap.c file.c base1432.c)
ENDIF ()
set_target_properties(base16384_b PROPERTIES OUTPUT_NAME base16384)
set_target_properties(base16384_s PROPERTIES OUTPUT_NAME base16384)
set_target_properties(base16384 PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
message(STATUS "Linking libraries...")
target_link_libraries(base16384_b base16384_s)
if (BUILD STREQUAL "test")
message(STATUS "Building test...")
enable_testing()
add_subdirectory(test)
endif ()
INSTALL(TARGETS base16384_b RUNTIME DESTINATION bin)
INSTALL(TARGETS base16384 LIBRARY DESTINATION lib)
INSTALL(TARGETS base16384_s ARCHIVE DESTINATION lib)
INSTALL(FILES base16384.h DESTINATION include)
INSTALL(FILES base16384.1 DESTINATION share/man/man1)