-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cmake build files to cjose. #30
base: master
Are you sure you want to change the base?
Conversation
#include <stdlib.h> | ||
|
||
#ifndef HAVE_RANDOM | ||
int random(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some platforms (Windows) don't have the random() function. Here we create our own.
|
||
#cmakedefine HAVE_RANDOM | ||
|
||
#cmakedefine HAVE_SSIZE_T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all platforms have ssize_t.
set(CJOSE_MAJOR_VERSION 0) | ||
set(CJOSE_MINOR_VERSION 4) | ||
set(CJOSE_PATCH_VERSION 1) | ||
set(PACKAGE_VERSION ${CJOSE_MAJOR_VERSION}.${CJOSE_MINOR_VERSION}.${CJOSE_PATCH_VERSION}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set cjose version.
endif((NOT ${PKG_NAME}_INCLUDE_DIR) OR (NOT ${PKG_NAME}_LIBRARIES)) | ||
endfunction(GetRootDirForHomebrew PKG_NAME) | ||
|
||
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add priority to homebrew versions of openssl, jansson and check. We can always specify custom locations of those packages by passing OPENSSL_ROOT_DIR, JANSSON_ROOT_DIR and CHECK_ROOT_DIR to our cmake invocation.
The CMakeLists.txt file a main build script.
I have added some extra build scripts to detect Jansson and Check libraries. They are in the CMakeModules directory.
I have created a include\cjose\config.in file. It contains some #defines around supported functions and existing types.