CMakeLists.txt 2.59 KB
Newer Older
1 2
find_package(Kumir2 REQUIRED)
# find_package(Llvm)
3

4
# Query for version info and pass it as compile definitions
Victor Yacovlev's avatar
Victor Yacovlev committed
5 6 7 8
if(EXISTS "${CMAKE_SOURCE_DIR}/version_info.cmake")
    include(${CMAKE_SOURCE_DIR}/version_info.cmake)

    add_definitions(-DGIT_HASH=\"${GIT_HASH}\")
Victor Yacovlev's avatar
Victor Yacovlev committed
9
    add_definitions(-DGIT_TIMESTAMP=\"${GIT_TIMESTAMP}\")
Victor Yacovlev's avatar
Victor Yacovlev committed
10 11
    add_definitions(-DGIT_TAG=\"${GIT_TAG}\")
    add_definitions(-DGIT_BRANCH=\"${GIT_BRANCH}\")
Victor Yacovlev's avatar
Victor Yacovlev committed
12 13 14 15 16 17 18 19 20 21 22 23 24
    message(STATUS "File-provided version info: HASH=${GIT_HASH}")
    message(STATUS "File-provided version info: TIMESTAMP=${GIT_TIMESTAMP}")
    message(STATUS "File-provided version info: TAG=${GIT_TAG}")
    message(STATUS "File-provided version info: BRANCH=${GIT_BRANCH}")
elseif(PROVIDED_VERSION_INFO)
    add_definitions(-DGIT_HASH=\"${GIT_HASH}\")
    add_definitions(-DGIT_TIMESTAMP=\"${GIT_TIMESTAMP}\")
    add_definitions(-DGIT_TAG=\"${GIT_TAG}\")
    add_definitions(-DGIT_BRANCH=\"${GIT_BRANCH}\")
    message(STATUS "Variable-provided version info: HASH=${GIT_HASH}")
    message(STATUS "Variable-provided version info: TIMESTAMP=${GIT_TIMESTAMP}")
    message(STATUS "Variable-provided version info: TAG=${GIT_TAG}")
    message(STATUS "Variable-provided version info: BRANCH=${GIT_BRANCH}")
25
else()
Victor Yacovlev's avatar
Victor Yacovlev committed
26 27 28 29 30 31
    execute_process(
        COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/scripts/query_version_info.py" "--mode=cmake_version_info"
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
        OUTPUT_VARIABLE VERSION_DEFINITIONS
    )
    add_definitions(${VERSION_DEFINITIONS})
32
    message(STATUS "Queried version info from git: ${VERSION_DEFINITIONS}")
33 34
endif()

denis's avatar
denis committed
35
#if(NOT APPLE)
36
    # Various GUI configurations
37

38
    add_opt_subdirectory(kumir2-classic)
39 40 41
    add_opt_subdirectory(kumir2-highgrade)
    add_opt_subdirectory(kumir2-ide)
    add_opt_subdirectory(kumir2-teacher)
42
    #add_opt_subdirectory(kumir2-checkcourse)
43

44 45
    # Check if Python present in this git branch and Python3 libraries found
    if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-python")
46 47
        add_opt_subdirectory(kumir2-python)
        add_opt_subdirectory(kumir2-python-teacher)
48
    endif() # kumir2-python exists
49

denis's avatar
denis committed
50
#endif(NOT APPLE)
victor's avatar
 
victor committed
51

denis's avatar
denis committed
52
#if(APPLE)
53
    # Apple platform has exact one GUI configuration
denis's avatar
denis committed
54 55
  #  add_opt_subdirectory(kumir2-macx)
#endif(APPLE)
victor's avatar
 
victor committed
56

57 58
add_opt_subdirectory(kumir2-bc)
add_opt_subdirectory(kumir2-xrun)
59

60
# kumir2-llvmc is optional in case if LLVM libraries present
61 62 63 64 65 66 67
#if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-llvmc")
#    if(Llvm_FOUND)
#        add_opt_subdirectory(kumir2-llvmc)
#    else()
#        message(WARNING "LLVM developer libraries not found, building of LLVM support disabled")
#    endif(Llvm_FOUND)
#endif()