2016-07-31 17:35:57 +01:00
|
|
|
|
|
|
|
#begining stuff for top CMakeLists
|
|
|
|
|
|
|
|
include (MacroLogFeature)
|
|
|
|
|
2016-08-05 22:36:26 +01:00
|
|
|
if (POLICY CMP0042)
|
2016-09-09 04:21:15 +01:00
|
|
|
cmake_policy( SET CMP0042 NEW)
|
2016-08-05 22:36:26 +01:00
|
|
|
endif()
|
2016-07-31 17:35:57 +01:00
|
|
|
|
2017-09-06 01:17:43 +01:00
|
|
|
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 )
|
|
|
|
|
2017-07-25 01:10:44 +01:00
|
|
|
if (ANDROID_OLD)
|
2016-09-09 04:21:15 +01:00
|
|
|
macro ( MY_add_custom_target)
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
else()
|
|
|
|
macro ( MY_add_custom_target )
|
2016-09-09 04:21:15 +01:00
|
|
|
add_custom_target (${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
endif()
|
|
|
|
|
2017-09-06 01:17:43 +01:00
|
|
|
if (WIN32)
|
|
|
|
macro ( add_component arg1 )
|
|
|
|
add_library ( ${arg1} OBJECT ${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
else()
|
2017-09-06 01:17:43 +01:00
|
|
|
macro ( add_component arg1 )
|
|
|
|
add_library ( ${arg1} OBJECT ${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
endif()
|
2017-09-06 01:17:43 +01:00
|
|
|
macro ( add_lib arg1 )
|
|
|
|
add_library ( ${arg1} SHARED ${ARGN})
|
|
|
|
add_to_libgroup( ${arg1} YAP_DLLS )
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
|
2017-07-25 01:10:44 +01:00
|
|
|
if (ANDROID_OLD)
|
2016-09-09 04:21:15 +01:00
|
|
|
macro ( MY_add_dependencies)
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
else()
|
|
|
|
macro ( MY_add_dependencies )
|
2016-09-09 04:21:15 +01:00
|
|
|
add_dependencies (${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
endif()
|
|
|
|
|
2017-07-25 01:10:44 +01:00
|
|
|
if (ANDROID_OLD)
|
2016-09-09 04:21:15 +01:00
|
|
|
macro ( MY_add_library)
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
else()
|
|
|
|
macro ( MY_add_library )
|
2016-09-09 04:21:15 +01:00
|
|
|
add_library (${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (ANDROID)
|
2016-09-09 04:21:15 +01:00
|
|
|
macro ( MY_add_subdirectory)
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
else()
|
|
|
|
macro ( MY_add_subdirectory )
|
2016-09-09 04:21:15 +01:00
|
|
|
add_subdirectory (${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
endif()
|
|
|
|
|
2017-07-25 01:10:44 +01:00
|
|
|
if (ANDROID_OLD)
|
2016-09-09 04:21:15 +01:00
|
|
|
macro ( MY_include)
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
else()
|
|
|
|
macro ( MY_include )
|
2016-09-09 04:21:15 +01:00
|
|
|
include (${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (ANDROID)
|
2016-09-09 04:21:15 +01:00
|
|
|
macro ( MY_install)
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
else()
|
|
|
|
macro ( MY_install )
|
2016-09-09 04:21:15 +01:00
|
|
|
install (${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
endif()
|
|
|
|
|
2017-07-25 01:10:44 +01:00
|
|
|
if (ANDROID_OLD)
|
2016-09-09 04:21:15 +01:00
|
|
|
macro ( MY_set_target_properties)
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
else()
|
|
|
|
macro ( MY_set_target_properties )
|
2016-09-09 04:21:15 +01:00
|
|
|
set_target_properties (${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
endif()
|
|
|
|
|
2017-07-25 01:10:44 +01:00
|
|
|
if (ANDROID_OLD)
|
2016-09-09 04:21:15 +01:00
|
|
|
macro ( MY_target_link_libraries)
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
else()
|
|
|
|
macro ( MY_target_link_libraries )
|
2016-09-09 04:21:15 +01:00
|
|
|
target_link_libraries (${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# where we have most scripts
|
|
|
|
# set path to additional CMake modules
|
|
|
|
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
|
|
|
|
include(disallow)
|
|
|
|
|
|
|
|
disallow_intree_builds()
|
|
|
|
|
|
|
|
# set(CMAKE_BUILD_TYPE Debug)
|
|
|
|
|
|
|
|
if (APPLE)
|
2016-09-09 04:21:15 +01:00
|
|
|
set (MACOSX_RPATH ON)
|
2016-07-31 17:35:57 +01:00
|
|
|
endif (APPLE )
|
|
|
|
if(POLICY CMP0042)
|
2016-09-09 04:21:15 +01:00
|
|
|
cmake_policy(SET CMP0042 NEW)
|
2016-07-31 17:35:57 +01:00
|
|
|
endif(POLICY CMP0042)
|
|
|
|
if(POLICY CMP0043)
|
2016-09-09 04:21:15 +01:00
|
|
|
cmake_policy(SET CMP0043 NEW)
|
2016-07-31 17:35:57 +01:00
|
|
|
endif(POLICY CMP0043)
|
|
|
|
|
|
|
|
|
2016-09-09 04:21:15 +01:00
|
|
|
if (ANDROID)
|
2016-11-24 04:35:39 +00:00
|
|
|
set ( prefix ${YAP_APP_DIR}/build )
|
|
|
|
set ( datarootdir ${prefix}/assets )
|
2016-09-09 04:21:15 +01:00
|
|
|
else()
|
2016-11-08 07:37:36 +00:00
|
|
|
set ( prefix "${CMAKE_INSTALL_PREFIX}")
|
2016-11-16 23:15:12 +00:00
|
|
|
set ( datarootdir ${prefix}/share )
|
2016-09-09 04:21:15 +01:00
|
|
|
endif()
|
2016-11-24 04:35:39 +00:00
|
|
|
set ( libpl ${datarootdir}/Yap)
|
2016-11-16 23:15:12 +00:00
|
|
|
set ( includedir "${prefix}/include")
|
2016-11-08 07:37:36 +00:00
|
|
|
set ( exec_prefix "${prefix}")
|
|
|
|
set ( libdir "${exec_prefix}/lib")
|
2016-07-31 17:35:57 +01:00
|
|
|
set ( datadir "${datarootdir}")
|
|
|
|
set ( mandir "${datarootdir}/man")
|
|
|
|
set ( bindir "${exec_prefix}/bin")
|
2016-11-24 04:35:39 +00:00
|
|
|
set ( docdir "${datarootdir}/doc/Yap")
|
2017-02-20 15:28:46 +00:00
|
|
|
set ( dlls "${exec_prefix}/lib/Yap")
|
2016-07-31 17:35:57 +01:00
|
|
|
|
|
|
|
set(YAP_ROOTDIR ${prefix})
|
|
|
|
|
|
|
|
# erootdir -> rootdir
|
|
|
|
# bindir defined above
|
|
|
|
# libdir defined above
|
|
|
|
set(YAP_LIBDIR "${dlls}")
|
|
|
|
set(YAP_SHAREDIR "${datarootdir}")
|
|
|
|
set(YAP_BINDIR "${bindir}")
|
|
|
|
set(YAP_INCLUDEDIR "${includedir}")
|
|
|
|
set(YAP_ROOTDIR "${prefix}")
|
|
|
|
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# include( Sources NO_POLICY_SCOPE )
|
|
|
|
#
|
|
|
|
# include( Model NO_POLICY_SCOPE )
|
2016-10-16 23:18:51 +01:00
|
|
|
|
|
|
|
include (cudd NO-POLICY-SCOPE)
|
|
|
|
include (java NO-POLICY-SCOPE)
|
2017-05-02 07:41:55 +01:00
|
|
|
|
|
|
|
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" )
|
|
|
|
|