cmake
This commit is contained in:
parent
41dab59126
commit
b9c84ab7e9
@ -94,9 +94,9 @@ OPTION (WITH_SWIG " Enable SWIG interfaces to foreign languages" ON)
|
||||
|
||||
IF (WITH_SWIG OR ANDROID)
|
||||
find_host_package (SWIG)
|
||||
macro_log_feature (SWIG_FOUND "Swig"
|
||||
"Use SWIG Interface Generator "
|
||||
"http://www.swig.org" ON)
|
||||
# macro_log_feature (SWIG_FOUND "Swig"
|
||||
# "Use SWIG Interface Generator "
|
||||
# "http://www.swig.org" ON)
|
||||
ENDIF (WITH_SWIG OR ANDROID)
|
||||
|
||||
option (WITH_PYTHON
|
||||
@ -124,7 +124,7 @@ ENDIF (WITH_PYTHON)
|
||||
|
||||
|
||||
|
||||
add_library( # Sets the name of the library.
|
||||
add_lib( # Sets the name of the library.
|
||||
libYap
|
||||
|
||||
# Sets the library as a shared library.
|
||||
|
@ -24,7 +24,7 @@ if ( WIN32)
|
||||
|
||||
set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "_YAP_NOT_INSTALLED_=1;HAVE_CONFIG_H=1;_GNU_SOURCE;YAP_KERNEL=1" )
|
||||
else()
|
||||
add_external (YAP++ ${CXX_SOURCES} )
|
||||
add_lib(YAP++ ${CXX_SOURCES} )
|
||||
MY_target_link_libraries(YAP++ ${CMAKE_DL_LIBS} libYap)
|
||||
|
||||
MY_install(TARGETS YAP++
|
||||
|
@ -58,7 +58,7 @@ set (POSITION_INDEPENDENT_CODE TRUE)
|
||||
|
||||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${LLVM_CXXFLAGS})
|
||||
|
||||
add_library (libyapjit SHARED
|
||||
add_lib (libyapjit
|
||||
${LIBJIT_SOURCES}
|
||||
${LIBJIT_HEADERS}
|
||||
)
|
||||
|
@ -7,6 +7,22 @@ if (POLICY CMP0042)
|
||||
cmake_policy( SET CMP0042 NEW)
|
||||
endif()
|
||||
|
||||
function(add_to_group output list)
|
||||
set (result "")
|
||||
foreach (path IN LISTS ${list})
|
||||
get_source_file_property(result ${path} LOCATION)
|
||||
list( APPEND tmp ${result})
|
||||
endforeach ()
|
||||
list( APPEND ${output} ${tmp})
|
||||
set (${output} ${${output}} CACHE INTERNAL "prolog library files")
|
||||
endfunction(add_to_group output list )
|
||||
|
||||
function(add_to_libgroup arg list)
|
||||
set (x ${CMAKE_CURRENT_BINARY_DIR}/*${arg}*${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
list( APPEND ${list} ${x})
|
||||
set(${list} ${${list}} CACHE INTERNAL "prolog library files")
|
||||
endfunction(add_to_libgroup arg list )
|
||||
|
||||
if (ANDROID_OLD)
|
||||
macro ( MY_add_custom_target)
|
||||
endmacro()
|
||||
@ -16,30 +32,19 @@ else()
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
|
||||
if (ANDROID_OLD)
|
||||
macro ( add_component arg1)
|
||||
foreach(item ${ARGN})
|
||||
get_filename_component(i ${item} ABSOLUTE)
|
||||
set( ALL_SOURCES ${ALL_SOURCES} ${i} )
|
||||
endforeach()
|
||||
set( ALL_SOURCES ${ALL_SOURCES} PARENT_SCOPE )
|
||||
endmacro()
|
||||
macro ( add_external arg1)
|
||||
foreach(item ${ARGN})
|
||||
get_filename_component(i ${item} ABSOLUTE)
|
||||
set( ALL_SOURCES ${ALL_SOURCES} ${i} )
|
||||
endforeach()
|
||||
set( ALL_SOURCES ${ALL_SOURCES} PARENT_SCOPE )
|
||||
endmacro()
|
||||
if (WIN32)
|
||||
macro ( add_component arg1 )
|
||||
add_library ( ${arg1} OBJECT ${ARGN})
|
||||
endmacro()
|
||||
else()
|
||||
macro ( add_component arg1 )
|
||||
add_library ( ${arg1} OBJECT ${ARGN})
|
||||
endmacro()
|
||||
macro ( add_external arg1 )
|
||||
add_library ( ${arg1} SHARED ${ARGN})
|
||||
endmacro()
|
||||
macro ( add_component arg1 )
|
||||
add_library ( ${arg1} OBJECT ${ARGN})
|
||||
endmacro()
|
||||
endif()
|
||||
macro ( add_lib arg1 )
|
||||
add_library ( ${arg1} SHARED ${ARGN})
|
||||
add_to_libgroup( ${arg1} YAP_DLLS )
|
||||
endmacro()
|
||||
|
||||
if (ANDROID_OLD)
|
||||
macro ( MY_add_dependencies)
|
||||
@ -168,12 +173,3 @@ set (pl_library "" CACHE INTERNAL "prolog library files" )
|
||||
set (pl_os_library "" CACHE INTERNAL "prolog os files" )
|
||||
set (pl_boot_library "" CACHE INTERNAL "prolog boot files" )
|
||||
|
||||
function(add_to_group output list)
|
||||
set (result "")
|
||||
foreach (path IN LISTS ${list})
|
||||
get_source_file_property(result ${path} LOCATION)
|
||||
list( APPEND tmp ${result})
|
||||
endforeach ()
|
||||
list( APPEND ${output} ${tmp})
|
||||
set (${output} ${${output}} CACHE INTERNAL "prolog library files")
|
||||
endfunction(add_to_group output list )
|
||||
|
@ -67,7 +67,7 @@ if (MPI_C_FOUND)
|
||||
# pass to the MPI program.
|
||||
#
|
||||
|
||||
add_library (yap_mpi SHARED ${MPI_SOURCES})
|
||||
add_lib (yap_mpi ${MPI_SOURCES})
|
||||
|
||||
target_link_libraries(yap_mpi libYap ${MPI_C_LIBRARIES})
|
||||
|
||||
|
@ -7,7 +7,7 @@ if (MATLAB_FOUND)
|
||||
# MATLAB_MX_LIBRARY: path to libmx.lib
|
||||
# MATLAB_ENG_LIBRARY: path to libeng.lib
|
||||
|
||||
add_library (matlab SHARED matlab.c)
|
||||
add_li (matlab matlab.c)
|
||||
|
||||
set_target_properties (matlab PROPERTIES prefix "")
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
add_library (matrix SHARED matrix.c)
|
||||
add_lib(matrix matrix.c)
|
||||
|
||||
target_link_libraries(matrix libYap)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
set( LIBRANDOM_SOURCES yap_random.c)
|
||||
add_external (yap_random ${LIBRANDOM_SOURCES})
|
||||
add_lib(yap_random ${LIBRANDOM_SOURCES})
|
||||
if (ANDROID)
|
||||
else()
|
||||
|
||||
|
@ -17,7 +17,7 @@ set ( REGEX_SOURCES
|
||||
|
||||
|
||||
|
||||
add_library (regexp SHARED regexp.c ${REGEX_SOURCES})
|
||||
add_lib(regexp regexp.c ${REGEX_SOURCES})
|
||||
|
||||
target_link_libraries(regexp libYap)
|
||||
|
||||
|
@ -4,7 +4,7 @@ set ( RLTREE_SOURCES
|
||||
range_list.h
|
||||
)
|
||||
|
||||
add_library (yap_rl SHARED yap_rl.c ${RLTREE_SOURCES})
|
||||
add_lib(yap_rl yap_rl.c ${RLTREE_SOURCES})
|
||||
|
||||
target_link_libraries(yap_rl libYap)
|
||||
|
||||
|
@ -2,7 +2,7 @@ set( LIBSYSTEM_SOURCES sys.c crypto/md5.c )
|
||||
set( LIBSYSTEM_HEADERS crypto/md5.h)
|
||||
|
||||
|
||||
add_external (sys ${LIBSYSTEM_SOURCES})
|
||||
add_lib(sys ${LIBSYSTEM_SOURCES})
|
||||
if (ANDROID)
|
||||
set (TARGET libYap)
|
||||
else()
|
||||
|
@ -6,7 +6,7 @@ set ( TRIES_SOURCES
|
||||
tries.c
|
||||
)
|
||||
|
||||
add_library (tries SHARED ${TRIES_SOURCES})
|
||||
add_lib(tries ${TRIES_SOURCES})
|
||||
|
||||
target_link_libraries(tries libYap)
|
||||
|
||||
@ -27,7 +27,7 @@ set ( ITRIES_SOURCES
|
||||
if (ANDROID OR WIN32)
|
||||
add_component ( otries ${TRIES_SOURCES} )
|
||||
endif()
|
||||
add_library (itries SHARED ${ITRIES_SOURCES})
|
||||
add_lib(itries ${ITRIES_SOURCES})
|
||||
|
||||
target_link_libraries(itries libYap)
|
||||
|
||||
|
@ -337,7 +337,7 @@ static void InitStdStream(int sno, SMALLUNSGN flags, FILE *file, VFS_t *vfsp) {
|
||||
#endif /* HAVE_SETBUF */
|
||||
}
|
||||
|
||||
void Yap_InitStdStream(int sno, SMALLUNSGN flags, FILE *file, VFS_t *vfsp) {
|
||||
void Yap_InitStdStream(int sno, unsigned int flags, FILE *file, VFS_t *vfsp) {
|
||||
InitStdStream(sno, flags, file, vfsp);
|
||||
}
|
||||
|
||||
|
@ -36,12 +36,13 @@ set (LIBRARY_PL
|
||||
dcg/basics.pl
|
||||
)
|
||||
|
||||
add_to_group( pl_library LIBRARY_PL )
|
||||
|
||||
if (ANDROID)
|
||||
file(INSTALL ${LIBRARY_PL} DESTINATION ${libpl})
|
||||
else()
|
||||
endif()
|
||||
|
||||
install(FILES ${LIBRARY_PL}
|
||||
DESTINATION ${libpl}
|
||||
)
|
||||
|
||||
add_to_group( pl_swi_library LIBRARY_PL )
|
||||
|
Reference in New Issue
Block a user