From d746a01fbcc528f5584e2500cfd12ab2dd188316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Arg=C3=BCelles?= Date: Fri, 23 Aug 2013 14:10:17 -0500 Subject: [PATCH] Add entry to allow make install Always compile static and shared library, SHARED_TOXCORE is depreciated, "make install" places files on default prefix. --- INSTALL.md | 2 -- core/CMakeLists.txt | 23 ++++++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index dfb47119..73bc0530 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -63,9 +63,7 @@ mkdir build && cd build cmake .. ``` Advance cmake options: - - `-DSHARED_TOXCORE=ON` (default `OFF`) � Build Core as a shared library. - `-DUSE_NACL=ON` (default `OFF`) � Use NaCl library instead of libsodium. - - `-DNO_WIDECHAR=ON` (default `OFF`) � Disable wide char in toxic. Note that you should call cmake on the root [`CMakeLists.txt`](/CMakeLists.txt) file only. diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 55a41912..02a42849 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -12,14 +12,27 @@ set(core_sources util.c ping.c) -if(SHARED_TOXCORE) - add_library(toxcore SHARED ${core_sources}) -else() - add_library(toxcore ${core_sources}) -endif() +set(core_headers + DHT.h + network.h + Lossless_UDP.h + net_crypto.h + friend_requests.h + LAN_discovery.h + Messenger.h + util.h + ping.h) + +add_library(toxcore SHARED ${core_sources}) +add_library(toxcore_static ${core_sources}) +set_target_properties(toxcore_static PROPERTIES OUTPUT_NAME toxcore) target_link_libraries(toxcore ${LINK_CRYPTO_LIBRARY}) +install(TARGETS toxcore toxcore_static DESTINATION lib) +install(FILES ${core_headers} DESTINATION include) + if(WIN32) target_link_libraries(toxcore ws2_32) endif() +