############################################################################ # CMakeLists.txt file for building ROOT (global) core package ############################################################################ add_subdirectory(rint) add_subdirectory(thread) add_subdirectory(multiproc) if(NOT WIN32) add_subdirectory(newdelete) endif() add_subdirectory(clib) add_subdirectory(cont) add_subdirectory(textinput) add_subdirectory(metautils) add_subdirectory(meta) set(systemdict_opts) if(UNIX) add_subdirectory(unix) set(unix_objects $) set(dict_opts -DSYSTEM_TYPE_unix ${dict_opts}) endif() if(WIN32) add_subdirectory(winnt) set(winnt_objects $) set(dict_opts -DSYSTEM_TYPE_winnt ${dict_opts}) endif() if(cocoa) add_subdirectory(macosx) set(macosx_objects $) set(dict_opts -DSYSTEM_TYPE_macosx ${dict_opts}) endif() add_subdirectory(zip) add_subdirectory(lzma) add_subdirectory(base) set(objectlibs $ $ $ $ $ $ $ $ ${macosx_objects} ${unix_objects} ${winnt_objects}) #---Generation of RGitCommit.h----------------------------------------------------------- foreach(exp ${objectlibs}) string(REGEX REPLACE "^[$]" "\\1" lib ${exp}) get_target_property(objs ${lib} OBJECTS) list(APPEND dep_objects ${objs}) list(APPEND dep_targets ${lib}) endforeach() add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/include/RGitCommit.h COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp ${CMAKE_BINARY_DIR}/include/RGitCommit.h COMMENT "" DEPENDS ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) if(WIN32) add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp COMMAND ${CMAKE_SOURCE_DIR}/build/win/gitinfo.bat ${CMAKE_SOURCE_DIR} COMMAND ${CMAKE_SOURCE_DIR}/build/win/githeader.bat RGitCommit.h.tmp COMMENT "Recording the git revision now" DEPENDS ${dep_objects} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) else() add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp COMMAND ${CMAKE_SOURCE_DIR}/build/unix/gitinfo.sh ${CMAKE_SOURCE_DIR} COMMAND ${CMAKE_SOURCE_DIR}/build/unix/githeader.sh RGitCommit.h.tmp COMMENT "Recording the git revision now" DEPENDS ${dep_objects} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) endif() add_custom_target(gitcommit ALL DEPENDS ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp) set_source_files_properties(${CMAKE_BINARY_DIR}/RGitCommit.h.tmp PROPERTIES GENERATED TRUE) add_dependencies(gitcommit ${dep_targets}) set_source_files_properties(${CMAKE_BINARY_DIR}/include/RGitCommit.h PROPERTIES GENERATED TRUE HEADER_FILE_ONLY TRUE) ROOT_OBJECT_LIBRARY(BaseTROOT ${CMAKE_SOURCE_DIR}/core/base/src/TROOT.cxx ${CMAKE_BINARY_DIR}/include/RGitCommit.h) add_dependencies(BaseTROOT gitcommit) install(FILES ${CMAKE_BINARY_DIR}/include/RGitCommit.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) #---------------------------------------------------------------------------------------- if(WIN32) set(corelinklibs shell32.lib WSock32.lib Oleaut32.lib Iphlpapi.lib) elseif(APPLE) if(cocoa) set(corelinklibs "-framework Cocoa -F/System/Library/PrivateFrameworks -framework CoreSymbolication") else() set(corelinklibs "-F/System/Library/PrivateFrameworks -framework CoreSymbolication") endif() endif() add_subdirectory(utils) #------------------------------------------------------------------------------- ROOT_LINKER_LIBRARY(Core $ ${objectlibs} LIBRARIES ${PCRE_LIBRARIES} ${LZMA_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${corelinklibs} ) if(cling) add_dependencies(Core CLING) endif() if(builtin_pcre) ROOT_ADD_BUILTIN_DEPENDENCIES(Core PCRE) endif() if(builtin_lzma) ROOT_ADD_BUILTIN_DEPENDENCIES(Core LZMA) endif() #----------------------------------------------------------------------------------------