I assume this will be a general question about including libraries with existing makefiles in cmake; but here is my context -
I am trying to include scintillaCMake in another project, and I have the following problem:
On Linux, scintilla has a makefile in the (say) directory ${CMAKE_CURRENT_SOURCE_DIR}/scintilla/gtk; if you run makein this directory (as usual), you will get a file ${CMAKE_CURRENT_SOURCE_DIR}/scintilla/bin/scintilla.awhich (I think) is a static library.
Now, if I try to use cmake ADD_LIBRARY, I would have to manually specify the scintilla sources in cmake - and I would prefer not to interfere with this, given that I already have a make file. So, I would prefer to call regular scintilla make- and then instruct CMAKE to somehow refer to the resulting one scintilla.a. (I believe that then it will not provide cross-platform compatibility - but note that the cross-platform version is not a problem for me at present, I would just like to build scintilla as part of this project that already uses cmake, only on Linux)
So, I worked a bit with this:
ADD_CUSTOM_COMMAND(
OUTPUT scintilla.a
COMMAND ${CMAKE_MAKE_PROGRAM}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/scintilla/gtk
COMMENT "Original scintilla makefile target" )
... but then add_custom_command adds a "target without output"; so I am trying to use several approaches for this, all of which fail (errors are indicated as a comment):
ADD_CUSTOM_TARGET(scintilla STATIC DEPENDS scintilla.a)
ADD_LIBRARY(scintilla STATIC DEPENDS scintilla.a)
ADD_LIBRARY(scintilla STATIC)
ADD_DEPENDENCIES(scintilla scintilla.a)
, , noob cmake - cmake make "" , cmake ?
,
!
EDIT: : CMake: ? - - , cmake...