1 ## our modules are without the "lib" prefix
3 macro(ADD_AND_INSTALL_LIBRARY LIBNAME SRCFILES)
5 add_library(${LIBNAME} STATIC ${SRCFILES})
6 target_link_libraries(lighttpd ${LIBNAME})
9 add_library(${LIBNAME} MODULE ${SRCFILES})
11 add_library(${LIBNAME} SHARED ${SRCFILES})
13 set(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} ${LIBNAME})
14 ## Windows likes to link it this way back to app!
16 set_target_properties(${LIBNAME} PROPERTIES LINK_FLAGS lighttpd.lib)
20 set_target_properties(${LIBNAME} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
23 endmacro(ADD_AND_INSTALL_LIBRARY)
25 macro(LEMON_PARSER SRCFILE)
26 get_filename_component(SRCBASE ${SRCFILE} NAME_WE)
27 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${SRCBASE}.c ${CMAKE_CURRENT_BINARY_DIR}/${SRCBASE}.h
28 COMMAND ${CMAKE_BINARY_DIR}/build/lemon
29 ARGS -q ${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE} ${CMAKE_SOURCE_DIR}/src/lempar.c
30 DEPENDS ${CMAKE_BINARY_DIR}/build/lemon ${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE} ${CMAKE_SOURCE_DIR}/src/lempar.c
31 COMMENT "Generating ${SRCBASE}.c from ${SRCFILE}"
33 endmacro(LEMON_PARSER)
35 macro(ADD_TARGET_PROPERTIES _target _name)
37 foreach(_prop ${ARGN})
38 set(_properties "${_properties} ${_prop}")
40 get_target_property(_old_properties ${_target} ${_name})
41 message("adding property to ${_target} ${_name}:" ${_properties})
42 if(NOT _old_properties)
43 # in case it's NOTFOUND
46 set_target_properties(${_target} PROPERTIES ${_name} "${_old_properties} ${_properties}")
47 endmacro(ADD_TARGET_PROPERTIES)