| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
# set the plugin name here |
| 5 |
set( PLUGIN_NAME "CodeFormatter") |
| 6 |
|
| 7 |
# Our project is called 'plugin' this is how it will be called in |
| 8 |
# visual studio, and in our makefiles. |
| 9 |
project( ${PLUGIN_NAME} ) |
| 10 |
|
| 11 |
# It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'. |
| 12 |
|
| 13 |
|
| 14 |
# wxWidgets include (this will do all the magic to configure everything) |
| 15 |
include( "${wxWidgets_USE_FILE}" ) |
| 16 |
|
| 17 |
# Include paths |
| 18 |
include_directories("${CL_SRC_ROOT}/Plugin" "${CL_SRC_ROOT}/sdk/wxsqlite3/include" "${CL_SRC_ROOT}/CodeLite" "${CL_SRC_ROOT}/PCH" "${CL_SRC_ROOT}/Interfaces") |
| 19 |
|
| 20 |
add_definitions(-DWXUSINGDLL_WXSQLITE3) |
| 21 |
add_definitions(-DWXUSINGDLL_CL) |
| 22 |
add_definitions(-DWXUSINGDLL_SDK) |
| 23 |
add_definitions(-DASTYLE_LIB) |
| 24 |
|
| 25 |
if ( USE_PCH AND NOT MINGW ) |
| 26 |
add_definitions(-include "${CL_PCH_FILE}") |
| 27 |
add_definitions(-Winvalid-pch) |
| 28 |
endif() |
| 29 |
|
| 30 |
if (UNIX AND NOT APPLE) |
| 31 |
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" ) |
| 32 |
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" ) |
| 33 |
endif() |
| 34 |
|
| 35 |
if ( APPLE ) |
| 36 |
add_definitions(-fPIC) |
| 37 |
endif() |
| 38 |
|
| 39 |
FILE(GLOB SRCS "*.cpp") |
| 40 |
|
| 41 |
# Define the output |
| 42 |
add_library(${PLUGIN_NAME} SHARED ${SRCS}) |
| 43 |
|
| 44 |
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH) |
| 45 |
|
| 46 |
# Remove the "lib" prefix from the plugin name |
| 47 |
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") |
| 48 |
target_link_libraries(${PLUGIN_NAME} |
| 49 |
${LINKER_OPTIONS} |
| 50 |
${wxWidgets_LIBRARIES} |
| 51 |
libcodelite |
| 52 |
plugin |
| 53 |
) |
| 54 |
|
| 55 |
|
| 56 |
CL_INSTALL_PLUGIN(${PLUGIN_NAME}) |
| 57 |
CL_INSTALL_FILE_SHARED(${CL_SRC_ROOT}/Runtime/astyle.sample) |
| 58 |
CL_INSTALL_FILE_SHARED(${CL_SRC_ROOT}/Runtime/php.sample) |
| 59 |
|
| 60 |
if(MINGW) |
| 61 |
# install clang-format |
| 62 |
msys_install_clang64_tool(clang-format.exe ${CL_INSTALL_BIN}) |
| 63 |
endif() |