Browse Source

Fix imports

merge-requests/365/head
Jørgen Lien Sellæg 11 years ago
parent
commit
03461615de
  1. 49
      juci/CMakeLists.txt
  2. 82
      juci/cmake/Modules/FindLibClang.cmake
  3. 12
      juci/cmake/Modules/FindLibClangmm.cmake

49
juci/CMakeLists.txt

@ -3,7 +3,6 @@ set(project_name juci)
set(module juci_to_python_api) set(module juci_to_python_api)
project (${project_name}) project (${project_name})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/")
@ -15,8 +14,22 @@ message("Searcing for libclang")
#LIBCLANG_LIBRARIES The libraries needed to use libclang. #LIBCLANG_LIBRARIES The libraries needed to use libclang.
#LIBCLANG_LIBRARY_DIR The path to the directory containing libclang. #LIBCLANG_LIBRARY_DIR The path to the directory containing libclang.
#LIBCLANG_KNOWN_LLVM_VERSIONS Known LLVM release numbers. #LIBCLANG_KNOWN_LLVM_VERSIONS Known LLVM release numbers.
find_package(Testlcl) find_package(LibClangmm)
find_package(LibClang)
if(${LCL_FOUND})
message("libclangmm libraries found. Continuing")
message("${LCL_INCLUDE_DIRS}")
else()
message(FATAL_ERROR "The libclangmm libraries are required. Quitting.")
endif()
if(${LIBCLANG_FOUND})
message("libclangmm libraries found. Continuing")
message("${LIBCLANG_INCLUDE_DIRS}")
else()
message(FATAL_ERROR "The libclangmm libraries are required. Quitting.")
endif()
#### Finding boost, the variables below is set ##### #### Finding boost, the variables below is set #####
#PYTHONLIBS_FOUND - True if headers and requested libraries were found #PYTHONLIBS_FOUND - True if headers and requested libraries were found
@ -73,16 +86,22 @@ endif()
add_executable(${project_name} add_executable(${project_name}
#list of every needed file to create the executable #list of every needed file to create the executable
juci.cc juci.cc
keybindings keybindings.h
menu keybindings.cc
source menu.h
menu.cc
source.h
source.cc
sourcefile.h sourcefile.h
sourcefile.cc sourcefile.cc
window window.cc
api window.h
notebook api.h
entry api.cc
notebook.cc
notebook.h
entry.h
entry.cc
#there is no need for extentions #there is no need for extentions
) )
@ -92,29 +111,25 @@ add_library(${module} SHARED
) )
# dependencies # dependencies
if(${lcl_NOTFOUND})
message("FATAL_ERROR ohh lord!")
else()
message("Found libs!")
endif()
include_directories( include_directories(
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
${GTKMM_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}
${LCL_INCLUDE_DIRS} ${LCL_INCLUDE_DIRS}
${LIBCLANG_INCLUDE_DIRS}
) )
link_directories( link_directories(
${GTKMM_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS}
${Boost_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS}
${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}
${LCL_LIBRARY_DIRS} ${LCL_LIBRARY_DIRS}
${LIBCLANG_LIBRARY_DIRS}
) )
#module: #module:
set_target_properties(${module} PROPERTIES PREFIX "" set_target_properties(${module} PROPERTIES PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "/usr/lib/python2.7/dist-packages/") LIBRARY_OUTPUT_DIRECTORY "/usr/lib/python2.7/dist-packages/")
target_link_libraries(${module} ${PYTHON_LIBRARIES} ${Boost_LIBRARIES}) target_link_libraries(${module} ${PYTHON_LIBRARIES} ${Boost_LIBRARIES})
#executable: #executable:
target_link_libraries(${project_name} ${LCL_LIBRARIES} ${GTKMM_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES}) target_link_libraries(${project_name} ${LIVCLANG_LIBRARIES} ${LCL_LIBRARIES} ${GTKMM_LIBRARIES} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})

82
juci/cmake/Modules/FindLibClang.cmake

@ -0,0 +1,82 @@
#
# Try to find libclang
#
# Once done this will define:
# - LIBCLANG_FOUND
# System has libclang.
# - LIBCLANG_INCLUDE_DIRS
# The libclang include directories.
# - LIBCLANG_LIBRARIES
# The libraries needed to use libclang.
# - LIBCLANG_LIBRARY_DIR
# The path to the directory containing libclang.
# - LIBCLANG_KNOWN_LLVM_VERSIONS
# Known LLVM release numbers.
# most recent versions come first
set(LIBCLANG_KNOWN_LLVM_VERSIONS 3.6
3.5.1
3.5.0 #Arch Linux
3.5 #LLVM Debian/Ubuntu packages from http://llvm.org/apt/
3.4.2 3.4.1 3.4 3.3 3.2 3.1)
set(libclang_llvm_header_search_paths)
set(libclang_llvm_lib_search_paths
# LLVM Fedora
/usr/lib/llvm
)
foreach (version ${LIBCLANG_KNOWN_LLVM_VERSIONS})
list(APPEND libclang_llvm_header_search_paths
# LLVM Debian/Ubuntu nightly packages: http://llvm.org/apt/
"/usr/lib/llvm-${version}/include"
# LLVM MacPorts
"/opt/local/libexec/llvm-${version}/include"
# LLVM Homebrew
"/usr/local/Cellar/llvm/${version}/include"
# LLVM Homebrew/versions
"/usr/local/lib/llvm-${version}/include"
)
list(APPEND libclang_llvm_lib_search_paths
# LLVM Debian/Ubuntu nightly packages: http://llvm.org/apt/
"/usr/lib/llvm-${version}/lib/"
# LLVM MacPorts
"/opt/local/libexec/llvm-${version}/lib"
# LLVM Homebrew
"/usr/local/Cellar/llvm/${version}/lib"
# LLVM Homebrew/versions
"/usr/local/lib/llvm-${version}/lib"
)
endforeach()
find_path(LIBCLANG_INCLUDE_DIR clang-c/Index.h
PATHS ${libclang_llvm_header_search_paths}
PATH_SUFFIXES LLVM/include #Windows package from http://llvm.org/releases/
DOC "The path to the directory that contains clang-c/Index.h")
# On Windows with MSVC, the import library uses the ".imp" file extension
# instead of the comon ".lib"
if (MSVC)
find_file(LIBCLANG_LIBRARY libclang.imp
PATH_SUFFIXES LLVM/lib
DOC "The file that corresponds to the libclang library.")
endif()
find_library(LIBCLANG_LIBRARY NAMES libclang.imp libclang clang
PATHS ${libclang_llvm_lib_search_paths}
PATH_SUFFIXES LLVM/lib #Windows package from http://llvm.org/releases/
DOC "The file that corresponds to the libclang library.")
get_filename_component(LIBCLANG_LIBRARY_DIR ${LIBCLANG_LIBRARY} PATH)
set(LIBCLANG_LIBRARIES ${LIBCLANG_LIBRARY})
set(LIBCLANG_INCLUDE_DIRS ${LIBCLANG_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBCLANG_FOUND to TRUE if
# all listed variables are TRUE
find_package_handle_standard_args(LibClang DEFAULT_MSG
LIBCLANG_LIBRARY LIBCLANG_INCLUDE_DIR)
mark_as_advanced(LIBCLANG_INCLUDE_DIR LIBCLANG_LIBRARY)

12
juci/cmake/Modules/FindTestlcl.cmake → juci/cmake/Modules/FindLibClangmm.cmake

@ -9,16 +9,12 @@
find_package(PkgConfig) find_package(PkgConfig)
find_path(LCL_INCLUDE_DIR headers/TranslationUnit.h find_path(LCL_INCLUDE_DIR clangmm.h
HINTS "/home/gm/bachelor/lib/" HINTS "/usr/lib/libclangmm/include/"
"/home/forgie/code/libclangpp/"
"/home/zalox/bachelor/libclang++/"
) )
find_library(LCL_LIBRARY NAMES testlcl find_library(LCL_LIBRARY NAMES clangmm
HINTS "/home/gm/bachelor/lib/lib/" HINTS "/usr/lib/libclangmm/"
"/home/forgie/code/libclangpp/lib/"
"/home/zalox/bachelor/libclang++/lib/"
) )
set(LCL_LIBRARIES ${LCL_LIBRARY} ) set(LCL_LIBRARIES ${LCL_LIBRARY} )
Loading…
Cancel
Save