diff --git a/Prelims.cmake b/Prelims.cmake index df0fc3ea9..55e7c1341 100644 --- a/Prelims.cmake +++ b/Prelims.cmake @@ -4,104 +4,104 @@ include (MacroLogFeature) if (POLICY CMP0042) - cmake_policy( SET CMP0042 NEW) + cmake_policy( SET CMP0042 NEW) endif() if (ANDROID) - macro ( MY_add_custom_target) -endmacro() + macro ( MY_add_custom_target) + endmacro() else() macro ( MY_add_custom_target ) - add_custom_target (${ARGN}) -endmacro() + add_custom_target (${ARGN}) + endmacro() endif() if (ANDROID) - 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() + 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() else() macro ( add_component arg1 ) - add_library ( ${arg1} OBJECT ${ARGN}) -endmacro() + add_library ( ${arg1} OBJECT ${ARGN}) + endmacro() macro ( add_external arg1 ) - add_library ( ${arg1} SHARED ${ARGN}) -endmacro() + add_library ( ${arg1} SHARED ${ARGN}) + endmacro() endif() if (ANDROID) - macro ( MY_add_dependencies) -endmacro() + macro ( MY_add_dependencies) + endmacro() else() macro ( MY_add_dependencies ) - add_dependencies (${ARGN}) -endmacro() + add_dependencies (${ARGN}) + endmacro() endif() if (ANDROID) - macro ( MY_add_library) -endmacro() + macro ( MY_add_library) + endmacro() else() macro ( MY_add_library ) - add_library (${ARGN}) -endmacro() + add_library (${ARGN}) + endmacro() endif() if (ANDROID) - macro ( MY_add_subdirectory) -endmacro() + macro ( MY_add_subdirectory) + endmacro() else() macro ( MY_add_subdirectory ) - add_subdirectory (${ARGN}) -endmacro() + add_subdirectory (${ARGN}) + endmacro() endif() if (ANDROID) - macro ( MY_include) -endmacro() + macro ( MY_include) + endmacro() else() macro ( MY_include ) - include (${ARGN}) -endmacro() + include (${ARGN}) + endmacro() endif() if (ANDROID) - macro ( MY_install) -endmacro() + macro ( MY_install) + endmacro() else() macro ( MY_install ) - install (${ARGN}) -endmacro() + install (${ARGN}) + endmacro() endif() if (ANDROID) - macro ( MY_set_target_properties) -endmacro() + macro ( MY_set_target_properties) + endmacro() else() macro ( MY_set_target_properties ) - set_target_properties (${ARGN}) -endmacro() + set_target_properties (${ARGN}) + endmacro() endif() if (ANDROID) - macro ( MY_target_link_libraries) -endmacro() + macro ( MY_target_link_libraries) + endmacro() else() macro ( MY_target_link_libraries ) - target_link_libraries (${ARGN}) -endmacro() + target_link_libraries (${ARGN}) + endmacro() endif() @@ -109,14 +109,14 @@ endif() # 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) - macro(find_host_package) - find_package(${ARGN}) - endmacro() + macro(find_host_package) + find_package(${ARGN}) + endmacro() endif() if(NOT COMMAND find_host_program) - macro(find_host_program) - find_program(${ARGN}) - endmacro() + macro(find_host_program) + find_program(${ARGN}) + endmacro() endif() # where we have most scripts @@ -131,13 +131,13 @@ disallow_intree_builds() # set(CMAKE_BUILD_TYPE Debug) if (APPLE) -set (MACOSX_RPATH ON) + set (MACOSX_RPATH ON) endif (APPLE ) if(POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) + cmake_policy(SET CMP0042 NEW) endif(POLICY CMP0042) if(POLICY CMP0043) -cmake_policy(SET CMP0043 NEW) + cmake_policy(SET CMP0043 NEW) endif(POLICY CMP0043) @@ -147,11 +147,16 @@ set ( libdir "${exec_prefix}/lib") set ( dlls "${exec_prefix}/lib/Yap") set ( includedir "${prefix}/include") set ( datarootdir "${prefix}/share") -set ( libpl "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/../../../../../build/generated/assets/share/Yap") +if (ANDROID) + set ( libpl "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/../../../../../build/generated/assets/Yap") +else() + set ( libpl "${datarootdir}/Yap") + +endif() set ( datadir "${datarootdir}") set ( mandir "${datarootdir}/man") set ( bindir "${exec_prefix}/bin") -set ( docdir "${exec_prefix}/share/doc/Yap") +set ( docdir "${exec_prefix}/doc/Yap") set(YAP_ROOTDIR ${prefix})