8888#
8989
9090# including binary directory for generated headers.
91- include_directories (${CMAKE_BINARY_DIR } )
91+ include_directories (${CMAKE_CURRENT_BINARY_DIR } )
9292
9393if (NOT APPLE )
9494 find_package (Threads REQUIRED)
@@ -106,7 +106,7 @@ function(merge_static_libs TARGET_NAME)
106106
107107 if (APPLE ) # Use OSX's libtool to merge archives
108108 # To produce a library we need at least one source file.
109- # It is created by add_custom_command below and will helps
109+ # It is created by add_custom_command below and will helps
110110 # also help to track dependencies.
111111 set (dummyfile ${CMAKE_CURRENT_BINARY_DIR} /${TARGET_NAME} _dummy.c)
112112
@@ -144,24 +144,24 @@ function(merge_static_libs TARGET_NAME)
144144 DEPENDS ${lib} ${objdir}
145145 WORKING_DIRECTORY ${objdir} )
146146
147- # Empty dummy source file that goes into merged library
148- set (mergebase ${lib} .mergebase.c)
149- add_custom_command (OUTPUT ${mergebase}
150- COMMAND ${CMAKE_COMMAND} -E touch ${mergebase}
151- DEPENDS ${objlistfile} )
147+ # Empty dummy source file that goes into merged library
148+ set (mergebase ${lib} .mergebase.c)
149+ add_custom_command (OUTPUT ${mergebase}
150+ COMMAND ${CMAKE_COMMAND} -E touch ${mergebase}
151+ DEPENDS ${objlistfile} )
152152
153153 list (APPEND mergebases "${mergebase} " )
154154 endforeach ()
155155
156156 add_library (${TARGET_NAME} STATIC ${mergebases} )
157- target_link_libraries (${TARGET_NAME} ${libs_deps} )
157+ target_link_libraries (${TARGET_NAME} ${libs_deps} )
158158
159159 # Get the file name of the generated library
160160 set (outlibfile "$<TARGET_FILE:${TARGET_NAME} >" )
161161
162162 foreach (lib ${libs} )
163163 add_custom_command (TARGET ${TARGET_NAME} POST_BUILD
164- COMMAND ${CMAKE_AR} cr ${outlibfile} *.o
164+ COMMAND ${CMAKE_AR} cr ${outlibfile} *.o
165165 COMMAND ${CMAKE_RANLIB} ${outlibfile}
166166 WORKING_DIRECTORY ${lib} .objdir)
167167 endforeach ()
@@ -362,4 +362,4 @@ function(py_proto_compile TARGET_NAME)
362362 set (py_srcs)
363363 protobuf_generate_python(py_srcs ${py_proto_compile_SRCS} )
364364 add_custom_target (${TARGET_NAME} ALL DEPENDS ${py_srcs} )
365- endfunction ()
365+ endfunction ()
0 commit comments