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
|
|
|
|
|
|
|
if (ANDROID)
|
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()
|
|
|
|
|
|
|
|
|
|
|
|
if (ANDROID)
|
2016-09-09 04:21:15 +01:00
|
|
|
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()
|
2016-07-31 17:35:57 +01:00
|
|
|
else()
|
|
|
|
macro ( add_component arg1 )
|
2016-09-09 04:21:15 +01:00
|
|
|
add_library ( ${arg1} OBJECT ${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
macro ( add_external arg1 )
|
2016-09-09 04:21:15 +01:00
|
|
|
add_library ( ${arg1} SHARED ${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (ANDROID)
|
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()
|
|
|
|
|
|
|
|
if (ANDROID)
|
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()
|
|
|
|
|
|
|
|
if (ANDROID)
|
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()
|
|
|
|
|
|
|
|
if (ANDROID)
|
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()
|
|
|
|
|
|
|
|
if (ANDROID)
|
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()
|
|
|
|
|
|
|
|
|
|
|
|
#cross-compilation support
|
|
|
|
# Search packages for host system instead of packages for target system
|
|
|
|
# in case of cross compilation these macro should be defined by toolchain file
|
|
|
|
if(NOT COMMAND find_host_package)
|
2016-09-09 04:21:15 +01:00
|
|
|
macro(find_host_package)
|
|
|
|
find_package(${ARGN})
|
|
|
|
endmacro()
|
2016-07-31 17:35:57 +01:00
|
|
|
endif()
|
|
|
|
if(NOT COMMAND find_host_program)
|
2016-09-09 04:21:15 +01:00
|
|
|
macro(find_host_program)
|
|
|
|
find_program(${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)
|
|
|
|
|
|
|
|
|
|
|
|
set ( prefix "${CMAKE_INSTALL_PREFIX}")
|
|
|
|
set ( exec_prefix "${prefix}")
|
|
|
|
set ( libdir "${exec_prefix}/lib")
|
|
|
|
set ( dlls "${exec_prefix}/lib/Yap")
|
|
|
|
set ( includedir "${prefix}/include")
|
|
|
|
set ( datarootdir "${prefix}/share")
|
2016-09-09 04:21:15 +01:00
|
|
|
if (ANDROID)
|
|
|
|
set ( libpl "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/../../../../../build/generated/assets/Yap")
|
|
|
|
else()
|
|
|
|
set ( libpl "${datarootdir}/Yap")
|
|
|
|
|
|
|
|
endif()
|
2016-07-31 17:35:57 +01:00
|
|
|
set ( datadir "${datarootdir}")
|
|
|
|
set ( mandir "${datarootdir}/man")
|
|
|
|
set ( bindir "${exec_prefix}/bin")
|
2016-09-09 04:21:15 +01:00
|
|
|
set ( docdir "${exec_prefix}/doc/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 (python NO-POLICY-SCOPE)
|
|
|
|
include (java NO-POLICY-SCOPE)
|
|
|
|
|