Commit 213a09e7 authored by Ma Bingyao's avatar Ma Bingyao

Update CmakeLists.txt

parent fdca7830
......@@ -13,3 +13,7 @@ CMakeCache.txt
Makefile
example/main
install_manifest.txt
*.dylib
cmake_minimum_required(VERSION 2.6)
SET(LIBXXTEA_SRC xxtea.c)
ADD_LIBRARY(xxtea STATIC ${LIBXXTEA_SRC})
INSTALL(TARGETS xxtea
project(xxtea)
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_MACOSX_RPATH 1)
set(LIBXXTEA_SRC xxtea.c)
add_library(xxtea SHARED ${LIBXXTEA_SRC})
add_library(xxtea_static STATIC ${LIBXXTEA_SRC})
set_target_properties(xxtea_static PROPERTIES OUTPUT_NAME "xxtea")
set_target_properties(xxtea PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set_target_properties(xxtea_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set_target_properties(xxtea PROPERTIES INSTALL_RPATH "@loader_path/../lib")
set_target_properties(xxtea_static PROPERTIES INSTALL_RPATH "@loader_path/../lib")
install(TARGETS xxtea
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
INSTALL(FILES xxtea.h DESTINATION include)
install(TARGETS xxtea_static
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(FILES xxtea.h DESTINATION include)
project(main)
cmake_minimum_required(VERSION 2.8.12)
aux_source_directory(. DIR_SRCS)
add_executable(main ${DIR_SRCS})
find_path(LIBXXTEA_HEADER xxtea.h)
include_directories(${LIBXXTEA_HEADER})
find_library(
LIBXXTEA_LIBRARIES NAMES xxtea
PATHS /usr/lib/ /usr/local/lib/
)
target_link_libraries(main ${LIBXXTEA_LIBRARIES})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment