blob: 72b9c26fbf4a991a2445398841a034b8c92835bb (
plain)
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
|
project (mman-win32 C)
cmake_minimum_required (VERSION 2.8)
option (BUILD_SHARED_LIBS "shared/static libs" ON)
option (BUILD_TESTS "tests?" OFF)
set (headers mman.h)
set (sources mman.c)
add_library (mman ${sources})
if (BUILD_SHARED_LIBS)
target_compile_definitions(mman
PUBLIC MMAN_LIBRARY_DLL
PRIVATE MMAN_LIBRARY
)
endif()
install (TARGETS mman RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX})
install (FILES ${headers} DESTINATION include/sys)
if (BUILD_TESTS)
enable_testing ()
add_executable (t_mman test.c)
target_link_libraries (t_mman mman)
add_test (NAME t_mman COMMAND t_mman${CMAKE_EXECUTABLE_SUFFIX})
endif ()
|