aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2014-09-23 17:28:16 -0700
committerTimothy Gu <timothygu99@gmail.com>2014-09-23 17:28:16 -0700
commit6a6ebd39e522922aa493552961d4b599f1e83805 (patch)
tree78a27440b35ea31d8cc1f9755f0a2c3e5a94abb0
parentcf56306383935c6123f1ab70fcb73c850e301819 (diff)
parent484b7dc84c3e3e7c11e180a11394d7599f3f3e07 (diff)
downloaddlfcn-win32-6a6ebd39e522922aa493552961d4b599f1e83805.tar.gz
dlfcn-win32-6a6ebd39e522922aa493552961d4b599f1e83805.tar.bz2
dlfcn-win32-6a6ebd39e522922aa493552961d4b599f1e83805.zip
Merge pull request #3 from xantares/cmake
Initial cmake port
-rw-r--r--CMakeLists.txt30
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 @@
1project (dlfcn C)
2
3cmake_minimum_required(VERSION 2.8)
4
5option(BUILD_SHARED_LIBS "shared/static libs" ON)
6option(USE_WINE "use wine for test" ON)
7option(BUILD_TESTS "tests?" OFF)
8
9set(headers dlfcn.h)
10set(sources dlfcn.c)
11
12add_library(dl ${sources})
13
14install (TARGETS dl RUNTIME DESTINATION bin
15 LIBRARY DESTINATION lib${LIB_SUFFIX}
16 ARCHIVE DESTINATION lib${LIB_SUFFIX})
17
18install (FILES ${headers} DESTINATION include)
19
20if (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} )
30endif ()