diff options
author | xantares <xantares09@hotmail.com> | 2014-09-23 13:44:10 +0000 |
---|---|---|
committer | xantares <xantares09@hotmail.com> | 2014-09-23 13:44:10 +0000 |
commit | 484b7dc84c3e3e7c11e180a11394d7599f3f3e07 (patch) | |
tree | 78a27440b35ea31d8cc1f9755f0a2c3e5a94abb0 | |
parent | cf56306383935c6123f1ab70fcb73c850e301819 (diff) | |
download | dlfcn-win32-484b7dc84c3e3e7c11e180a11394d7599f3f3e07.tar.gz dlfcn-win32-484b7dc84c3e3e7c11e180a11394d7599f3f3e07.tar.bz2 dlfcn-win32-484b7dc84c3e3e7c11e180a11394d7599f3f3e07.zip |
Initial cmake port
-rw-r--r-- | CMakeLists.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e8731d2 --- /dev/null +++ b/CMakeLists.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | project (dlfcn C) | ||
2 | |||
3 | cmake_minimum_required(VERSION 2.8) | ||
4 | |||
5 | option(BUILD_SHARED_LIBS "shared/static libs" ON) | ||
6 | option(USE_WINE "use wine for test" ON) | ||
7 | option(BUILD_TESTS "tests?" OFF) | ||
8 | |||
9 | set(headers dlfcn.h) | ||
10 | set(sources dlfcn.c) | ||
11 | |||
12 | add_library(dl ${sources}) | ||
13 | |||
14 | install (TARGETS dl RUNTIME DESTINATION bin | ||
15 | LIBRARY DESTINATION lib${LIB_SUFFIX} | ||
16 | ARCHIVE DESTINATION lib${LIB_SUFFIX}) | ||
17 | |||
18 | install (FILES ${headers} DESTINATION include) | ||
19 | |||
20 | if (BUILD_TESTS) | ||
21 | enable_testing() | ||
22 | if (USE_WINE) | ||
23 | find_program(WINE_EXECUTABLE NAMES wine) | ||
24 | endif () | ||
25 | add_library(testdll SHARED testdll.c) | ||
26 | set_target_properties(testdll PROPERTIES PREFIX "") | ||
27 | add_executable(t_dlfcn test.c) | ||
28 | target_link_libraries(t_dlfcn dl) | ||
29 | add_test ( NAME t_dlfcn COMMAND ${WINE_EXECUTABLE} t_dlfcn${CMAKE_EXECUTABLE_SUFFIX} ) | ||
30 | endif () | ||