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})
8 add_library(${LIBNAME} SHARED ${SRCFILES})
9 set(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} ${LIBNAME})
10 ## Windows likes to link it this way back to app!
12 set_target_properties(${LIBNAME} PROPERTIES LINK_FLAGS lighttpd.lib)
16 set_target_properties(${LIBNAME} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
19 endmacro(ADD_AND_INSTALL_LIBRARY)
21 macro(LEMON_PARSER SRCFILE)
22 get_filename_component(SRCBASE ${SRCFILE} NAME_WE)
23 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${SRCBASE}.c ${CMAKE_CURRENT_BINARY_DIR}/${SRCBASE}.h
24 COMMAND ${CMAKE_BINARY_DIR}/build/lemon
25 ARGS -q ${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE} ${CMAKE_SOURCE_DIR}/src/lempar.c
26 DEPENDS ${CMAKE_BINARY_DIR}/build/lemon ${CMAKE_CURRENT_SOURCE_DIR}/${SRCFILE} ${CMAKE_SOURCE_DIR}/src/lempar.c
27 COMMENT "Generating ${SRCBASE}.c from ${SRCFILE}"
29 endmacro(LEMON_PARSER)
31 macro(ADD_TARGET_PROPERTIES _target _name)
33 foreach(_prop ${ARGN})
34 set(_properties "${_properties} ${_prop}")
36 get_target_property(_old_properties ${_target} ${_name})
37 message("adding property to ${_target} ${_name}:" ${_properties})
38 if(NOT _old_properties)
39 # in case it's NOTFOUND
42 set_target_properties(${_target} PROPERTIES ${_name} "${_old_properties} ${_properties}")
43 endmacro(ADD_TARGET_PROPERTIES)