diff --git a/AutoSave/CMakeLists.txt b/AutoSave/CMakeLists.txt index 435916bfab..831d51b13e 100644 --- a/AutoSave/CMakeLists.txt +++ b/AutoSave/CMakeLists.txt @@ -24,7 +24,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Use CodeLite's macro: CL_INSTALL_PLUGIN which handles both OSX and Linux installation cl_install_plugin(${PLUGIN_NAME}) diff --git a/CMakePlugin/CMakeLists.txt b/CMakePlugin/CMakeLists.txt index f4f0d8cada..394e85870f 100644 --- a/CMakePlugin/CMakeLists.txt +++ b/CMakePlugin/CMakeLists.txt @@ -37,6 +37,6 @@ endif() # Codelite plugins doesn't use the "lib" prefix. set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/CallGraph/CMakeLists.txt b/CallGraph/CMakeLists.txt index 644cb5b2d9..3cd6adc052 100644 --- a/CallGraph/CMakeLists.txt +++ b/CallGraph/CMakeLists.txt @@ -25,7 +25,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} -L"${CL_LIBPATH}" libcodelite plugin) # Make sure that the plugin will not start build before 'plugin.so' is ready add_dependencies(${PLUGIN_NAME} plugin) diff --git a/ChatAI/CMakeLists.txt b/ChatAI/CMakeLists.txt index 743305561d..2ef3c93a88 100644 --- a/ChatAI/CMakeLists.txt +++ b/ChatAI/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/CodeFormatter/CMakeLists.txt b/CodeFormatter/CMakeLists.txt index 7c5106069d..35443f1f57 100644 --- a/CodeFormatter/CMakeLists.txt +++ b/CodeFormatter/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/CodeLite/CMakeLists.txt b/CodeLite/CMakeLists.txt index 537fea7fc7..33243ea849 100644 --- a/CodeLite/CMakeLists.txt +++ b/CodeLite/CMakeLists.txt @@ -12,35 +12,34 @@ if(UNIX AND NOT APPLE) endif(UNIX AND NOT APPLE) # Flex files -FLEX_TARGET(CxxFlex "${CMAKE_SOURCE_DIR}/CodeLite/Cxx/CxxScanner.l" "${CMAKE_CURRENT_BINARY_DIR}/CxxScanner.cpp" +flex_target(CxxFlex "${CMAKE_SOURCE_DIR}/CodeLite/Cxx/CxxScanner.l" "${CMAKE_CURRENT_BINARY_DIR}/CxxScanner.cpp" COMPILE_FLAGS "--noline --yylineno --batch") -FLEX_TARGET(IncludeFinderFlex "${CMAKE_SOURCE_DIR}/CodeLite/Cxx/include_finder.l" "${CMAKE_CURRENT_BINARY_DIR}/include_finder.cpp" - COMPILE_FLAGS "-Pinclf_ --noline --yylineno --batch") -FLEX_TARGET(PhpFlex "${CMAKE_SOURCE_DIR}/CodeLite/PHP/PhpLexer.l" "${CMAKE_CURRENT_BINARY_DIR}/PhpLexer.cpp" +flex_target(IncludeFinderFlex "${CMAKE_SOURCE_DIR}/CodeLite/Cxx/include_finder.l" + "${CMAKE_CURRENT_BINARY_DIR}/include_finder.cpp" COMPILE_FLAGS "-Pinclf_ --noline --yylineno --batch") +flex_target(PhpFlex "${CMAKE_SOURCE_DIR}/CodeLite/PHP/PhpLexer.l" "${CMAKE_CURRENT_BINARY_DIR}/PhpLexer.cpp" COMPILE_FLAGS "-Pphp --noline --yylineno --batch") -FLEX_TARGET(XmlFlex "${CMAKE_SOURCE_DIR}/CodeLite/XML/XMLLexer.l" "${CMAKE_CURRENT_BINARY_DIR}/XmlLexer.cpp" +flex_target(XmlFlex "${CMAKE_SOURCE_DIR}/CodeLite/XML/XMLLexer.l" "${CMAKE_CURRENT_BINARY_DIR}/XmlLexer.cpp" COMPILE_FLAGS "-Pxml --noline --yylineno --batch") -set(FlexSrcs "${FLEX_CxxFlex_OUTPUTS}" "${FLEX_IncludeFinderFlex_OUTPUTS}" "${FLEX_PhpFlex_OUTPUTS}" "${FLEX_XmlFlex_OUTPUTS}") +set(FlexSrcs "${FLEX_CxxFlex_OUTPUTS}" "${FLEX_IncludeFinderFlex_OUTPUTS}" "${FLEX_PhpFlex_OUTPUTS}" + "${FLEX_XmlFlex_OUTPUTS}") file(GLOB_RECURSE SRCS "*.cpp" "*.h" "*.hpp") add_library(libcodelite SHARED ${SRCS} ${FlexSrcs}) # Include paths -target_include_directories(libcodelite - PUBLIC - "${CL_SRC_ROOT}/sdk/wxsqlite3/include" - "${CL_SRC_ROOT}/CodeLite" - "${CL_SRC_ROOT}/CodeLite/ssh" - "${CL_SRC_ROOT}/PCH" - PRIVATE - "${CL_SRC_ROOT}/submodules/asio/asio/include" - "${CL_SRC_ROOT}/submodules/websocketpp" -) +target_include_directories( + libcodelite + PUBLIC "${CL_SRC_ROOT}/sdk/wxsqlite3/include" "${CL_SRC_ROOT}/CodeLite" "${CL_SRC_ROOT}/CodeLite/ssh" + "${CL_SRC_ROOT}/PCH" + PRIVATE "${CL_SRC_ROOT}/submodules/asio/asio/include" "${CL_SRC_ROOT}/submodules/websocketpp") # Macros if(WIN32) - target_compile_definitions(libcodelite PRIVATE WXMAKINGDLL_CL INTERFACE WXUSINGDLL_CL) + target_compile_definitions( + libcodelite + PRIVATE WXMAKINGDLL_CL + INTERFACE WXUSINGDLL_CL) target_compile_definitions(libcodelite PUBLIC WXUSINGDLL_WXSQLITE3) endif() @@ -85,7 +84,6 @@ endif() target_link_libraries( libcodelite ${LINKER_OPTIONS} - ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" ${SQLite3_LIBRARIES} libCxxParser @@ -94,8 +92,7 @@ target_link_libraries( ${GTK_LIBS} ${ADDITIONAL_LIBRARIES} ${LIBUCHARDET_LIB} - cJSON -) + cJSON) if(MINGW) set_target_properties( diff --git a/CodeLiteDiff/CMakeLists.txt b/CodeLiteDiff/CMakeLists.txt index 8ee099bcb3..877b7f1150 100644 --- a/CodeLiteDiff/CMakeLists.txt +++ b/CodeLiteDiff/CMakeLists.txt @@ -33,6 +33,6 @@ endif() # Codelite plugins doesn't use the "lib" prefix. set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Installation destination cl_install_plugin(${PLUGIN_NAME}) diff --git a/ContinuousBuild/CMakeLists.txt b/ContinuousBuild/CMakeLists.txt index e21dfc1be5..56abf63d11 100644 --- a/ContinuousBuild/CMakeLists.txt +++ b/ContinuousBuild/CMakeLists.txt @@ -27,5 +27,5 @@ set_target_properties(${PLUGIN_NAME} PROPERTIES OUTPUT_NAME "ContinuousBuild") # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/Copyright/CMakeLists.txt b/Copyright/CMakeLists.txt index 88463520d6..c3e51b8181 100644 --- a/Copyright/CMakeLists.txt +++ b/Copyright/CMakeLists.txt @@ -29,5 +29,5 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/CxxParser/CMakeLists.txt b/CxxParser/CMakeLists.txt index 38bd524ed9..6741a372eb 100644 --- a/CxxParser/CMakeLists.txt +++ b/CxxParser/CMakeLists.txt @@ -1,43 +1,42 @@ project(CxxParser) # Bison files -BISON_TARGET(CppScopeGrammarYacc "${CMAKE_SOURCE_DIR}/CxxParser/cpp_scope_grammar.y" "${CMAKE_CURRENT_BINARY_DIR}/cpp_scope_grammar.cpp" - DEFINES_FILE "${CMAKE_CURRENT_BINARY_DIR}/cpp_lexer.h" - COMPILE_FLAGS "-p cl_scope_ --no-lines") -BISON_TARGET(TypedefGrammarYacc "${CMAKE_SOURCE_DIR}/CxxParser/typedef_grammar.y" "${CMAKE_CURRENT_BINARY_DIR}/typedef_parser.cpp" - COMPILE_FLAGS "-p cl_typedef_ --no-lines") -BISON_TARGET(CppVariablesGrammarYacc "${CMAKE_SOURCE_DIR}/CxxParser/cpp_variables_grammar.y" "${CMAKE_CURRENT_BINARY_DIR}/var_parser.cpp" - COMPILE_FLAGS "-p cl_var_ --no-lines") -BISON_TARGET(ExprGrammarYacc "${CMAKE_SOURCE_DIR}/CxxParser/expr_grammar.y" "${CMAKE_CURRENT_BINARY_DIR}/cpp_expr_parser.cpp" - COMPILE_FLAGS "-p cl_expr_ --no-lines") -BISON_TARGET(CppFuncParserYacc "${CMAKE_SOURCE_DIR}/CxxParser/cpp_func_parser.y" "${CMAKE_CURRENT_BINARY_DIR}/cpp_func_parser.cpp" - COMPILE_FLAGS "-p cl_func_ --no-lines") +bison_target( + CppScopeGrammarYacc "${CMAKE_SOURCE_DIR}/CxxParser/cpp_scope_grammar.y" + "${CMAKE_CURRENT_BINARY_DIR}/cpp_scope_grammar.cpp" + DEFINES_FILE "${CMAKE_CURRENT_BINARY_DIR}/cpp_lexer.h" + COMPILE_FLAGS "-p cl_scope_ --no-lines") +bison_target(TypedefGrammarYacc "${CMAKE_SOURCE_DIR}/CxxParser/typedef_grammar.y" + "${CMAKE_CURRENT_BINARY_DIR}/typedef_parser.cpp" COMPILE_FLAGS "-p cl_typedef_ --no-lines") +bison_target(CppVariablesGrammarYacc "${CMAKE_SOURCE_DIR}/CxxParser/cpp_variables_grammar.y" + "${CMAKE_CURRENT_BINARY_DIR}/var_parser.cpp" COMPILE_FLAGS "-p cl_var_ --no-lines") +bison_target(ExprGrammarYacc "${CMAKE_SOURCE_DIR}/CxxParser/expr_grammar.y" + "${CMAKE_CURRENT_BINARY_DIR}/cpp_expr_parser.cpp" COMPILE_FLAGS "-p cl_expr_ --no-lines") +bison_target(CppFuncParserYacc "${CMAKE_SOURCE_DIR}/CxxParser/cpp_func_parser.y" + "${CMAKE_CURRENT_BINARY_DIR}/cpp_func_parser.cpp" COMPILE_FLAGS "-p cl_func_ --no-lines") set(BisonSrcs - "${BISON_CppScopeGrammarYacc_OUTPUTS}" - "${BISON_TypedefGrammarYacc_OUTPUTS}" - "${BISON_CppVariablesGrammarYacc_OUTPUTS}" - "${BISON_ExprGrammarYacc_OUTPUTS}" - "${BISON_CppFuncParserYacc_OUTPUTS}" -) + "${BISON_CppScopeGrammarYacc_OUTPUTS}" "${BISON_TypedefGrammarYacc_OUTPUTS}" + "${BISON_CppVariablesGrammarYacc_OUTPUTS}" "${BISON_ExprGrammarYacc_OUTPUTS}" "${BISON_CppFuncParserYacc_OUTPUTS}") # Flex files -FLEX_TARGET(CppFlex "${CMAKE_SOURCE_DIR}/CxxParser/cpp.l" "${CMAKE_CURRENT_BINARY_DIR}/cpp.cpp" +flex_target(CppFlex "${CMAKE_SOURCE_DIR}/CxxParser/cpp.l" "${CMAKE_CURRENT_BINARY_DIR}/cpp.cpp" COMPILE_FLAGS "-Pcl_scope_ --noline --yylineno --batch") # Increase YY_BUF_SIZE from 16384 to 16384*5 set_source_files_properties("${FLEX_CppFlex_OUTPUTS}" PROPERTIES COMPILE_DEFINITIONS "YY_BUF_SIZE=(16384*5)") -FLEX_TARGET(ExprLexerFlex "${CMAKE_SOURCE_DIR}/CxxParser/expr_lexer.l" "${CMAKE_CURRENT_BINARY_DIR}/expr_lexer.cpp" +flex_target(ExprLexerFlex "${CMAKE_SOURCE_DIR}/CxxParser/expr_lexer.l" "${CMAKE_CURRENT_BINARY_DIR}/expr_lexer.cpp" COMPILE_FLAGS "-Pcl_expr_ --noline --yylineno --batch") # Increase YY_BUF_SIZE from 16384 to 16384*5 set_source_files_properties("${FLEX_ExprLexerFlex_OUTPUTS}" PROPERTIES COMPILE_DEFINITIONS "YY_BUF_SIZE=(16384*5)") -ADD_FLEX_BISON_DEPENDENCY(CppFlex CppScopeGrammarYacc) -ADD_FLEX_BISON_DEPENDENCY(ExprLexerFlex CppScopeGrammarYacc) +add_flex_bison_dependency(CppFlex CppScopeGrammarYacc) +add_flex_bison_dependency(ExprLexerFlex CppScopeGrammarYacc) set(FlexSrcs "${FLEX_CppFlex_OUTPUTS}" "${FLEX_ExprLexerFlex_OUTPUTS}") # Define the outputs -add_library(libCxxParser STATIC +add_library( + libCxxParser STATIC cl_typedef.h code_completion_api.h expression_result.cpp @@ -47,25 +46,22 @@ add_library(libCxxParser STATIC variable.cpp variable.h ${FlexSrcs} - ${BisonSrcs} -) + ${BisonSrcs}) if(UNIX OR APPLE) set_target_properties(libCxxParser PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() # Include paths -target_include_directories(libCxxParser +target_include_directories( + libCxxParser PUBLIC "${CL_SRC_ROOT}/CxxParser" - PRIVATE "${CMAKE_CURRENT_BINARY_DIR}" -) + PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") if(WIN32) target_compile_definitions(libCxxParser PRIVATE WXMAKINGDLL_CL) endif() # "testing" application -add_executable(CxxParser - main.cpp -) +add_executable(CxxParser main.cpp) target_link_libraries(CxxParser PRIVATE libCxxParser) diff --git a/CxxParserTests/CMakeLists.txt b/CxxParserTests/CMakeLists.txt index 8d8c99c3f8..20c7da119c 100644 --- a/CxxParserTests/CMakeLists.txt +++ b/CxxParserTests/CMakeLists.txt @@ -20,7 +20,7 @@ if(USE_PCH) endif() # Remove the "lib" prefix from the plugin name -target_link_libraries(CxxLocalVariables ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin wxsqlite3) +target_link_libraries(CxxLocalVariables ${LINKER_OPTIONS} libcodelite plugin wxsqlite3) add_definitions(-DCXX_TEST_DIR=\"${CL_SRC_ROOT}/CxxParserTests/Test/\") cl_install_executable(CxxLocalVariables) diff --git a/DatabaseExplorer/CMakeLists.txt b/DatabaseExplorer/CMakeLists.txt index a6670950fe..5097ec339b 100644 --- a/DatabaseExplorer/CMakeLists.txt +++ b/DatabaseExplorer/CMakeLists.txt @@ -72,8 +72,7 @@ if(USE_PCH AND NOT MINGW) endif() # Include paths -include_directories( - "${CL_SRC_ROOT}/sdk/databaselayer/include") +include_directories("${CL_SRC_ROOT}/sdk/databaselayer/include") add_definitions(-DDBL_USE_SQLITE) @@ -102,7 +101,6 @@ endif() target_link_libraries( ${PLUGIN_NAME} ${LINKER_OPTIONS} - ${wxWidgets_LIBRARIES} ${GTK_LIBS} libcodelite plugin diff --git a/DebugAdapterClient/CMakeLists.txt b/DebugAdapterClient/CMakeLists.txt index d0c5543854..109ad15f42 100644 --- a/DebugAdapterClient/CMakeLists.txt +++ b/DebugAdapterClient/CMakeLists.txt @@ -16,14 +16,7 @@ add_library(${PLUGIN_NAME} SHARED ${PLUGIN_SRCS}) # Codelite plugins doesn't use the "lib" prefix. set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries( - ${PLUGIN_NAME} - ${LINKER_OPTIONS} - ${wxWidgets_LIBRARIES} - ${LIBLLDB} - libcodelite - plugin - dapcxx) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${LIBLLDB} libcodelite plugin dapcxx) target_include_directories(${PLUGIN_NAME} PRIVATE "${CL_SRC_ROOT}/submodules/wxdap") # Installation destination cl_install_plugin(${PLUGIN_NAME}) diff --git a/Debugger/CMakeLists.txt b/Debugger/CMakeLists.txt index 2b421440ef..67112176d8 100644 --- a/Debugger/CMakeLists.txt +++ b/Debugger/CMakeLists.txt @@ -29,6 +29,6 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin libgdbparser) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin libgdbparser) cl_install_debugger(${PLUGIN_NAME}) diff --git a/Docker/CMakeLists.txt b/Docker/CMakeLists.txt index c97ee202a0..ded7ff3117 100644 --- a/Docker/CMakeLists.txt +++ b/Docker/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Use CodeLite's macro: CL_INSTALL_PLUGIN which handles both OSX and Linux installation cl_install_plugin(${PLUGIN_NAME}) diff --git a/EOSWiki/CMakeLists.txt b/EOSWiki/CMakeLists.txt index a591e0fd35..89572a80c9 100644 --- a/EOSWiki/CMakeLists.txt +++ b/EOSWiki/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Use CodeLite's macro: CL_INSTALL_PLUGIN which handles both OSX and Linux installation cl_install_plugin(${PLUGIN_NAME}) diff --git a/EditorConfigPlugin/CMakeLists.txt b/EditorConfigPlugin/CMakeLists.txt index 1b9ee02b7b..abacdeb6f8 100644 --- a/EditorConfigPlugin/CMakeLists.txt +++ b/EditorConfigPlugin/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Use CodeLite's macro: CL_INSTALL_PLUGIN which handles both OSX and Linux installation cl_install_plugin(${PLUGIN_NAME}) diff --git a/ExternalTools/CMakeLists.txt b/ExternalTools/CMakeLists.txt index 5803eccd8b..a5015ed00c 100644 --- a/ExternalTools/CMakeLists.txt +++ b/ExternalTools/CMakeLists.txt @@ -30,6 +30,6 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Installation destination cl_install_plugin(${PLUGIN_NAME}) diff --git a/Gizmos/CMakeLists.txt b/Gizmos/CMakeLists.txt index 0d2782d661..1efb4b7fe6 100644 --- a/Gizmos/CMakeLists.txt +++ b/Gizmos/CMakeLists.txt @@ -29,6 +29,6 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Installation destination cl_install_plugin(${PLUGIN_NAME}) diff --git a/HelpPlugin/CMakeLists.txt b/HelpPlugin/CMakeLists.txt index 7d637d1c2f..ca2fbee3a2 100644 --- a/HelpPlugin/CMakeLists.txt +++ b/HelpPlugin/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Use CodeLite's macro: CL_INSTALL_PLUGIN which handles both OSX and Linux installation cl_install_plugin(${PLUGIN_NAME}) diff --git a/LanguageServer/CMakeLists.txt b/LanguageServer/CMakeLists.txt index 7a0b954723..0b6c278028 100644 --- a/LanguageServer/CMakeLists.txt +++ b/LanguageServer/CMakeLists.txt @@ -32,7 +32,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Use CodeLite's macro: CL_INSTALL_PLUGIN which handles both OSX and Linux installation cl_install_plugin(${PLUGIN_NAME}) diff --git a/LiteEditor/CMakeLists.txt b/LiteEditor/CMakeLists.txt index f03b29e334..8a1fdfcfe6 100644 --- a/LiteEditor/CMakeLists.txt +++ b/LiteEditor/CMakeLists.txt @@ -64,7 +64,6 @@ if(GTK2_FOUND) codelite ${LINKER_OPTIONS} ${GTK2_LIBRARIES} - ${wxWidgets_LIBRARIES} ${CLANG_LIBRARY} -L"${CL_LIBPATH}" libcodelite @@ -75,7 +74,6 @@ elseif(GTK3_FOUND) codelite ${LINKER_OPTIONS} ${GTK3_LIBRARIES} - ${wxWidgets_LIBRARIES} ${CLANG_LIBRARY} -L"${CL_LIBPATH}" libcodelite @@ -85,7 +83,6 @@ else() target_link_libraries( codelite ${LINKER_OPTIONS} - ${wxWidgets_LIBRARIES} ${CLANG_LIBRARY} -L"${CL_LIBPATH}" libcodelite diff --git a/MacBundler/CMakeLists.txt b/MacBundler/CMakeLists.txt index 4df5d886ec..de226059a7 100644 --- a/MacBundler/CMakeLists.txt +++ b/MacBundler/CMakeLists.txt @@ -21,6 +21,6 @@ add_library(${PLUGIN_NAME} SHARED ${SRCS}) # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/MemCheck/CMakeLists.txt b/MemCheck/CMakeLists.txt index c4b0bd2882..8fc3514d0d 100644 --- a/MemCheck/CMakeLists.txt +++ b/MemCheck/CMakeLists.txt @@ -26,7 +26,7 @@ if(UNIX AND NOT APPLE) # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") - target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" libcodelite plugin) + target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} -L"${CL_LIBPATH}" libcodelite plugin) # Make sure that the plugin will not start build before 'plugin.so' is ready add_dependencies(${PLUGIN_NAME} plugin) diff --git a/Outline/CMakeLists.txt b/Outline/CMakeLists.txt index 171902d63d..0cd35959f0 100644 --- a/Outline/CMakeLists.txt +++ b/Outline/CMakeLists.txt @@ -29,6 +29,6 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Installation destination cl_install_plugin(${PLUGIN_NAME}) diff --git a/PHPLint/CMakeLists.txt b/PHPLint/CMakeLists.txt index 71c7fab1f1..b6ea7a978c 100644 --- a/PHPLint/CMakeLists.txt +++ b/PHPLint/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Use CodeLite's macro: CL_INSTALL_PLUGIN which handles both OSX and Linux installation cl_install_plugin(${PLUGIN_NAME}) diff --git a/PHPRefactoring/CMakeLists.txt b/PHPRefactoring/CMakeLists.txt index 6b0c9bdf03..90e4744835 100644 --- a/PHPRefactoring/CMakeLists.txt +++ b/PHPRefactoring/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Use CodeLite's macro: CL_INSTALL_PLUGIN which handles both OSX and Linux installation cl_install_plugin(${PLUGIN_NAME}) diff --git a/Plugin/CMakeLists.txt b/Plugin/CMakeLists.txt index 9c66e4436f..7e28c2c213 100644 --- a/Plugin/CMakeLists.txt +++ b/Plugin/CMakeLists.txt @@ -11,19 +11,18 @@ file(GLOB_RECURSE SRCS "*.cpp" "*.h" "*.hpp") add_library(plugin SHARED ${SRCS}) # Include paths -target_include_directories(plugin - PUBLIC - "${CL_SRC_ROOT}/Plugin" - "${CL_SRC_ROOT}/Interfaces" - PRIVATE - "${CL_SRC_ROOT}/submodules/yaml-cpp/include" - "${CL_SRC_ROOT}/ThemeImporters" - "${CL_SRC_ROOT}/wxTerminalCtrl" -) +target_include_directories( + plugin + PUBLIC "${CL_SRC_ROOT}/Plugin" "${CL_SRC_ROOT}/Interfaces" + PRIVATE "${CL_SRC_ROOT}/submodules/yaml-cpp/include" "${CL_SRC_ROOT}/ThemeImporters" + "${CL_SRC_ROOT}/wxTerminalCtrl") # Macros if(WIN32) - target_compile_definitions(plugin PRIVATE WXMAKINGDLL_SDK INTERFACE WXUSINGDLL_SDK) + target_compile_definitions( + plugin + PRIVATE WXMAKINGDLL_SDK + INTERFACE WXUSINGDLL_SDK) endif(WIN32) if(USE_PCH AND NOT MINGW) @@ -87,7 +86,6 @@ target_link_libraries( ${LINKER_OPTIONS} ${ADDITIONAL_LIBRARIES} ${GTK3_LIBRARIES} - ${wxWidgets_LIBRARIES} ${LIBYAML_CPP} -L"${CL_LIBPATH}" lexers_extra diff --git a/QmakePlugin/CMakeLists.txt b/QmakePlugin/CMakeLists.txt index fd1c0e310f..3d4d60c421 100644 --- a/QmakePlugin/CMakeLists.txt +++ b/QmakePlugin/CMakeLists.txt @@ -29,6 +29,6 @@ endif() # Codelite plugins doesn't use the "lib" prefix. set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Installation destination cl_install_plugin(${PLUGIN_NAME}) diff --git a/Remoty/CMakeLists.txt b/Remoty/CMakeLists.txt index b28da75d0b..5136f22114 100644 --- a/Remoty/CMakeLists.txt +++ b/Remoty/CMakeLists.txt @@ -29,6 +29,6 @@ endif() # Codelite plugins doesn't use the "lib" prefix. set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Installation destination cl_install_plugin(${PLUGIN_NAME}) diff --git a/Rust/CMakeLists.txt b/Rust/CMakeLists.txt index 4693fe15d9..a2b968d2a1 100644 --- a/Rust/CMakeLists.txt +++ b/Rust/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Codelite plugins doesn't use the "lib" prefix. set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Installation destination cl_install_plugin(${PLUGIN_NAME}) diff --git a/SFTP/CMakeLists.txt b/SFTP/CMakeLists.txt index 5de579a42a..9bca734c83 100644 --- a/SFTP/CMakeLists.txt +++ b/SFTP/CMakeLists.txt @@ -29,6 +29,6 @@ endif() # Codelite plugins doesn't use the "lib" prefix. set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Installation destination cl_install_plugin(${PLUGIN_NAME}) diff --git a/SmartCompletion/CMakeLists.txt b/SmartCompletion/CMakeLists.txt index a8084f4c4a..d44f006cd8 100644 --- a/SmartCompletion/CMakeLists.txt +++ b/SmartCompletion/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Use CodeLite's macro: CL_INSTALL_PLUGIN which handles both OSX and Linux installation cl_install_plugin(${PLUGIN_NAME}) diff --git a/SnipWiz/CMakeLists.txt b/SnipWiz/CMakeLists.txt index 408ddabf6d..9e0fb66b7e 100644 --- a/SnipWiz/CMakeLists.txt +++ b/SnipWiz/CMakeLists.txt @@ -29,5 +29,5 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/SpellChecker/CMakeLists.txt b/SpellChecker/CMakeLists.txt index 232d5f98a3..694b8b50ed 100644 --- a/SpellChecker/CMakeLists.txt +++ b/SpellChecker/CMakeLists.txt @@ -33,9 +33,7 @@ else() include("${wxWidgets_USE_FILE}") # Include paths - include_directories( - "${CL_SRC_ROOT}/SpellChecker" - "${HUNSPELL_H}") + include_directories("${CL_SRC_ROOT}/SpellChecker" "${HUNSPELL_H}") if(USE_PCH AND NOT MINGW) add_definitions(-include "${CL_PCH_FILE}") @@ -57,7 +55,7 @@ else() # Codelite plugins doesn't use the "lib" prefix. set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") - target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} ${LIBHUNSPELL} libcodelite plugin) + target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${LIBHUNSPELL} libcodelite plugin) # Installation destination cl_install_plugin(${PLUGIN_NAME}) diff --git a/Subversion2/CMakeLists.txt b/Subversion2/CMakeLists.txt index af905cb738..0f02dae56f 100644 --- a/Subversion2/CMakeLists.txt +++ b/Subversion2/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Codelite plugins doesn't use the "lib" prefix. set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Installation destination cl_install_plugin(${PLUGIN_NAME}) diff --git a/Tail/CMakeLists.txt b/Tail/CMakeLists.txt index bb1e5a6ac7..cd36e1d384 100644 --- a/Tail/CMakeLists.txt +++ b/Tail/CMakeLists.txt @@ -29,7 +29,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Use CodeLite's macro: CL_INSTALL_PLUGIN which handles both OSX and Linux installation cl_install_plugin(${PLUGIN_NAME}) diff --git a/TestDir/CMakeLists.txt b/TestDir/CMakeLists.txt index 56bd1a0e25..673e030bc9 100644 --- a/TestDir/CMakeLists.txt +++ b/TestDir/CMakeLists.txt @@ -4,4 +4,4 @@ include(${wxWidgets_USE_FILE}) # prepare list of files file(GLOB SRCS "*.cpp") add_executable(makedir ${SRCS}) -target_link_libraries(makedir ${wxWidgets_LIBRARIES}) +target_link_libraries(makedir) diff --git a/UnitTestCPP/CMakeLists.txt b/UnitTestCPP/CMakeLists.txt index 019a219221..2cff03f744 100644 --- a/UnitTestCPP/CMakeLists.txt +++ b/UnitTestCPP/CMakeLists.txt @@ -29,6 +29,6 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/WebTools/CMakeLists.txt b/WebTools/CMakeLists.txt index 8e636203c5..231abb8a01 100644 --- a/WebTools/CMakeLists.txt +++ b/WebTools/CMakeLists.txt @@ -29,6 +29,6 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/WordCompletion/CMakeLists.txt b/WordCompletion/CMakeLists.txt index d979d840dc..ca24dffcfc 100644 --- a/WordCompletion/CMakeLists.txt +++ b/WordCompletion/CMakeLists.txt @@ -14,7 +14,7 @@ if(USE_PCH AND NOT MINGW) add_definitions(-Winvalid-pch) endif() -FLEX_TARGET(WordFlex "WordTokenizer.l" "${CMAKE_CURRENT_BINARY_DIR}/WordTokenizer.cpp" +flex_target(WordFlex "WordTokenizer.l" "${CMAKE_CURRENT_BINARY_DIR}/WordTokenizer.cpp" COMPILE_FLAGS "-Pword --noline --yylineno --batch") set(FlexSrcs "${FLEX_WordFlex_OUTPUTS}") @@ -36,5 +36,5 @@ target_include_directories(${PLUGIN_NAME} PRIVATE .) # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/ZoomNavigator/CMakeLists.txt b/ZoomNavigator/CMakeLists.txt index 38adfb57e8..538f79991c 100644 --- a/ZoomNavigator/CMakeLists.txt +++ b/ZoomNavigator/CMakeLists.txt @@ -29,5 +29,5 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/abbreviation/CMakeLists.txt b/abbreviation/CMakeLists.txt index 08d86d548e..40fd206327 100644 --- a/abbreviation/CMakeLists.txt +++ b/abbreviation/CMakeLists.txt @@ -24,6 +24,6 @@ endif() # Codelite plugins doesn't use the "lib" prefix. set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Installation destination cl_install_plugin(${PLUGIN_NAME}) diff --git a/cmake/Modules/plugin.cmake b/cmake/Modules/plugin.cmake index 73e9b517e1..35ccde10f0 100644 --- a/cmake/Modules/plugin.cmake +++ b/cmake/Modules/plugin.cmake @@ -1,5 +1,4 @@ -# CodeLite plugin function. -# Usage: +# CodeLite plugin function. Usage: # # CL_PLUGIN( "MyPlugin" ) @@ -20,13 +19,13 @@ function(CL_PLUGIN PLUGIN_NAME) # wxWidgets include (this will do all the magic to configure everything) include("${wxWidgets_USE_FILE}") - ## PreCompiled header support + # PreCompiled header support if(USE_PCH) add_definitions(-include "${CL_PCH_FILE}") add_definitions(-Winvalid-pch) endif(USE_PCH) - ## By default, use the sources under the current folder + # By default, use the sources under the current folder file(GLOB_RECURSE PLUGIN_SRCS "${CMAKE_CURRENT_LIST_DIR}/*.cpp" "${CMAKE_CURRENT_LIST_DIR}/*.c") # Define the output - shared library @@ -34,20 +33,14 @@ function(CL_PLUGIN PLUGIN_NAME) # Codelite plugins doesn't use the "lib" prefix. set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") - target_link_libraries( - ${PLUGIN_NAME} - ${LINKER_OPTIONS} - ${wxWidgets_LIBRARIES} - libcodelite - plugin - wxsqlite3) + target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin wxsqlite3) # Installation destination install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR}) endfunction() -# Scan the top level folders of the source tree, if a folder exists and it contains the a file -# named "codelite-plugin.cmake" in it, automatically include it +# Scan the top level folders of the source tree, if a folder exists and it contains the a file named +# "codelite-plugin.cmake" in it, automatically include it function(CL_SCAN_FOR_PLUGINS) message("-- CMAKE_SOURCE_DIR is set to ${CMAKE_SOURCE_DIR}") file( diff --git a/codelite-generate-themes/CMakeLists.txt b/codelite-generate-themes/CMakeLists.txt index dbdac9572a..bb60965bbd 100644 --- a/codelite-generate-themes/CMakeLists.txt +++ b/codelite-generate-themes/CMakeLists.txt @@ -1,30 +1,25 @@ -# Our project is called 'codelite' this is how it will be called in visual studio, and in our makefiles. -project(codelite-generate-themes) - -# It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'. -include(${wxWidgets_USE_FILE}) - -# prepare list of files -file(GLOB SRCS "codelite-generate-themes/*.cpp") - -include_directories("${CL_SRC_ROOT}/Plugin/ThemeImporters") - -add_definitions(-DwxDEBUG_LEVEL=0) - -set(CGT_RES_FILE "") -if(MINGW) - set(LINKER_OPTIONS "-mwindows") - set(CGT_RES_FILE "codelite-generate-themes/resources.rc") -endif() - -# Define the output -add_executable(codelite-generate-themes ${SRCS} ${CGT_RES_FILE}) - -target_link_libraries( - codelite-generate-themes - ${wxWidgets_LIBRARIES} - libcodelite - plugin - ${LINKER_OPTIONS}) - -install(TARGETS codelite-generate-themes DESTINATION ${CL_INSTALL_BIN}) +# Our project is called 'codelite' this is how it will be called in visual studio, and in our makefiles. +project(codelite-generate-themes) + +# It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'. +include(${wxWidgets_USE_FILE}) + +# prepare list of files +file(GLOB SRCS "codelite-generate-themes/*.cpp") + +include_directories("${CL_SRC_ROOT}/Plugin/ThemeImporters") + +add_definitions(-DwxDEBUG_LEVEL=0) + +set(CGT_RES_FILE "") +if(MINGW) + set(LINKER_OPTIONS "-mwindows") + set(CGT_RES_FILE "codelite-generate-themes/resources.rc") +endif() + +# Define the output +add_executable(codelite-generate-themes ${SRCS} ${CGT_RES_FILE}) + +target_link_libraries(codelite-generate-themes libcodelite plugin ${LINKER_OPTIONS}) + +install(TARGETS codelite-generate-themes DESTINATION ${CL_INSTALL_BIN}) diff --git a/codelite_make/CMakeLists.txt b/codelite_make/CMakeLists.txt index 2720b82278..af2255fbef 100644 --- a/codelite_make/CMakeLists.txt +++ b/codelite_make/CMakeLists.txt @@ -16,13 +16,6 @@ if(UNIX) set(UTIL_LIB "-lutil") endif(UNIX) -target_link_libraries( - codelite-make - ${LINKER_OPTIONS} - ${wxWidgets_LIBRARIES} - -L"${CL_LIBPATH}" - libcodelite - plugin - ${UTIL_LIB}) +target_link_libraries(codelite-make ${LINKER_OPTIONS} -L"${CL_LIBPATH}" libcodelite plugin ${UTIL_LIB}) cl_install_executable(codelite-make) diff --git a/codelite_vim/CMakeLists.txt b/codelite_vim/CMakeLists.txt index 1a1f177a21..e1da64701c 100644 --- a/codelite_vim/CMakeLists.txt +++ b/codelite_vim/CMakeLists.txt @@ -31,7 +31,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) # Use CodeLite's macro: CL_INSTALL_PLUGIN which handles both OSX and Linux installation cl_install_plugin(${PLUGIN_NAME}) diff --git a/codelitephp/CMakeLists.txt b/codelitephp/CMakeLists.txt index a95cadcb13..4955cca72c 100644 --- a/codelitephp/CMakeLists.txt +++ b/codelitephp/CMakeLists.txt @@ -20,10 +20,8 @@ else(NOT CL_SRC_ROOT) endif(NOT CL_SRC_ROOT) # Include paths -include_directories( - "${CL_SRC_ROOT}/codelitephp/PHPParser" - "${CL_SRC_ROOT}/codelitephp/php-plugin" - "${CL_SRC_ROOT}/codelitephp/PHPParserUnitTests") +include_directories("${CL_SRC_ROOT}/codelitephp/PHPParser" "${CL_SRC_ROOT}/codelitephp/php-plugin" + "${CL_SRC_ROOT}/codelitephp/PHPParserUnitTests") if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DebugFull) # Debug build of codelite @@ -56,7 +54,8 @@ if(BUILD_TESTING) file(GLOB UNIT_TESTS_SRC "PHPParserUnitTests/*.cpp") add_executable(PHPUnitTests ${UNIT_TESTS_SRC}) - target_link_libraries(PHPUnitTests + target_link_libraries( + PHPUnitTests ${LINKER_OPTIONS} -L"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" -L"${CL_LIBPATH}" @@ -64,11 +63,12 @@ if(BUILD_TESTING) libcodelite plugin ${ADDITIONAL_LIBRARIES} - ${wxWidgets_LIBRARIES} - wxsqlite3 - ) + wxsqlite3) - add_test(NAME "PHPUnitTests" COMMAND PHPUnitTests WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/PHPParserUnitTests/Tests) + add_test( + NAME "PHPUnitTests" + COMMAND PHPUnitTests + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/PHPParserUnitTests/Tests) endif(BUILD_TESTING) set(ADDITIONAL_LIBRARIES "") @@ -78,7 +78,7 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} PHPParser libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} PHPParser libcodelite plugin) # Installation destination cl_install_plugin(${PLUGIN_NAME}) cl_install_file_shared("${CL_SRC_ROOT}/Runtime/PHP.zip") diff --git a/cppchecker/CMakeLists.txt b/cppchecker/CMakeLists.txt index 09e83ef84b..64f86639b1 100644 --- a/cppchecker/CMakeLists.txt +++ b/cppchecker/CMakeLists.txt @@ -20,5 +20,5 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/cscope/CMakeLists.txt b/cscope/CMakeLists.txt index 4c7bbad3f8..1ee81724ef 100644 --- a/cscope/CMakeLists.txt +++ b/cscope/CMakeLists.txt @@ -29,5 +29,5 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/ctagsd/CMakeLists.txt b/ctagsd/CMakeLists.txt index 2b4a47edd0..f43628c3ce 100644 --- a/ctagsd/CMakeLists.txt +++ b/ctagsd/CMakeLists.txt @@ -6,30 +6,26 @@ 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(ctagsd) set(CMAKE_EXPORT_COMPILE_COMMANDS 1) -# It was noticed that when using MinGW gcc it is essential that 'core' is -# mentioned before 'base'. +# It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'. include("${wxWidgets_USE_FILE}") if(APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif() if(NOT CL_WX_CONFIG) - set(CL_WX_CONFIG "wx-config") + set(CL_WX_CONFIG "wx-config") 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 if(NOT MINGW) 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) endif() set (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) else() 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}") message("${WX_CXX_FLAGS}") # and finally prepare list of includes directories @@ -37,46 +33,41 @@ include_directories("${CL_SRC_ROOT}/ctagsd/lib") set(UTIL_LIB "") if(UNIX) - set(UTIL_LIB "-lutil -ldl") + set(UTIL_LIB "-lutil") endif(UNIX) file(GLOB LIBSRC "lib/*.cpp") add_library(ctagdslib STATIC "${LIBSRC}") target_link_libraries(ctagdslib PRIVATE libcodelite plugin) -target_include_directories( - ctagdslib - PUBLIC - "${CL_SRC_ROOT}/CxxParser" -) +target_include_directories(ctagdslib PUBLIC "${CL_SRC_ROOT}/CxxParser") add_executable(ctagsd "main.cpp") target_link_libraries( - ctagsd - ctagdslib - ${LINKER_OPTIONS} - ${wxWidgets_LIBRARIES} - -L"${CL_LIBPATH}" - libcodelite - plugin - ${UTIL_LIB}) - -cl_install_executable(ctagsd) - -include(CTest) -if(BUILD_TESTING) - add_executable(ctagsd-tests "tests/main.cpp" "tests/tester.cpp") - target_link_libraries(ctagsd-tests + ctagsd ctagdslib ${LINKER_OPTIONS} - ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" libcodelite plugin - wxsqlite3 ${UTIL_LIB}) - add_test(NAME "ctagsd-tests" COMMAND ctagsd-tests) +cl_install_executable(ctagsd) - cl_install_executable(ctagsd-tests) +include(CTest) +if(BUILD_TESTING) + add_executable(ctagsd-tests "tests/main.cpp" "tests/tester.cpp") + target_link_libraries( + ctagsd-tests + ctagdslib + ${LINKER_OPTIONS} + -L"${CL_LIBPATH}" + libcodelite + plugin + wxsqlite3 + ${UTIL_LIB}) + + add_test(NAME "ctagsd-tests" COMMAND ctagsd-tests) + + cl_install_executable(ctagsd-tests) endif(BUILD_TESTING) diff --git a/gdbparser/CMakeLists.txt b/gdbparser/CMakeLists.txt index d36744c94b..41279cb5de 100644 --- a/gdbparser/CMakeLists.txt +++ b/gdbparser/CMakeLists.txt @@ -1,43 +1,36 @@ project(gdbparser) # Bison files -BISON_TARGET(GdbResultParserYacc "${CMAKE_SOURCE_DIR}/gdbparser/gdb_result.y" "${CMAKE_CURRENT_BINARY_DIR}/gdb_result_parser.cpp" - DEFINES_FILE "${CMAKE_CURRENT_BINARY_DIR}/gdb_result_parser.h" - COMPILE_FLAGS "-p gdb_result_ --no-lines") +bison_target( + GdbResultParserYacc "${CMAKE_SOURCE_DIR}/gdbparser/gdb_result.y" "${CMAKE_CURRENT_BINARY_DIR}/gdb_result_parser.cpp" + DEFINES_FILE "${CMAKE_CURRENT_BINARY_DIR}/gdb_result_parser.h" + COMPILE_FLAGS "-p gdb_result_ --no-lines") set(BisonSrcs "${BISON_GdbResultParserYacc_OUTPUTS}") # Flex files -FLEX_TARGET(GdbResultFlex "${CMAKE_SOURCE_DIR}/gdbparser/gdb_result.l" "${CMAKE_CURRENT_BINARY_DIR}/gdbresult.cpp" +flex_target(GdbResultFlex "${CMAKE_SOURCE_DIR}/gdbparser/gdb_result.l" "${CMAKE_CURRENT_BINARY_DIR}/gdbresult.cpp" COMPILE_FLAGS "-Pgdb_result_ --noline --yylineno --batch") -ADD_FLEX_BISON_DEPENDENCY(GdbResultFlex GdbResultParserYacc) +add_flex_bison_dependency(GdbResultFlex GdbResultParserYacc) set(FlexSrcs "${FLEX_GdbResultFlex_OUTPUTS}") # Define the outputs -add_library(libgdbparser STATIC - gdb_parser_incl.h - ${FlexSrcs} - ${BisonSrcs} -) +add_library(libgdbparser STATIC gdb_parser_incl.h ${FlexSrcs} ${BisonSrcs}) if(UNIX OR APPLE) set_target_properties(libgdbparser PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() # Include paths -target_include_directories(libgdbparser - PUBLIC "${CL_SRC_ROOT}/gdbparser" "${CMAKE_CURRENT_BINARY_DIR}" -) +target_include_directories(libgdbparser PUBLIC "${CL_SRC_ROOT}/gdbparser" "${CMAKE_CURRENT_BINARY_DIR}") include(CTest) if(BUILD_TESTING) # "testing" application - add_executable(gdbparser - main.cpp - ) + add_executable(gdbparser main.cpp) target_link_libraries(gdbparser PRIVATE libgdbparser) add_test(NAME "gdbparser" COMMAND gdbparser) diff --git a/git/CMakeLists.txt b/git/CMakeLists.txt index f048b6dd2a..b7f2aac4ad 100644 --- a/git/CMakeLists.txt +++ b/git/CMakeLists.txt @@ -20,6 +20,6 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME}) diff --git a/sdk/databaselayer/CMakeLists.txt b/sdk/databaselayer/CMakeLists.txt index f902108e77..30817358cf 100644 --- a/sdk/databaselayer/CMakeLists.txt +++ b/sdk/databaselayer/CMakeLists.txt @@ -75,7 +75,7 @@ if(UNIX OR APPLE) set_target_properties(databaselayersqlite PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() -target_link_libraries(databaselayersqlite ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} ${SQLite3_LIBRARIES}) +target_link_libraries(databaselayersqlite PRIVATE ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} ${SQLite3_LIBRARIES}) if(WITH_POSTGRES) find_package(PostgreSQL REQUIRED) diff --git a/submodules/CMakeLists.txt b/submodules/CMakeLists.txt index dbe78c6baf..7808c7628f 100644 --- a/submodules/CMakeLists.txt +++ b/submodules/CMakeLists.txt @@ -1,43 +1,38 @@ cmake_minimum_required(VERSION 3.18) -# ############################################################################## +# ###################################################################################################################### # Check submodules are here -# ############################################################################## +# ###################################################################################################################### find_path(CTAGS_SUBMODULE CMakeLists.txt PATHS ${CMAKE_CURRENT_SOURCE_DIR}/ctags/) if(NOT CTAGS_SUBMODULE) - message(STATUS "Could not locate `${CMAKE_CURRENT_SOURCE_DIR}/ctags/CMakeLists.txt` file") - message(FATAL_ERROR "Please make sure you have run `git submodule update --init`") + message(STATUS "Could not locate `${CMAKE_CURRENT_SOURCE_DIR}/ctags/CMakeLists.txt` file") + message(FATAL_ERROR "Please make sure you have run `git submodule update --init`") endif() -# ############################################################################## +# ###################################################################################################################### # cJSON -# ############################################################################## -add_library(cJSON STATIC - ${CMAKE_CURRENT_SOURCE_DIR}/cJSON/cJSON.c - ${CMAKE_CURRENT_SOURCE_DIR}/cJSON/cJSON.h -) +# ###################################################################################################################### +add_library(cJSON STATIC ${CMAKE_CURRENT_SOURCE_DIR}/cJSON/cJSON.c ${CMAKE_CURRENT_SOURCE_DIR}/cJSON/cJSON.h) target_include_directories(cJSON PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/cJSON) -# ############################################################################## +# ###################################################################################################################### # For wxWidgets dependencies -# ############################################################################## +# ###################################################################################################################### include("${wxWidgets_USE_FILE}") -# ############################################################################## +# ###################################################################################################################### # wxshapeframework -# ############################################################################## -file(GLOB WXSF_SRCS - "${CMAKE_CURRENT_SOURCE_DIR}/wxsf-code/src/*.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/wxsf-code/src/wxxmlserializer/*.cpp" -) +# ###################################################################################################################### +file(GLOB WXSF_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/wxsf-code/src/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/wxsf-code/src/wxxmlserializer/*.cpp") add_library(wxshapeframework SHARED ${WXSF_SRCS}) target_include_directories(wxshapeframework PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/wxsf-code/src") target_include_directories(wxshapeframework PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/wxsf-code/include") if(WIN32) - target_compile_definitions(wxshapeframework PRIVATE WXMAKINGDLL_WXXS WXMAKINGDLL_WXSF) - target_compile_definitions(wxshapeframework INTERFACE WXUSINGDLL) + target_compile_definitions(wxshapeframework PRIVATE WXMAKINGDLL_WXXS WXMAKINGDLL_WXSF) + target_compile_definitions(wxshapeframework INTERFACE WXUSINGDLL) endif(WIN32) if(UNIX OR APPLE) diff --git a/wxcrafter/CMakeLists.txt b/wxcrafter/CMakeLists.txt index ebb7dcd52b..c8f8812402 100644 --- a/wxcrafter/CMakeLists.txt +++ b/wxcrafter/CMakeLists.txt @@ -118,16 +118,9 @@ target_link_libraries(${PLUGIN_NAME} wxcLib) if(NOT WXC_APP) if(NOT OFFICIAL_CL_BUILD) - target_link_libraries( - ${PLUGIN_NAME} - ${LINKER_OPTIONS} - ${wxWidgets_LIBRARIES} - wxsqlite3 - ${SQLite3_LIBRARIES} - libcodelite - plugin) + target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} wxsqlite3 ${SQLite3_LIBRARIES} libcodelite plugin) else(OFFICIAL_CL_BUILD) - target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES}) + target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS}) endif(NOT OFFICIAL_CL_BUILD) else() set(WXC_EXTRA_LIBS "") @@ -137,14 +130,7 @@ else() set(WXC_EXTRA_LIBS "-mwindows") endif() - target_link_libraries( - ${PLUGIN_NAME} - ${LINKER_OPTIONS} - ${wxWidgets_LIBRARIES} - wxsqlite3 - libcodelite - plugin - ${WXC_EXTRA_LIBS}) + target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} wxsqlite3 libcodelite plugin ${WXC_EXTRA_LIBS}) endif() if(NOT WXC_APP) diff --git a/wxformbuilder/CMakeLists.txt b/wxformbuilder/CMakeLists.txt index 47f822bffa..e42fd62162 100644 --- a/wxformbuilder/CMakeLists.txt +++ b/wxformbuilder/CMakeLists.txt @@ -1,20 +1,17 @@ - # set the plugin name here set(PLUGIN_NAME "wxFormBuilder") -# Our project is called 'plugin' this is how it will be called in visual studio, -# and in our makefiles. +# 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'. +# 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}") if(USE_PCH AND NOT MINGW) - add_definitions(-include "${CL_PCH_FILE}") - add_definitions(-Winvalid-pch) + add_definitions(-include "${CL_PCH_FILE}") + add_definitions(-Winvalid-pch) endif() file(GLOB SRCS "*.cpp") @@ -32,6 +29,5 @@ endif() # Remove the "lib" prefix from the plugin name set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "") -target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} - libcodelite plugin) +target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} libcodelite plugin) cl_install_plugin(${PLUGIN_NAME})