From 484b7dc84c3e3e7c11e180a11394d7599f3f3e07 Mon Sep 17 00:00:00 2001 From: xantares Date: Tue, 23 Sep 2014 13:44:10 +0000 Subject: Initial cmake port --- CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e8731d2 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,30 @@ +project (dlfcn C) + +cmake_minimum_required(VERSION 2.8) + +option(BUILD_SHARED_LIBS "shared/static libs" ON) +option(USE_WINE "use wine for test" ON) +option(BUILD_TESTS "tests?" OFF) + +set(headers dlfcn.h) +set(sources dlfcn.c) + +add_library(dl ${sources}) + +install (TARGETS dl RUNTIME DESTINATION bin + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX}) + +install (FILES ${headers} DESTINATION include) + +if (BUILD_TESTS) + enable_testing() + if (USE_WINE) + find_program(WINE_EXECUTABLE NAMES wine) + endif () + add_library(testdll SHARED testdll.c) + set_target_properties(testdll PROPERTIES PREFIX "") + add_executable(t_dlfcn test.c) + target_link_libraries(t_dlfcn dl) + add_test ( NAME t_dlfcn COMMAND ${WINE_EXECUTABLE} t_dlfcn${CMAKE_EXECUTABLE_SUFFIX} ) +endif () -- cgit v1.2.3-55-g6feb