Skip to content

Commit

Permalink
The build system to nativelty support OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
eranif committed Mar 27, 2015
1 parent c93f8b0 commit fcd7360
Show file tree
Hide file tree
Showing 49 changed files with 909 additions and 362 deletions.
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,21 @@ if (COPY_WX_LIBS MATCHES 1)
endif()
unset(COPY_WX_LIBS CACHE)

set( PLUGINS_DIR "${CL_PREFIX}/${CL_INSTALL_LIBDIR}/codelite")
## Will set PLUGINS_DIR to the proper location on Linux / OSX
include(OSXInstall)

## Under OSX, create the skeleton bundle directory
OSX_MAKE_BUNDLE_DIRECTORY()

add_definitions(-DYY_NEVER_INTERACTIVE=1)
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )

if (NOT MINGW)
add_definitions(-DINSTALL_DIR=\"${CL_PREFIX}/share/codelite\")
add_definitions(-DPLUGINS_DIR=\"${PLUGINS_DIR}\")
add_definitions(-DINSTALL_DIR=\"${CL_PREFIX}/share/codelite\")
add_definitions(-DPLUGINS_DIR=\"${PLUGINS_DIR}\")
else()
add_definitions(-DNDEBUG)
add_definitions(-DUSE_POSIX_LAYOUT)
add_definitions(-DNDEBUG)
add_definitions(-DUSE_POSIX_LAYOUT)
endif()

message("-- PLUGINS_DIR is set to ${PLUGINS_DIR}")
Expand Down
23 changes: 9 additions & 14 deletions CMakePlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,12 @@ add_library(${PLUGIN_NAME} SHARED ${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}
-L"${CL_LIBPATH}"
-llibcodelite
-lplugin
-lwxsqlite3
-lsqlite3lib
)

# The plugin library is required
add_dependencies(${PLUGIN_NAME} plugin)

# Installation destination
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR})
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
libcodelite
plugin
wxsqlite3
sqlite3lib
)

CL_INSTALL_PLUGIN(${PLUGIN_NAME})
5 changes: 4 additions & 1 deletion CallGraph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite -lplugin)
# Make sure that the plugin will not start build before 'plugin.so' is ready
add_dependencies(${PLUGIN_NAME} plugin)
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR})

if(UNIX AND NOT APPLE)
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR})
endif()
18 changes: 12 additions & 6 deletions CodeFormatter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ 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} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite -lplugin)

# Make sure that the plugin will not start build before 'plugin.so' is ready
add_dependencies(${PLUGIN_NAME} plugin)
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR})
install(FILES ${CL_SRC_ROOT}/Runtime/astyle.sample DESTINATION ${CL_PREFIX}/share/codelite)
target_link_libraries(${PLUGIN_NAME}
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
libcodelite
plugin
wxsqlite3
sqlite3lib
)


CL_INSTALL_PLUGIN(${PLUGIN_NAME})
CL_INSTALL_FILE_SHARED(${CL_SRC_ROOT}/Runtime/astyle.sample)
28 changes: 24 additions & 4 deletions CodeLite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,33 @@ FILE(GLOB SRCS "*.cpp" "../sdk/codelite_indexer/network/*.cpp" "SocketAPI/*.cpp"
# Define the output
add_library(libcodelite SHARED ${SRCS})
if (UNIX AND NOT APPLE )
target_link_libraries(libcodelite ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" -lsqlite3lib -lwxsqlite3 ${LIBSSH_LIB} ${ADDITIONAL_LIBRARIES})
target_link_libraries(libcodelite
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
-L"${CL_LIBPATH}"
sqlite3lib
wxsqlite3
${LIBSSH_LIB}
${ADDITIONAL_LIBRARIES})
else (UNIX AND NOT APPLE)
target_link_libraries(libcodelite ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} -L"${CL_LIBPATH}" -lsqlite3lib -lwxsqlite3 ${LIBSSH_LIB} ${ADDITIONAL_LIBRARIES} -lz -lcrypto)
target_link_libraries(libcodelite
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
-L"${CL_LIBPATH}"
sqlite3lib
wxsqlite3
${LIBSSH_LIB}
${ADDITIONAL_LIBRARIES}
-lz -lcrypto)
endif ( UNIX AND NOT APPLE )

if (NOT MINGW)
install(TARGETS libcodelite DESTINATION ${PLUGINS_DIR})
if(APPLE)
install(TARGETS libcodelite DESTINATION ${CMAKE_BINARY_DIR}/codelite.app/Contents/MacOS/)
CL_INSTALL_NAME_TOOL_STD(${CMAKE_BINARY_DIR}/codelite.app/Contents/MacOS/liblibcodelite.dylib)
else()
install(TARGETS ${_target_} DESTINATION ${PLUGINS_DIR})
endif()
else ()
install(TARGETS libcodelite RUNTIME DESTINATION ${CL_PREFIX}/bin LIBRARY DESTINATION ${CL_PREFIX}/lib ARCHIVE DESTINATION ${CL_PREFIX}/lib)
install(TARGETS libcodelite RUNTIME DESTINATION ${CL_PREFIX}/bin LIBRARY DESTINATION ${CL_PREFIX}/lib ARCHIVE DESTINATION ${CL_PREFIX}/lib)
endif()
21 changes: 8 additions & 13 deletions CodeLiteDiff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,12 @@ add_library(${PLUGIN_NAME} SHARED ${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}
-L"${CL_LIBPATH}"
-llibcodelite
-lplugin
-lwxsqlite3
-lsqlite3lib
)

# The plugin library is required
add_dependencies(${PLUGIN_NAME} plugin)

${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
libcodelite
plugin
wxsqlite3
sqlite3lib
)
# Installation destination
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR})
CL_INSTALL_PLUGIN(${PLUGIN_NAME})
13 changes: 9 additions & 4 deletions ContinuousBuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ 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} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite -lplugin)
# Make sure that the plugin will not start build before 'plugin.so' is ready
add_dependencies(${PLUGIN_NAME} plugin)
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR})
target_link_libraries(${PLUGIN_NAME}
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
libcodelite
plugin
wxsqlite3
sqlite3lib
)
CL_INSTALL_PLUGIN(${PLUGIN_NAME})
13 changes: 9 additions & 4 deletions Copyright/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ 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} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite -lplugin)
# Make sure that the plugin will not start build before 'plugin.so' is ready
add_dependencies(${PLUGIN_NAME} plugin)
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR})
target_link_libraries(${PLUGIN_NAME}
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
libcodelite
plugin
wxsqlite3
sqlite3lib
)
CL_INSTALL_PLUGIN(${PLUGIN_NAME})
21 changes: 16 additions & 5 deletions DatabaseExplorer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,22 @@ add_library(${PLUGIN_NAME} SHARED ${SRCS})

# Remove the "lib" prefix from the plugin name
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")

if (GTK3_FOUND)
target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} ${GTK3_LIBRARIES} ${LIBMYSQLCLIENT} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite -lplugin -ldatabaselayersqlite -lwxshapeframework)
set(GTK_LIBS ${GTK3_LIBRARIES})
else()
target_link_libraries(${PLUGIN_NAME} ${LINKER_OPTIONS} ${wxWidgets_LIBRARIES} ${GTK2_LIBRARIES} ${LIBMYSQLCLIENT} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite -lplugin -ldatabaselayersqlite -lwxshapeframework)
set(GTK_LIBS ${GTK2_LIBRARIES})
endif()
# Make sure that the plugin will not start build before 'plugin.so' is ready
add_dependencies(${PLUGIN_NAME} plugin)
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR})

target_link_libraries(${PLUGIN_NAME}
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
${GTK_LIBS}
libcodelite
plugin
wxsqlite3
sqlite3lib
wxshapeframework
databaselayersqlite
)
CL_INSTALL_PLUGIN(${PLUGIN_NAME})
16 changes: 11 additions & 5 deletions Debugger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ endif()

# Add RPATH
if (UNIX)
set (LINKER_OPTIONS -Wl,-rpath,"${PLUGINS_DIR}")
set (LINKER_OPTIONS -Wl,-rpath,"${PLUGINS_DIR}")
endif (UNIX)

FILE(GLOB SRCS "*.cpp")
Expand All @@ -48,7 +48,13 @@ 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} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite -lplugin)
# Make sure that the plugin will not start build before 'plugin.so' is ready
add_dependencies(${PLUGIN_NAME} plugin)
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR}/debuggers)
target_link_libraries(${PLUGIN_NAME}
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
libcodelite
plugin
wxsqlite3
sqlite3lib
)

CL_INSTALL_DEBUGGER(${PLUGIN_NAME})
15 changes: 11 additions & 4 deletions ExternalTools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ 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} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite -lplugin)
# Make sure that the plugin will not start build before 'plugin.so' is ready
add_dependencies(${PLUGIN_NAME} plugin)
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR})
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PLUGIN_NAME}
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
libcodelite
plugin
wxsqlite3
sqlite3lib
)
# Installation destination
CL_INSTALL_PLUGIN(${PLUGIN_NAME})
14 changes: 10 additions & 4 deletions Gizmos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ 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} -L"${CL_LIBPATH}" -lwxsqlite3 -lsqlite3lib -llibcodelite -lplugin)
# Make sure that the plugin will not start build before 'plugin.so' is ready
add_dependencies(${PLUGIN_NAME} plugin)
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR})
target_link_libraries(${PLUGIN_NAME}
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
libcodelite
plugin
wxsqlite3
sqlite3lib
)
# Installation destination
CL_INSTALL_PLUGIN(${PLUGIN_NAME})
27 changes: 9 additions & 18 deletions LLDBDebugger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,18 @@ endif()
# Codelite plugins doesn't use the "lib" prefix.
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PLUGIN_NAME}
${LINKER_OPTIONS}
${PLUGIN_EXTRA_LIBS}
${wxWidgets_LIBRARIES}
-L"${CL_LIBPATH}"
-lLLDBProtocol
-llibcodelite
-lplugin
-lwxsqlite3
-lsqlite3lib
)

# The plugin library is required
add_dependencies(${PLUGIN_NAME} plugin)

${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
libcodelite
plugin
wxsqlite3
sqlite3lib
)
# Installation destination
install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGINS_DIR})
CL_INSTALL_PLUGIN(${PLUGIN_NAME})

add_subdirectory(LLDBProtocol)
add_subdirectory(codelite-lldb)
add_dependencies(codelite-lldb LLDBProtocol)
add_dependencies(LLDBDebugger LLDBProtocol)

else()
message(" **** NOTICE: lldb is not available. You could try installing the lldb-3.4-dev (or equivalent) package")
Expand Down
17 changes: 8 additions & 9 deletions LLDBDebugger/codelite-lldb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,22 @@ endif (UNIX)

FILE(GLOB SRC "*.cpp")
include_directories(${CL_SRC_ROOT}/LLDBDebugger)

# codelite-lldb
add_executable(codelite-lldb ${SRC})
link_directories(${LLDB_LIB_PATH})
target_link_libraries(codelite-lldb ${LIBLLDB})
target_link_libraries( codelite-lldb
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
-L"${CL_LIBPATH}"
-lLLDBProtocol
-llibcodelite
-lplugin
-lwxsqlite3
-lsqlite3lib
LLDBProtocol
libcodelite
plugin
wxsqlite3
sqlite3lib
)
target_link_libraries(codelite-lldb LLDBProtocol)
add_dependencies(codelite-lldb plugin)
install(TARGETS codelite-lldb DESTINATION ${CL_PREFIX}/bin)

CL_INSTALL_EXECUTABLE(codelite-lldb)
if ( MAKE_DEB AND LLDB_OFFICIAL_FOUND MATCHES 1 )
message("-- Adding lldb-3.4-dev to deb dependencies")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS} lldb-3.4-dev")
Expand Down
Loading

0 comments on commit fcd7360

Please sign in to comment.