Skip to content

Commit

Permalink
Problem: out of date with zproject
Browse files Browse the repository at this point in the history
Solution: regenerate
  • Loading branch information
bluca committed Mar 10, 2017
1 parent a5f771d commit e7bceeb
Show file tree
Hide file tree
Showing 35 changed files with 1,465 additions and 301 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This is a skeleton created by zproject.
# You can add hand-written code here.
# disables auto CRLF conversion for all files; create the file correctly and it will be allright
* -text
132 changes: 106 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################

########################################################################
Expand All @@ -12,11 +12,20 @@ enable_language(C)
enable_testing()

set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# Select flags
SET(CMAKE_C_FLAGS_RELEASE "-O3")

# Will be used to add flags to pkg-config useful when apps want to statically link
set(pkg_config_libs_private "")

########################################################################
# options
########################################################################
ADD_DEFINITIONS (-DCURVE_BUILD_DRAFT_API)
OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" ON)
IF (ENABLE_DRAFTS)
ADD_DEFINITIONS (-DCURVE_BUILD_DRAFT_API)
ENDIF (ENABLE_DRAFTS)

########################################################################
# platform.h
Expand Down Expand Up @@ -64,7 +73,7 @@ endif()

# required libraries for cygwin
if (CYGWIN)
set(MORE_LIBRARIES -luuid)
set(MORE_LIBRARIES)
endif()

list(APPEND CMAKE_MODULE_PATH "${SOURCE_DIR}")
Expand All @@ -77,28 +86,19 @@ find_package(libzmq REQUIRED)
IF (LIBZMQ_FOUND)
include_directories(${LIBZMQ_INCLUDE_DIRS})
list(APPEND MORE_LIBRARIES ${LIBZMQ_LIBRARIES})
set(pkg_config_libs_private "${pkg_config_libs_private} -lzmq")
ELSE (LIBZMQ_FOUND)
message( FATAL_ERROR "libzmq not found." )
ENDIF (LIBZMQ_FOUND)

########################################################################
# UUID dependency
########################################################################
find_package(uuid)
IF (UUID_FOUND)
include_directories(${UUID_INCLUDE_DIRS})
list(APPEND MORE_LIBRARIES ${UUID_LIBRARIES})
add_definitions(-DHAVE_UUID)
list(APPEND OPTIONAL_LIBRARIES ${UUID_LIBRARIES})
ENDIF (UUID_FOUND)

########################################################################
# CZMQ dependency
########################################################################
find_package(czmq REQUIRED)
IF (CZMQ_FOUND)
include_directories(${CZMQ_INCLUDE_DIRS})
list(APPEND MORE_LIBRARIES ${CZMQ_LIBRARIES})
set(pkg_config_libs_private "${pkg_config_libs_private} -lczmq")
ELSE (CZMQ_FOUND)
message( FATAL_ERROR "czmq not found." )
ENDIF (CZMQ_FOUND)
Expand All @@ -110,6 +110,7 @@ find_package(libsodium REQUIRED)
IF (LIBSODIUM_FOUND)
include_directories(${LIBSODIUM_INCLUDE_DIRS})
list(APPEND MORE_LIBRARIES ${LIBSODIUM_LIBRARIES})
set(pkg_config_libs_private "${pkg_config_libs_private} -lsodium")
ELSE (LIBSODIUM_FOUND)
message( FATAL_ERROR "libsodium not found." )
ENDIF (LIBSODIUM_FOUND)
Expand Down Expand Up @@ -150,16 +151,22 @@ IF (ENABLE_DRAFTS)
)
ENDIF (ENABLE_DRAFTS)

IF (ENABLE_DRAFTS)
list (APPEND curve_sources
src/curve_private_selftest.c
)
ENDIF (ENABLE_DRAFTS)

source_group("Source Files" FILES ${curve_sources})
if (NOT DEFINED BUILD_SHARED_LIBS)
SET(BUILD_SHARED_LIBS ON)
endif()
add_library(curve ${curve_sources})
set_target_properties(curve
PROPERTIES DEFINE_SYMBOL "LIBCURVE_EXPORTS"
PROPERTIES DEFINE_SYMBOL "CURVE_EXPORTS"
)
set_target_properties(curve
PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${SOURCE_DIR}/src"
set_target_properties (curve
PROPERTIES SOVERSION "0.0.0"
)
target_link_libraries(curve
${ZEROMQ_LIBRARIES} ${MORE_LIBRARIES}
Expand Down Expand Up @@ -209,16 +216,19 @@ target_link_libraries(
${LIBSODIUM_LIBRARIES}
${OPTIONAL_LIBRARIES}
)
set_target_properties(
curve_selftest
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${SOURCE_DIR}/src"
)

########################################################################
# tests
########################################################################
set(CLASSTEST_TIMEOUT 5 CACHE STRING "Timeout of the selftest of a class")
set(TOTAL_TIMEOUT 20 CACHE STRING "Timout of the total testsuite")
set(CLASSTEST_TIMEOUT 60 CACHE STRING "Timeout of the selftest of a class")
set(TOTAL_TIMEOUT 600 CACHE STRING "Timout of the total testsuite")

if(UNIX)
find_program(MEMORYCHECK_COMMAND valgrind)
set(MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-reachable=yes
--error-exitcode=1
--suppressions=src/.valgrind.supp")
endif()

set(TEST_CLASSES
)
Expand All @@ -232,6 +242,12 @@ IF (ENABLE_DRAFTS)
)
ENDIF (ENABLE_DRAFTS)

IF (ENABLE_DRAFTS)
list (APPEND TEST_CLASSES
private_classes
)
ENDIF (ENABLE_DRAFTS)

foreach(TEST_CLASS ${TEST_CLASSES})
add_test(
NAME ${TEST_CLASS}
Expand All @@ -243,14 +259,78 @@ foreach(TEST_CLASS ${TEST_CLASSES})
)
endforeach(TEST_CLASS)

include(CTest)

########################################################################
# cleanup
########################################################################
add_custom_target (distclean @echo Cleaning for source distribution)

set(cmake_generated ${CMAKE_BINARY_DIR}/CMakeCache.txt
${CMAKE_BINARY_DIR}/cmake_install.cmake
${CMAKE_BINARY_DIR}/Makefile
${CMAKE_BINARY_DIR}/CMakeFiles
${CMAKE_BINARY_DIR}/CTestTestfile.cmake
${CMAKE_BINARY_DIR}/DartConfiguration.tcl
${CMAKE_BINARY_DIR}/Testing
${CMAKE_BINARY_DIR}/compile_commands.json
${CMAKE_BINARY_DIR}/src/platform.h
${CMAKE_BINARY_DIR}/src/libcurve.pc
${CMAKE_BINARY_DIR}/src/libcurve.so
${CMAKE_BINARY_DIR}/src/curve_selftest
${CMAKE_BINARY_DIR}/src/curve_selftest
)

add_custom_command(
DEPENDS clean
COMMENT "distribution clean"
COMMAND rm
ARGS -rf CMakeTmp ${cmake_generated}
TARGET distclean
)

########################################################################
# summary
########################################################################
message (STATUS "*** Version number: ${VERSION}")
message (STATUS "*** Install target: ${CMAKE_INSTALL_PREFIX}")
message ("")
message (STATUS "******************* Configuration Summary *******************")
message (STATUS "General:")
message (STATUS " Version : ${VERSION}")
message (STATUS " System : ${CMAKE_SYSTEM_NAME}")
message (STATUS " C compiler : ${CMAKE_C_COMPILER}")
message (STATUS " Debug C flags : ${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}")
message (STATUS " Release C flags : ${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS}")
message (STATUS " Build type : ${CMAKE_BUILD_TYPE}")
IF (ENABLE_DRAFTS)
message (STATUS " Draft API : Yes")
ELSE (ENABLE_DRAFTS)
message (STATUS " Draft API : No")
ENDIF (ENABLE_DRAFTS)
message (STATUS "")
message (STATUS "Dependencies:")
include(FeatureSummary)
feature_summary (WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
message (STATUS "")
message (STATUS "Install:")
message (STATUS " Install prefix :" "${CMAKE_INSTALL_PREFIX}")
message (STATUS "")
message (STATUS "************************* Options ***************************")
message (STATUS "Options:")
message (STATUS " Use the Draft API (default = yes):")
message (STATUS " -DENABLE-DRAFTS=[yes|no]")
message (STATUS "")
message (STATUS "*************************************************************")
message (STATUS "Configuration complete! Now procced with:")
message (STATUS " 'make' compile the project")
message (STATUS " 'make test' run the project's selftest")
message (STATUS " 'make install' install the project to ${CMAKE_INSTALL_PREFIX}")
message (STATUS "")
message (STATUS "Further options are:")
message (STATUS " 'ctest -T memcheck' run the project's selftest with")
message (STATUS " valgrind to check for memory leaks")
message (STATUS "")

################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
6 changes: 4 additions & 2 deletions Findczmq.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################

if (NOT MSVC)
Expand All @@ -10,6 +10,8 @@ if (NOT MSVC)
pkg_check_modules(PC_CZMQ "libczmq")
endif (NOT PC_CZMQ_FOUND)
if (PC_CZMQ_FOUND)
# add CFLAGS from pkg-config file, e.g. draft api.
add_definitions(${PC_CZMQ_CFLAGS} ${PC_CZMQ_CFLAGS_OTHER})
# some libraries install the headers is a subdirectory of the include dir
# returned by pkg-config, so use a wildcard match to improve chances of finding
# headers and SOs.
Expand Down Expand Up @@ -43,5 +45,5 @@ mark_as_advanced(

################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
6 changes: 4 additions & 2 deletions Findlibsodium.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################

if (NOT MSVC)
Expand All @@ -10,6 +10,8 @@ if (NOT MSVC)
pkg_check_modules(PC_LIBSODIUM "libsodium")
endif (NOT PC_LIBSODIUM_FOUND)
if (PC_LIBSODIUM_FOUND)
# add CFLAGS from pkg-config file, e.g. draft api.
add_definitions(${PC_LIBSODIUM_CFLAGS} ${PC_LIBSODIUM_CFLAGS_OTHER})
# some libraries install the headers is a subdirectory of the include dir
# returned by pkg-config, so use a wildcard match to improve chances of finding
# headers and SOs.
Expand Down Expand Up @@ -43,5 +45,5 @@ mark_as_advanced(

################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
6 changes: 4 additions & 2 deletions Findlibzmq.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################

if (NOT MSVC)
Expand All @@ -10,6 +10,8 @@ if (NOT MSVC)
pkg_check_modules(PC_LIBZMQ "libzmq")
endif (NOT PC_LIBZMQ_FOUND)
if (PC_LIBZMQ_FOUND)
# add CFLAGS from pkg-config file, e.g. draft api.
add_definitions(${PC_LIBZMQ_CFLAGS} ${PC_LIBZMQ_CFLAGS_OTHER})
# some libraries install the headers is a subdirectory of the include dir
# returned by pkg-config, so use a wildcard match to improve chances of finding
# headers and SOs.
Expand Down Expand Up @@ -43,5 +45,5 @@ mark_as_advanced(

################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
27 changes: 21 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################

ACLOCAL_AMFLAGS = -I config
Expand All @@ -11,12 +11,11 @@ AM_CFLAGS = \

AM_CPPFLAGS = \
${libzmq_CFLAGS} \
${uuid_CFLAGS} \
${czmq_CFLAGS} \
${libsodium_CFLAGS} \
-I$(srcdir)/include

project_libs = ${libzmq_LIBS} ${uuid_LIBS} ${czmq_LIBS} ${libsodium_LIBS}
project_libs = ${libzmq_LIBS} ${czmq_LIBS} ${libsodium_LIBS}

SUBDIRS = doc
DIST_SUBDIRS = doc
Expand All @@ -26,17 +25,33 @@ noinst_PROGRAMS =
check_PROGRAMS =
noinst_LTLIBRARIES =
TESTS =

EXTRA_DIST = \
# Prepare variables that can be populated (appended) in generated Makefiles or
# manually maintained src/Makemodule-local.am
EXTRA_DIST =
CLEANFILES =
DISTCLEANFILES =

if ENABLE_DIST_CMAKEFILES
EXTRA_DIST += \
Findlibzmq.cmake \
Findczmq.cmake \
Findlibsodium.cmake \
CMakeLists.txt
endif

EXTRA_DIST += \
LICENSE \
README.txt \
README.md \
CONTRIBUTING.md \
src/curve_classes.h

# NOTE: this "include" syntax is not a "make" but an "autotools" keyword,
# see https://www.gnu.org/software/automake/manual/html_node/Include.html
include $(srcdir)/src/Makemodule.am
include $(srcdir)/src/Makemodule-local.am # Optional project-local hook

################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
9 changes: 7 additions & 2 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/usr/bin/env sh
################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################

# Script to generate all required files from fresh git checkout.

if [ ! -f src/Makemodule-local.am ] ; then
echo "autogen.sh: generating a dummy src/Makemodule-local.am to fulfill dependencies." 1>&2
touch src/Makemodule-local.am
fi

# Debian and Ubuntu do not shipt libtool anymore, but OSX does not ship libtoolize.
command -v libtoolize >/dev/null 2>&1
if [ $? -ne 0 ]; then
Expand Down Expand Up @@ -43,5 +48,5 @@ fi

################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Please refer to the README for information about making permanent changes. #
# Read the zproject/README.md for information about making permanent changes. #
################################################################################
Loading

0 comments on commit e7bceeb

Please sign in to comment.