cmake vs libraries
This commit is contained in:
parent
3ff5ddf04a
commit
ca2dfeb51e
@ -6,7 +6,10 @@
|
|||||||
# library. You should either keep the default value or only pass a
|
# library. You should either keep the default value or only pass a
|
||||||
# value of 3.4.0 or lower.
|
# value of 3.4.0 or lower.
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.4.1)
|
project( YAP )
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
|
||||||
set(
|
set(
|
||||||
CMAKE_MODULE_PATH
|
CMAKE_MODULE_PATH
|
||||||
"${CMAKE_SOURCE_DIR}"
|
"${CMAKE_SOURCE_DIR}"
|
||||||
@ -104,10 +107,11 @@ if (USE_READLINE)
|
|||||||
target_link_libraries(libYap ${READLINE_LIBRARIES})
|
target_link_libraries(libYap ${READLINE_LIBRARIES})
|
||||||
endif (USE_READLINE)
|
endif (USE_READLINE)
|
||||||
|
|
||||||
|
target_link_libraries(libYap m pthread)
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
|
|
||||||
target_link_libraries(libYap m android log)
|
target_link_libraries(libYap android log)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set_target_properties(libYap
|
set_target_properties(libYap
|
||||||
|
@ -24,8 +24,10 @@ MY_install(TARGETS Yap++
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
include_directories ( . ${CMAKE_BINARY_DIR} ${GMP_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
set( CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${GMP_INCLUDE_DIRS} )
|
||||||
|
|
||||||
|
|
||||||
include_directories (H include ${CMAKE_BINARY_DIR} ${GMP_INCLUDE_DIR})
|
|
||||||
|
|
||||||
set( CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${GMP_INCLUDE_DIR} )
|
|
||||||
#set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${GMP_LIBRARIES} )
|
#set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${GMP_LIBRARIES} )
|
||||||
|
@ -128,9 +128,9 @@ if (HAVE_LIBANDROID)
|
|||||||
set(EXTRALIBS ${EXTRALIBS} android)
|
set(EXTRALIBS ${EXTRALIBS} android)
|
||||||
endif (HAVE_LIBANDROID)
|
endif (HAVE_LIBANDROID)
|
||||||
|
|
||||||
check_library_exists(m logf "" HAVE_LIBM)
|
check_library_exists(m main "" HAVE_LIBM)
|
||||||
if (HAVE_LIBM)
|
if (HAVE_LIBM)
|
||||||
set(EXTRALIBS ${EXTRALIBS} m)
|
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} m)
|
||||||
endif (HAVE_LIBM)
|
endif (HAVE_LIBM)
|
||||||
|
|
||||||
check_library_exists(dl dlopen "" HAVE_LIBDL)
|
check_library_exists(dl dlopen "" HAVE_LIBDL)
|
||||||
@ -206,6 +206,13 @@ endif (HAVE_LIBLOG)
|
|||||||
# set(EXTRALIBS ${EXTRALIBS} socket)
|
# set(EXTRALIBS ${EXTRALIBS} socket)
|
||||||
# endif (HAVE_LIBSOCKET)
|
# endif (HAVE_LIBSOCKET)
|
||||||
|
|
||||||
|
|
||||||
|
check_library_exists(upthread main "" HAVE_LIBPTHREAD)
|
||||||
|
if (HAVE_LIBPTHREAD)
|
||||||
|
set( EXTRALIBS ${EXTRALIBS} pthread)
|
||||||
|
endif (HAVE_LIBPTHREAD)
|
||||||
|
|
||||||
|
|
||||||
check_library_exists(unicode main "" HAVE_LIBUNICODE)
|
check_library_exists(unicode main "" HAVE_LIBUNICODE)
|
||||||
if (HAVE_LIBUNICODE)
|
if (HAVE_LIBUNICODE)
|
||||||
set(EXTRALIBS ${EXTRALIBS} unicode)
|
set(EXTRALIBS ${EXTRALIBS} unicode)
|
||||||
|
60
libYap.cmakr
60
libYap.cmakr
@ -1,60 +0,0 @@
|
|||||||
|
|
||||||
include (Sources)
|
|
||||||
|
|
||||||
#
|
|
||||||
include_directories (H H/generated include os OPTYap utf8proc JIT/HPP)
|
|
||||||
include_directories (BEFORE ${CMAKE_BINARY_DIR})
|
|
||||||
|
|
||||||
|
|
||||||
#utf-8 is not an option
|
|
||||||
# we use the nice UTF-8 package
|
|
||||||
#available at the Julia project
|
|
||||||
include_directories ( utf8proc )
|
|
||||||
ADD_SUBDIRECTORY ( utf8proc )
|
|
||||||
|
|
||||||
find_package (GMP)
|
|
||||||
macro_log_feature (GMP_FOUND
|
|
||||||
"GNU libgmp (in some cases MPIR"
|
|
||||||
"GNU big integers and rationals"
|
|
||||||
"http://gmplib.org")
|
|
||||||
set(YAP_SYSTEM_OPTIONS "big_numbers " ${YAP_SYSTEM_OPTIONS})
|
|
||||||
|
|
||||||
if (GMP_FOUND)
|
|
||||||
# GMP_FOUND - true if GMP/MPIR was found
|
|
||||||
# GMP_INCLUDE_DIRS - include search path
|
|
||||||
# GMP_LIBRARIES - libraries to link with
|
|
||||||
# GMP_LIBRARY_DLL - library DLL to install. Only available on WIN32.
|
|
||||||
# GMP_LIBRARIES_DIR - the directory the library we link with is found in.
|
|
||||||
include_directories (${GMP_INCLUDE_DIRS})
|
|
||||||
#add_executable(test ${SOURCES})
|
|
||||||
add_library(libGMP SHARED IMPORTED GLOBAL)
|
|
||||||
set_target_properties(libGMP PROPERTIES IMPORTED_LOCATION ${GMP_LIBRARIES})
|
|
||||||
#config.h needs this (TODO: change in code latter)
|
|
||||||
set( CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${GMP_INCLUDE_DIRS} )
|
|
||||||
|
|
||||||
endif (GMP_FOUND)
|
|
||||||
|
|
||||||
|
|
||||||
include( Threads )
|
|
||||||
#
|
|
||||||
# include OS and I/o stuff
|
|
||||||
#
|
|
||||||
# convenience libraries
|
|
||||||
# OPTYap exports important flags
|
|
||||||
#
|
|
||||||
add_subDIRECTORY (OPTYap)
|
|
||||||
|
|
||||||
add_subDIRECTORY (packages/myddas)
|
|
||||||
|
|
||||||
|
|
||||||
add_subDIRECTORY (os)
|
|
||||||
|
|
||||||
#bootstrap and saved state
|
|
||||||
add_subDIRECTORY (pl)
|
|
||||||
|
|
||||||
#C++ interface
|
|
||||||
add_subDIRECTORY (CXX)
|
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(swi/library)
|
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(library)
|
|
@ -10,6 +10,7 @@ set (TARGET sys)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if (NOT ANDROID)
|
||||||
#
|
#
|
||||||
# this will support getting better cryptographic support,
|
# this will support getting better cryptographic support,
|
||||||
# but right now Open SSL is not supported enough.
|
# but right now Open SSL is not supported enough.
|
||||||
@ -26,6 +27,8 @@ if (OPENSSL_FOUND)
|
|||||||
check_include_file( "openssl/md5.h" HAVE_OPENSSL_MD5_H )
|
check_include_file( "openssl/md5.h" HAVE_OPENSSL_MD5_H )
|
||||||
endif (OPENSSL_FOUND)
|
endif (OPENSSL_FOUND)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
check_library_exists( crypt crypt "" HAVE_LIBCRYPT )
|
check_library_exists( crypt crypt "" HAVE_LIBCRYPT )
|
||||||
if (HAVE_LIBCRYPT)
|
if (HAVE_LIBCRYPT)
|
||||||
target_link_libraries(${TARGET} crypt)
|
target_link_libraries(${TARGET} crypt)
|
||||||
|
@ -40,6 +40,7 @@ set_property(GLOBAL APPEND PROPERTY COMPILE_DEFINITIONS
|
|||||||
if (NOT ANDROID)
|
if (NOT ANDROID)
|
||||||
#target_link_libraries(Yapsqlite3 libYap)
|
#target_link_libraries(Yapsqlite3 libYap)
|
||||||
set_target_properties (Yapsqlite3 PROPERTIES
|
set_target_properties (Yapsqlite3 PROPERTIES
|
||||||
|
POSITION_INDEPENDENT_CODE ON
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -25,15 +25,17 @@ add_definitions (
|
|||||||
-DUTF8PROC_EXPORTS
|
-DUTF8PROC_EXPORTS
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
#if (NOT MSVC)
|
#if (NOT MSVC)
|
||||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -std=c99 -pedantic -Wall")
|
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -std=c99 -pedantic -Wall")
|
||||||
#endif ()
|
#endif ()
|
||||||
##SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${my_cxx_flags}" )
|
##SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${my_cxx_flags}" )
|
||||||
#SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${my_cxx_flags}" )
|
#SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${my_cxx_flags}" )
|
||||||
|
|
||||||
|
set_target_properties( utf8proc PROPERTIES POSITION_INDEPENDENT_CODE ON
|
||||||
|
)
|
||||||
|
|
||||||
set( CMAKE_REQUIRED_INCLUDES . ${CMAKE_REQUIRED_INCLUDES} )
|
set( CMAKE_REQUIRED_INCLUDES . ${CMAKE_REQUIRED_INCLUDES} )
|
||||||
|
|
||||||
|
|
||||||
set ( YAP_YAPUTF8LIB $<TARGET_FILE_NAME:utf8proc> )
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user