Skip to content

Commit

Permalink
register: CMake as a language in CodeLite and associate it with the f…
Browse files Browse the repository at this point in the history
…ile type `TypeCMake`

fixed: syntax error in codelite-cli `CMakeLists.txt`
  • Loading branch information
eranif committed Jan 6, 2023
1 parent 1b37817 commit 62cddde
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 43 deletions.
29 changes: 13 additions & 16 deletions CallGraph/CMakeLists.txt
@@ -1,39 +1,36 @@



# set the plugin name here
set( PLUGIN_NAME "CallGraph")
set(PLUGIN_NAME "CallGraph")

# Our project is called 'plugin' this is how it will be called in
# visual studio, and in our makefiles.
project( ${PLUGIN_NAME} )
# Our project is called 'plugin' this is how it will be called in visual studio, and in our makefiles.
project(${PLUGIN_NAME})

# It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'.


# wxWidgets include (this will do all the magic to configure everything)
include( "${wxWidgets_USE_FILE}" )
include("${wxWidgets_USE_FILE}")

# Include paths
include_directories("${CL_SRC_ROOT}/Plugin" "${CL_SRC_ROOT}/sdk/wxsqlite3/include" "${CL_SRC_ROOT}/CodeLite" "${CL_SRC_ROOT}/PCH" "${CL_SRC_ROOT}/Interfaces")
include_directories("${CL_SRC_ROOT}/Plugin" "${CL_SRC_ROOT}/sdk/wxsqlite3/include" "${CL_SRC_ROOT}/CodeLite"
"${CL_SRC_ROOT}/PCH" "${CL_SRC_ROOT}/Interfaces")

add_definitions(-DWXUSINGDLL_WXSQLITE3)
add_definitions(-DWXUSINGDLL_CL)
add_definitions(-DWXUSINGDLL_SDK)

if ( USE_PCH )
if(USE_PCH)
add_definitions(-include "${CL_PCH_FILE}")
add_definitions(-Winvalid-pch)
endif ( USE_PCH )
endif(USE_PCH)

FILE(GLOB SRCS "*.cpp")
file(GLOB SRCS "*.cpp")

if (UNIX AND NOT APPLE)
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
if(UNIX AND NOT APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()

if ( APPLE )
if(APPLE)
add_definitions(-fPIC)
endif()

Expand Down
1 change: 1 addition & 0 deletions CodeLite/fileextmanager.cpp
Expand Up @@ -208,6 +208,7 @@ void FileExtManager::Init()
m_language_bundle.insert({ "Javascript/Typescript", { TypeJS } });
m_language_bundle.insert({ "Python", { TypePython } });
m_language_bundle.insert({ "PHP", { TypePhp } });
m_language_bundle.insert({ "CMake", { TypeCMake } });

// build the reverse search table: file type -> language
for(auto vt : m_language_bundle) {
Expand Down
53 changes: 26 additions & 27 deletions codelite-cli/CMakeLists.txt
@@ -1,5 +1,4 @@


set(CL_SRC_ROOT "${CMAKE_CURRENT_LIST_DIR}/..")

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CL_SRC_ROOT}/cmake/Modules/")
Expand All @@ -8,8 +7,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/lib")

# Our project is called 'codelite' this is how it will be called in
# visual studio, and in our makefiles.
# Our project is called 'codelite' this is how it will be called in visual studio, and in our makefiles.
project(codelite-cli)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

Expand All @@ -25,33 +23,38 @@ endif()

if(NOT CL_WX_CONFIG)
set(CL_WX_CONFIG "wx-config")
endif
endif()

# we need wxWidgets flags to be set only for the c++ files, so we do it like this
# by setting the CMAKE_CXX_FLAGS
# we need wxWidgets flags to be set only for the c++ files, so we do it like this by setting the CMAKE_CXX_FLAGS
if(NOT MINGW)
execute_process(COMMAND ${CL_WX_CONFIG} --cxxflags OUTPUT_VARIABLE WX_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND ${CL_WX_CONFIG} --cxxflags
OUTPUT_VARIABLE WX_CXX_FLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
execute_process(COMMAND sh ${CL_WX_CONFIG} --cxxflags OUTPUT_VARIABLE WX_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND sh ${CL_WX_CONFIG} --cxxflags
OUTPUT_VARIABLE WX_CXX_FLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WX_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WX_CXX_FLAGS}")
message("${WX_CXX_FLAGS}")

# prepare list of files
FILE(GLOB CODELITELIB_SRCS
"${CL_SRC_ROOT}/CodeLite/SocketAPI/*.cpp"
"${CL_SRC_ROOT}/sdk/wxsqlite3/src/*.cpp"
"${CL_SRC_ROOT}/CodeLite/*.c"
"${CL_SRC_ROOT}/CodeLite/*.cpp"
"${CL_SRC_ROOT}/sdk/codelite_indexer/network/*.cpp"
"${CL_SRC_ROOT}/codelite-cli/sqlite3.c"
)

FILE(GLOB CODELITESERVER_SRCS "*.cpp")
file(
GLOB
CODELITELIB_SRCS
"${CL_SRC_ROOT}/CodeLite/SocketAPI/*.cpp"
"${CL_SRC_ROOT}/sdk/wxsqlite3/src/*.cpp"
"${CL_SRC_ROOT}/CodeLite/*.c"
"${CL_SRC_ROOT}/CodeLite/*.cpp"
"${CL_SRC_ROOT}/sdk/codelite_indexer/network/*.cpp"
"${CL_SRC_ROOT}/codelite-cli/sqlite3.c")

file(GLOB CODELITESERVER_SRCS "*.cpp")

# and finally prepare list of includes directories
include_directories("${CL_SRC_ROOT}/sdk/wxsqlite3/include"
"${CL_SRC_ROOT}/CodeLite"
include_directories("${CL_SRC_ROOT}/sdk/wxsqlite3/include" "${CL_SRC_ROOT}/CodeLite"
"${CL_SRC_ROOT}/sdk/codelite_indexer/network")

# Define the output
Expand All @@ -66,9 +69,5 @@ if(UNIX)
set(UTIL_LIB "-lutil -ldl")
endif(UNIX)

target_link_libraries(codelite-cli
codelitelib
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
${UTIL_LIB})
#add_subdirectory(codelite-client)
target_link_libraries(codelite-cli codelitelib ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} ${UTIL_LIB})
# add_subdirectory(codelite-client)

0 comments on commit 62cddde

Please sign in to comment.